mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 22:20:56 +00:00
Merge branch 'master' of github.com:swagger-api/swagger-codegen into feature/add-support-for-sortParamsByRequiredFlag-config-option-to-csharp-and-python
This commit is contained in:
commit
dcaa2dcb22
@ -103,6 +103,18 @@
|
|||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.1</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>test-jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -1,22 +1,30 @@
|
|||||||
package io.swagger.codegen;
|
package io.swagger.codegen;
|
||||||
|
|
||||||
|
import io.swagger.codegen.options.OptionsProvider;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import mockit.FullVerifications;
|
import mockit.FullVerifications;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public abstract class AbstractOptionsTest {
|
public abstract class AbstractOptionsTest {
|
||||||
|
private final OptionsProvider optionsProvider;
|
||||||
|
|
||||||
|
protected AbstractOptionsTest(OptionsProvider optionsProvider) {
|
||||||
|
this.optionsProvider = optionsProvider;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkOptionsProcessing() {
|
public void checkOptionsProcessing() {
|
||||||
getCodegenConfig().additionalProperties().putAll(getAvaliableOptions());
|
getCodegenConfig().additionalProperties().putAll(optionsProvider.createOptions());
|
||||||
setExpectations();
|
setExpectations();
|
||||||
|
|
||||||
getCodegenConfig().processOpts();
|
getCodegenConfig().processOpts();
|
||||||
@ -28,7 +36,7 @@ public abstract class AbstractOptionsTest {
|
|||||||
@Test(description = "check if all options described in documentation are presented in test case")
|
@Test(description = "check if all options described in documentation are presented in test case")
|
||||||
public void checkOptionsHelp() {
|
public void checkOptionsHelp() {
|
||||||
final List<String> cliOptions = Lists.transform(getCodegenConfig().cliOptions(), getCliOptionTransformer());
|
final List<String> cliOptions = Lists.transform(getCodegenConfig().cliOptions(), getCliOptionTransformer());
|
||||||
final Set<String> testOptions = getAvaliableOptions().keySet();
|
final Set<String> testOptions = optionsProvider.createOptions().keySet();
|
||||||
final Set<String> skipped = new HashSet<String>(cliOptions);
|
final Set<String> skipped = new HashSet<String>(cliOptions);
|
||||||
skipped.removeAll(testOptions);
|
skipped.removeAll(testOptions);
|
||||||
if (!skipped.isEmpty()) {
|
if (!skipped.isEmpty()) {
|
||||||
@ -52,6 +60,4 @@ public abstract class AbstractOptionsTest {
|
|||||||
protected abstract CodegenConfig getCodegenConfig();
|
protected abstract CodegenConfig getCodegenConfig();
|
||||||
|
|
||||||
protected abstract void setExpectations();
|
protected abstract void setExpectations();
|
||||||
|
|
||||||
protected abstract Map<String, String> getAvaliableOptions();
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.akkascala;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.AkkaScalaClientCodegen;
|
import io.swagger.codegen.languages.AkkaScalaClientCodegen;
|
||||||
|
import io.swagger.codegen.options.AkkaScalaClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class AkkaScalaClientOptionsTest extends AbstractOptionsTest {
|
public class AkkaScalaClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private AkkaScalaClientCodegen clientCodegen;
|
private AkkaScalaClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public AkkaScalaClientOptionsTest() {
|
||||||
|
super(new AkkaScalaClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class AkkaScalaClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(AkkaScalaClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(AkkaScalaClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AkkaScalaClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,29 +2,21 @@ package io.swagger.codegen.android;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.AndroidClientCodegen;
|
import io.swagger.codegen.languages.AndroidClientCodegen;
|
||||||
|
import io.swagger.codegen.options.AndroidClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class AndroidClientOptionsTest extends AbstractOptionsTest {
|
public class AndroidClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String ARTIFACT_ID_VALUE = "swagger-java-client-test";
|
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
protected static final String GROUP_ID_VALUE = "io.swagger.test";
|
|
||||||
protected static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
protected static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
|
||||||
protected static final String ANDROID_MAVEN_GRADLE_PLUGIN_VALUE = "true";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private AndroidClientCodegen clientCodegen;
|
private AndroidClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public AndroidClientOptionsTest() {
|
||||||
|
super(new AndroidClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -33,39 +25,24 @@ public class AndroidClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(AndroidClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(AndroidClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AndroidClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(AndroidClientOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
clientCodegen.setGroupId(AndroidClientOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(AndroidClientOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(AndroidClientOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(AndroidClientOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
|
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(AndroidClientOptionsProvider.ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
|
||||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
|
||||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
|
||||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
|
||||||
.put(AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN, ANDROID_MAVEN_GRADLE_PLUGIN_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.asyncscala;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.AsyncScalaClientCodegen;
|
import io.swagger.codegen.languages.AsyncScalaClientCodegen;
|
||||||
|
import io.swagger.codegen.options.AsyncScalaClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class AsyncScalaClientOptionsTest extends AbstractOptionsTest {
|
public class AsyncScalaClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private AsyncScalaClientCodegen clientCodegen;
|
private AsyncScalaClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public AsyncScalaClientOptionsTest() {
|
||||||
|
super(new AsyncScalaClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class AsyncScalaClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(AsyncScalaClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(AsyncScalaClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AsyncScalaClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,21 @@ package io.swagger.codegen.csharp;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.CSharpClientCodegen;
|
import io.swagger.codegen.languages.CSharpClientCodegen;
|
||||||
|
import io.swagger.codegen.options.CSharpClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class CSharpClientOptionsTest extends AbstractOptionsTest {
|
public class CSharpClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_csharp";
|
|
||||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private CSharpClientCodegen clientCodegen;
|
private CSharpClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public CSharpClientOptionsTest() {
|
||||||
|
super(new CSharpClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -26,19 +25,10 @@ public class CSharpClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
clientCodegen.setPackageName(CSharpClientOptionsProvider.PACKAGE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
clientCodegen.setPackageVersion(CSharpClientOptionsProvider.PACKAGE_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.csharpdotnettwo;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.CsharpDotNet2ClientCodegen;
|
import io.swagger.codegen.languages.CsharpDotNet2ClientCodegen;
|
||||||
|
import io.swagger.codegen.options.CsharpDotNet2ClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class CsharpDotNet2ClientOptionsTest extends AbstractOptionsTest {
|
public class CsharpDotNet2ClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_csharp_dotnet";
|
|
||||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
protected static final String CLIENT_PACKAGE_VALUE = "IO.Swagger.Client.Test";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private CsharpDotNet2ClientCodegen clientCodegen;
|
private CsharpDotNet2ClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public CsharpDotNet2ClientOptionsTest() {
|
||||||
|
super(new CsharpDotNet2ClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class CsharpDotNet2ClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
clientCodegen.setPackageName(CsharpDotNet2ClientOptionsProvider.PACKAGE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
clientCodegen.setPackageVersion(CsharpDotNet2ClientOptionsProvider.PACKAGE_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setClientPackage(CLIENT_PACKAGE_VALUE);
|
clientCodegen.setClientPackage(CsharpDotNet2ClientOptionsProvider.CLIENT_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
|
||||||
.put(CsharpDotNet2ClientCodegen.CLIENT_PACKAGE, CLIENT_PACKAGE_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,28 +2,21 @@ package io.swagger.codegen.dart;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.DartClientCodegen;
|
import io.swagger.codegen.languages.DartClientCodegen;
|
||||||
|
import io.swagger.codegen.options.DartClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class DartClientOptionsTest extends AbstractOptionsTest {
|
public class DartClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "packagedart";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackageDart";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
protected static final String BROWSER_CLIENT_VALUE = "true";
|
|
||||||
protected static final String PUB_NAME_VALUE = "swagger";
|
|
||||||
protected static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
protected static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart";
|
|
||||||
protected static final String SOURCE_FOLDER_VALUE = "src";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private DartClientCodegen clientCodegen;
|
private DartClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public DartClientOptionsTest() {
|
||||||
|
super(new DartClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -32,37 +25,23 @@ public class DartClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(DartClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(DartClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(DartClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setBrowserClient(Boolean.valueOf(BROWSER_CLIENT_VALUE));
|
clientCodegen.setBrowserClient(Boolean.valueOf(DartClientOptionsProvider.BROWSER_CLIENT_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPubName(PUB_NAME_VALUE);
|
clientCodegen.setPubName(DartClientOptionsProvider.PUB_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPubVersion(PUB_VERSION_VALUE);
|
clientCodegen.setPubVersion(DartClientOptionsProvider.PUB_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPubDescription(PUB_DESCRIPTION_VALUE);
|
clientCodegen.setPubDescription(DartClientOptionsProvider.PUB_DESCRIPTION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.put(DartClientCodegen.BROWSER_CLIENT, BROWSER_CLIENT_VALUE)
|
|
||||||
.put(DartClientCodegen.PUB_NAME, PUB_NAME_VALUE)
|
|
||||||
.put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE)
|
|
||||||
.put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE)
|
|
||||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,24 +2,23 @@ package io.swagger.codegen.flash;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.FlashClientCodegen;
|
import io.swagger.codegen.languages.FlashClientCodegen;
|
||||||
|
import io.swagger.codegen.options.FlashClienOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class FlashClienOptionsTest extends AbstractOptionsTest {
|
public class FlashClienOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String PACKAGE_NAME_VALUE = "io.swagger.flash";
|
|
||||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
protected static final String INVOKER_PACKAGE_VALUE = "io.swagger.flash";
|
|
||||||
protected static final String SOURCE_FOLDER_VALUE = "src/main/flex/test";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private FlashClientCodegen clientCodegen;
|
private FlashClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public FlashClienOptionsTest() {
|
||||||
|
super(new FlashClienOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -28,24 +27,14 @@ public class FlashClienOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
clientCodegen.setPackageName(FlashClienOptionsProvider.PACKAGE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
clientCodegen.setPackageVersion(FlashClienOptionsProvider.PACKAGE_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(FlashClienOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(FlashClienOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
|
||||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package io.swagger.codegen.inflector;
|
|||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.java.JavaClientOptionsTest;
|
import io.swagger.codegen.java.JavaClientOptionsTest;
|
||||||
import io.swagger.codegen.languages.JavaInflectorServerCodegen;
|
import io.swagger.codegen.languages.JavaInflectorServerCodegen;
|
||||||
|
import io.swagger.codegen.options.JavaInflectorServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.JavaOptionsProvider;
|
||||||
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
@ -12,6 +14,10 @@ public class JavaInflectorServerOptionsTest extends JavaClientOptionsTest {
|
|||||||
@Tested
|
@Tested
|
||||||
private JavaInflectorServerCodegen clientCodegen;
|
private JavaInflectorServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public JavaInflectorServerOptionsTest() {
|
||||||
|
super(new JavaInflectorServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -20,29 +26,29 @@ public class JavaInflectorServerOptionsTest extends JavaClientOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(JavaInflectorServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(JavaInflectorServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaInflectorServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(JavaInflectorServerOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
clientCodegen.setGroupId(JavaInflectorServerOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(JavaInflectorServerOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(JavaInflectorServerOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(JavaInflectorServerOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
clientCodegen.setLocalVariablePrefix(JavaInflectorServerOptionsProvider.LOCAL_PREFIX_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
clientCodegen.setSerializableModel(Boolean.valueOf(JavaInflectorServerOptionsProvider.SERIALIZABLE_MODEL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
clientCodegen.setLibrary(JavaInflectorServerOptionsProvider.LIBRARY_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaInflectorServerOptionsProvider.FULL_JAVA_UTIL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
@ -2,33 +2,26 @@ package io.swagger.codegen.java;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.options.JavaOptionsProvider;
|
||||||
import io.swagger.codegen.languages.JavaClientCodegen;
|
import io.swagger.codegen.languages.JavaClientCodegen;
|
||||||
|
import io.swagger.codegen.options.OptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class JavaClientOptionsTest extends AbstractOptionsTest {
|
public class JavaClientOptionsTest extends AbstractOptionsTest {
|
||||||
|
|
||||||
protected static final String ARTIFACT_ID_VALUE = "swagger-java-client-test";
|
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
protected static final String GROUP_ID_VALUE = "io.swagger.test";
|
|
||||||
protected static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
protected static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
|
||||||
protected static final String LOCAL_PREFIX_VALUE = "tst";
|
|
||||||
protected static final String LIBRARY_VALUE = "jersey2";
|
|
||||||
protected static final String SERIALIZABLE_MODEL_VALUE = "false";
|
|
||||||
protected static final String FULL_JAVA_UTIL_VALUE = "true";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private JavaClientCodegen clientCodegen;
|
private JavaClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public JavaClientOptionsTest() {
|
||||||
|
super(new JavaOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected JavaClientOptionsTest(OptionsProvider optionsProvider) {
|
||||||
|
super(optionsProvider);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -37,48 +30,30 @@ public class JavaClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(JavaOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(JavaOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(JavaOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
clientCodegen.setGroupId(JavaOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(JavaOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(JavaOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(JavaOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
clientCodegen.setLocalVariablePrefix(JavaOptionsProvider.LOCAL_PREFIX_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
clientCodegen.setSerializableModel(Boolean.valueOf(JavaOptionsProvider.SERIALIZABLE_MODEL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
clientCodegen.setLibrary(JavaOptionsProvider.LIBRARY_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaOptionsProvider.FULL_JAVA_UTIL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
|
||||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
|
||||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
|
||||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
|
||||||
.put(CodegenConstants.LOCAL_VARIABLE_PREFIX, LOCAL_PREFIX_VALUE)
|
|
||||||
.put(CodegenConstants.SERIALIZABLE_MODEL, SERIALIZABLE_MODEL_VALUE)
|
|
||||||
.put(JavaClientCodegen.FULL_JAVA_UTIL, FULL_JAVA_UTIL_VALUE)
|
|
||||||
.put(CodegenConstants.LIBRARY, LIBRARY_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package io.swagger.codegen.jaxrs;
|
|||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.java.JavaClientOptionsTest;
|
import io.swagger.codegen.java.JavaClientOptionsTest;
|
||||||
import io.swagger.codegen.languages.JaxRSServerCodegen;
|
import io.swagger.codegen.languages.JaxRSServerCodegen;
|
||||||
|
import io.swagger.codegen.options.JaxRSServerOptionsProvider;
|
||||||
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
@ -12,6 +13,10 @@ public class JaxRSServerOptionsTest extends JavaClientOptionsTest {
|
|||||||
@Tested
|
@Tested
|
||||||
private JaxRSServerCodegen clientCodegen;
|
private JaxRSServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public JaxRSServerOptionsTest() {
|
||||||
|
super(new JaxRSServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -20,29 +25,29 @@ public class JaxRSServerOptionsTest extends JavaClientOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(JaxRSServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(JaxRSServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JaxRSServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(JaxRSServerOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
clientCodegen.setGroupId(JaxRSServerOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(JaxRSServerOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(JaxRSServerOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(JaxRSServerOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
clientCodegen.setLocalVariablePrefix(JaxRSServerOptionsProvider.LOCAL_PREFIX_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
clientCodegen.setSerializableModel(Boolean.valueOf(JaxRSServerOptionsProvider.SERIALIZABLE_MODEL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
clientCodegen.setLibrary(JaxRSServerOptionsProvider.LIBRARY_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
clientCodegen.setFullJavaUtil(Boolean.valueOf(JaxRSServerOptionsProvider.FULL_JAVA_UTIL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
@ -2,24 +2,21 @@ package io.swagger.codegen.nodejs;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.JavaClientCodegen;
|
|
||||||
import io.swagger.codegen.languages.NodeJSServerCodegen;
|
import io.swagger.codegen.languages.NodeJSServerCodegen;
|
||||||
|
import io.swagger.codegen.options.NodeJSServerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class NodeJSServerOptionsTest extends AbstractOptionsTest {
|
public class NodeJSServerOptionsTest extends AbstractOptionsTest {
|
||||||
private static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
private static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
private static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private NodeJSServerCodegen clientCodegen;
|
private NodeJSServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public NodeJSServerOptionsTest() {
|
||||||
|
super(new NodeJSServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -28,21 +25,12 @@ public class NodeJSServerOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(NodeJSServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(NodeJSServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(NodeJSServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,27 +2,21 @@ package io.swagger.codegen.objc;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.ObjcClientCodegen;
|
import io.swagger.codegen.languages.ObjcClientCodegen;
|
||||||
|
import io.swagger.codegen.options.ObjcClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ObjcClientOptionsTest extends AbstractOptionsTest {
|
public class ObjcClientOptionsTest extends AbstractOptionsTest {
|
||||||
private static final String CLASS_PREFIX_VALUE = "SWGObjc";
|
|
||||||
private static final String POD_NAME_VALUE = "SwaggerClientObjc";
|
|
||||||
private static final String POD_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
private static final String AUTHOR_NAME_VALUE = "SwaggerObjc";
|
|
||||||
private static final String AUTHOR_EMAIL_VALUE = "objc@swagger.io";
|
|
||||||
private static final String GIT_REPO_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
|
|
||||||
private static final String LICENSE_VALUE = "MIT";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private ObjcClientCodegen clientCodegen;
|
private ObjcClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public ObjcClientOptionsTest() {
|
||||||
|
super(new ObjcClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -31,33 +25,20 @@ public class ObjcClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setClassPrefix(CLASS_PREFIX_VALUE);
|
clientCodegen.setClassPrefix(ObjcClientOptionsProvider.CLASS_PREFIX_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPodName(POD_NAME_VALUE);
|
clientCodegen.setPodName(ObjcClientOptionsProvider.POD_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPodVersion(POD_VERSION_VALUE);
|
clientCodegen.setPodVersion(ObjcClientOptionsProvider.POD_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setAuthorName(AUTHOR_NAME_VALUE);
|
clientCodegen.setAuthorName(ObjcClientOptionsProvider.AUTHOR_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setAuthorEmail(AUTHOR_EMAIL_VALUE);
|
clientCodegen.setAuthorEmail(ObjcClientOptionsProvider.AUTHOR_EMAIL_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGitRepoURL(GIT_REPO_URL_VALUE);
|
clientCodegen.setGitRepoURL(ObjcClientOptionsProvider.GIT_REPO_URL_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLicense(LICENSE_VALUE);
|
clientCodegen.setLicense(ObjcClientOptionsProvider.LICENSE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(ObjcClientCodegen.CLASS_PREFIX, CLASS_PREFIX_VALUE)
|
|
||||||
.put(ObjcClientCodegen.POD_NAME, POD_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
|
||||||
.put(ObjcClientCodegen.AUTHOR_NAME, AUTHOR_NAME_VALUE)
|
|
||||||
.put(ObjcClientCodegen.AUTHOR_EMAIL, AUTHOR_EMAIL_VALUE)
|
|
||||||
.put(ObjcClientCodegen.GIT_REPO_URL, GIT_REPO_URL_VALUE)
|
|
||||||
.put(ObjcClientCodegen.LICENSE, LICENSE_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class AkkaScalaClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "akka-scala";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.AndroidClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class AndroidClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String ARTIFACT_ID_VALUE = "swagger-java-client-test";
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||||
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
||||||
|
public static final String ANDROID_MAVEN_GRADLE_PLUGIN_VALUE = "true";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "android";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||||
|
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||||
|
.put(AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN, ANDROID_MAVEN_GRADLE_PLUGIN_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class AsyncScalaClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "async-scala";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class CSharpClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String PACKAGE_NAME_VALUE = "swagger_client_csharp";
|
||||||
|
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "csharp";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.CsharpDotNet2ClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class CsharpDotNet2ClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String PACKAGE_NAME_VALUE = "swagger_client_csharp_dotnet";
|
||||||
|
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String CLIENT_PACKAGE_VALUE = "IO.Swagger.Client.Test";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "CsharpDotNet2";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||||
|
.put(CsharpDotNet2ClientCodegen.CLIENT_PACKAGE, CLIENT_PACKAGE_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.DartClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class DartClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "packagedart";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackageDart";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String BROWSER_CLIENT_VALUE = "true";
|
||||||
|
public static final String PUB_NAME_VALUE = "swagger";
|
||||||
|
public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart";
|
||||||
|
public static final String SOURCE_FOLDER_VALUE = "src";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "dart";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(DartClientCodegen.BROWSER_CLIENT, BROWSER_CLIENT_VALUE)
|
||||||
|
.put(DartClientCodegen.PUB_NAME, PUB_NAME_VALUE)
|
||||||
|
.put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE)
|
||||||
|
.put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE)
|
||||||
|
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class FlashClienOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String PACKAGE_NAME_VALUE = "io.swagger.flash";
|
||||||
|
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.flash";
|
||||||
|
public static final String SOURCE_FOLDER_VALUE = "src/main/flex/test";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "flash";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||||
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
public class JavaInflectorServerOptionsProvider extends JavaOptionsProvider {
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "inflector";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.JavaClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class JavaOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String ARTIFACT_ID_VALUE = "swagger-java-client-test";
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||||
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
||||||
|
public static final String LOCAL_PREFIX_VALUE = "tst";
|
||||||
|
public static final String LIBRARY_VALUE = "jersey2";
|
||||||
|
public static final String SERIALIZABLE_MODEL_VALUE = "false";
|
||||||
|
public static final String FULL_JAVA_UTIL_VALUE = "true";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||||
|
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||||
|
.put(CodegenConstants.LOCAL_VARIABLE_PREFIX, LOCAL_PREFIX_VALUE)
|
||||||
|
.put(CodegenConstants.SERIALIZABLE_MODEL, SERIALIZABLE_MODEL_VALUE)
|
||||||
|
.put(JavaClientCodegen.FULL_JAVA_UTIL, FULL_JAVA_UTIL_VALUE)
|
||||||
|
.put(CodegenConstants.LIBRARY, LIBRARY_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "java";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
public class JaxRSServerOptionsProvider extends JavaOptionsProvider {
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "jaxrs";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class NodeJSServerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "nodejs";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.ObjcClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ObjcClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String CLASS_PREFIX_VALUE = "SWGObjc";
|
||||||
|
public static final String POD_NAME_VALUE = "SwaggerClientObjc";
|
||||||
|
public static final String POD_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
public static final String AUTHOR_NAME_VALUE = "SwaggerObjc";
|
||||||
|
public static final String AUTHOR_EMAIL_VALUE = "objc@swagger.io";
|
||||||
|
public static final String GIT_REPO_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
|
||||||
|
public static final String LICENSE_VALUE = "MIT";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "objc";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(ObjcClientCodegen.CLASS_PREFIX, CLASS_PREFIX_VALUE)
|
||||||
|
.put(ObjcClientCodegen.POD_NAME, POD_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
||||||
|
.put(ObjcClientCodegen.AUTHOR_NAME, AUTHOR_NAME_VALUE)
|
||||||
|
.put(ObjcClientCodegen.AUTHOR_EMAIL, AUTHOR_EMAIL_VALUE)
|
||||||
|
.put(ObjcClientCodegen.GIT_REPO_URL, GIT_REPO_URL_VALUE)
|
||||||
|
.put(ObjcClientCodegen.LICENSE, LICENSE_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface OptionsProvider {
|
||||||
|
String getLanguage();
|
||||||
|
Map<String, String> createOptions();
|
||||||
|
boolean isServer();
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.languages.PerlClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PerlClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODULE_NAME_VALUE = "";
|
||||||
|
public static final String MODULE_VERSION_VALUE = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "perl";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(PerlClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
||||||
|
.put(PerlClientCodegen.MODULE_VERSION, MODULE_VERSION_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.PhpClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PhpClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String VARIABLE_NAMING_CONVENTION_VALUE = "snake_case";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "Swagger\\Client\\Php";
|
||||||
|
public static final String PACKAGE_PATH_VALUE = "SwaggerClient-php";
|
||||||
|
public static final String SRC_BASE_PATH_VALUE = "libPhp";
|
||||||
|
public static final String COMPOSER_VENDOR_NAME_VALUE = "swaggerPhp";
|
||||||
|
public static final String COMPOSER_PROJECT_NAME_VALUE = "swagger-client-php";
|
||||||
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "php";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(PhpClientCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE)
|
||||||
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
|
.put(PhpClientCodegen.PACKAGE_PATH, PACKAGE_PATH_VALUE)
|
||||||
|
.put(PhpClientCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
|
||||||
|
.put(PhpClientCodegen.COMPOSER_VENDOR_NAME, COMPOSER_VENDOR_NAME_VALUE)
|
||||||
|
.put(PhpClientCodegen.COMPOSER_PROJECT_NAME, COMPOSER_PROJECT_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PythonClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String PACKAGE_NAME_VALUE = "swagger_client_python";
|
||||||
|
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "python";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||||
|
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Qt5CPPOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "qt5cpp";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.languages.RubyClientCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class RubyClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String GEM_NAME_VALUE = "swagger_client_ruby";
|
||||||
|
public static final String MODULE_NAME_VALUE = "SwaggerClientRuby";
|
||||||
|
public static final String GEM_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "ruby";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(RubyClientCodegen.GEM_NAME, GEM_NAME_VALUE)
|
||||||
|
.put(RubyClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
||||||
|
.put(RubyClientCodegen.GEM_VERSION, GEM_VERSION_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ScalaClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "scala";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ScalatraServerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "scalatra";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SilexServerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "silex-PHP";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SinatraServerOptionsProvider implements OptionsProvider {
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "sinatra";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
//SinatraServerCodegen doesn't have its own options and base options are cleared
|
||||||
|
return ImmutableMap.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.languages.SpringMVCServerCodegen;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SpringMVCServerOptionsProvider extends JavaOptionsProvider {
|
||||||
|
public static final String CONFIG_PACKAGE_VALUE = "configPackage";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "spring-mvc";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
Map<String, String> options = new HashMap<String, String>(super.createOptions());
|
||||||
|
options.put(SpringMVCServerCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE);
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class StaticDocOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "dynamic-html";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class StaticHtmlOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "html";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SwaggerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "swagger";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SwaggerYamlOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "swagger-yaml";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.SwiftCodegen;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SwiftOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String PROJECT_NAME_VALUE = "Swagger";
|
||||||
|
public static final String RESPONSE_AS_VALUE = "test";
|
||||||
|
public static final String UNWRAP_REQUIRED_VALUE = "true";
|
||||||
|
public static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," +
|
||||||
|
" :tag => 'v1.0.0-SNAPSHOT' }";
|
||||||
|
public static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT";
|
||||||
|
public static final String POD_AUTHORS_VALUE = "podAuthors";
|
||||||
|
public static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL";
|
||||||
|
public static final String POD_DOCSET_URL_VALUE = "podDocsetURL";
|
||||||
|
public static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'";
|
||||||
|
public static final String POD_HOMEPAGE_VALUE = "podHomepage";
|
||||||
|
public static final String POD_SUMMARY_VALUE = "podSummary";
|
||||||
|
public static final String POD_DESCRIPTION_VALUE = "podDescription";
|
||||||
|
public static final String POD_SCREENSHOTS_VALUE = "podScreenshots";
|
||||||
|
public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "swift";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(SwiftCodegen.PROJECT_NAME, PROJECT_NAME_VALUE)
|
||||||
|
.put(SwiftCodegen.RESPONSE_AS, RESPONSE_AS_VALUE)
|
||||||
|
.put(SwiftCodegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_SOURCE, POD_SOURCE_VALUE)
|
||||||
|
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_AUTHORS, POD_AUTHORS_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_LICENSE, POD_LICENSE_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_SUMMARY, POD_SUMMARY_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE)
|
||||||
|
.put(SwiftCodegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TizenClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "tizen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "typescript-angular";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLanguage() {
|
||||||
|
return "typescript-node";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> createOptions() {
|
||||||
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isServer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -2,22 +2,21 @@ package io.swagger.codegen.perl;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.PerlClientCodegen;
|
import io.swagger.codegen.languages.PerlClientCodegen;
|
||||||
|
import io.swagger.codegen.options.PerlClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class PerlClientOptionsTest extends AbstractOptionsTest {
|
public class PerlClientOptionsTest extends AbstractOptionsTest {
|
||||||
private static final String MODULE_NAME_VALUE = "";
|
|
||||||
private static final String MODULE_VERSION_VALUE = "";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private PerlClientCodegen clientCodegen;
|
private PerlClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public PerlClientOptionsTest() {
|
||||||
|
super(new PerlClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -26,18 +25,10 @@ public class PerlClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModuleName(MODULE_NAME_VALUE);
|
clientCodegen.setModuleName(PerlClientOptionsProvider.MODULE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setModuleVersion(MODULE_VERSION_VALUE);
|
clientCodegen.setModuleVersion(PerlClientOptionsProvider.MODULE_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(PerlClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
|
||||||
.put(PerlClientCodegen.MODULE_VERSION, MODULE_VERSION_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,30 +2,21 @@ package io.swagger.codegen.php;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.PhpClientCodegen;
|
import io.swagger.codegen.languages.PhpClientCodegen;
|
||||||
|
import io.swagger.codegen.options.PhpClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class PhpClientOptionsTest extends AbstractOptionsTest {
|
public class PhpClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
protected static final String VARIABLE_NAMING_CONVENTION_VALUE = "snake_case";
|
|
||||||
protected static final String INVOKER_PACKAGE_VALUE = "Swagger\\Client\\Php";
|
|
||||||
protected static final String PACKAGE_PATH_VALUE = "SwaggerClient-php";
|
|
||||||
protected static final String SRC_BASE_PATH_VALUE = "libPhp";
|
|
||||||
protected static final String COMPOSER_VENDOR_NAME_VALUE = "swaggerPhp";
|
|
||||||
protected static final String COMPOSER_PROJECT_NAME_VALUE = "swagger-client-php";
|
|
||||||
protected static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private PhpClientCodegen clientCodegen;
|
private PhpClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public PhpClientOptionsTest() {
|
||||||
|
super(new PhpClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -34,42 +25,26 @@ public class PhpClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(PhpClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(PhpClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setParameterNamingConvention(VARIABLE_NAMING_CONVENTION_VALUE);
|
clientCodegen.setParameterNamingConvention(PhpClientOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(PhpClientOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPackagePath(PACKAGE_PATH_VALUE);
|
clientCodegen.setPackagePath(PhpClientOptionsProvider.PACKAGE_PATH_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSrcBasePath(SRC_BASE_PATH_VALUE);
|
clientCodegen.setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setComposerVendorName(COMPOSER_VENDOR_NAME_VALUE);
|
clientCodegen.setComposerVendorName(PhpClientOptionsProvider.COMPOSER_VENDOR_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setComposerProjectName(COMPOSER_PROJECT_NAME_VALUE);
|
clientCodegen.setComposerProjectName(PhpClientOptionsProvider.COMPOSER_PROJECT_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.put(PhpClientCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE)
|
|
||||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
|
||||||
.put(PhpClientCodegen.PACKAGE_PATH, PACKAGE_PATH_VALUE)
|
|
||||||
.put(PhpClientCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
|
|
||||||
.put(PhpClientCodegen.COMPOSER_VENDOR_NAME, COMPOSER_VENDOR_NAME_VALUE)
|
|
||||||
.put(PhpClientCodegen.COMPOSER_PROJECT_NAME, COMPOSER_PROJECT_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,21 @@ package io.swagger.codegen.python;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.PythonClientCodegen;
|
import io.swagger.codegen.languages.PythonClientCodegen;
|
||||||
|
import io.swagger.codegen.options.PythonClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class PythonClientOptionsTest extends AbstractOptionsTest {
|
public class PythonClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_python";
|
|
||||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private PythonClientCodegen clientCodegen;
|
private PythonClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public PythonClientOptionsTest() {
|
||||||
|
super(new PythonClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -26,19 +25,10 @@ public class PythonClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
clientCodegen.setPackageName(PythonClientOptionsProvider.PACKAGE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
clientCodegen.setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
|
||||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.qtfivecpp;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.Qt5CPPGenerator;
|
import io.swagger.codegen.languages.Qt5CPPGenerator;
|
||||||
|
import io.swagger.codegen.options.Qt5CPPOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class Qt5CPPOptionsTest extends AbstractOptionsTest {
|
public class Qt5CPPOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private Qt5CPPGenerator clientCodegen;
|
private Qt5CPPGenerator clientCodegen;
|
||||||
|
|
||||||
|
public Qt5CPPOptionsTest() {
|
||||||
|
super(new Qt5CPPOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class Qt5CPPOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(Qt5CPPOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(Qt5CPPOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(Qt5CPPOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,21 +3,20 @@ package io.swagger.codegen.ruby;
|
|||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.languages.RubyClientCodegen;
|
import io.swagger.codegen.languages.RubyClientCodegen;
|
||||||
|
import io.swagger.codegen.options.RubyClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class RubyClientOptionsTest extends AbstractOptionsTest {
|
public class RubyClientOptionsTest extends AbstractOptionsTest {
|
||||||
private static final String GEM_NAME_VALUE = "swagger_client_ruby";
|
|
||||||
private static final String MODULE_NAME_VALUE = "SwaggerClientRuby";
|
|
||||||
private static final String GEM_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private RubyClientCodegen clientCodegen;
|
private RubyClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public RubyClientOptionsTest() {
|
||||||
|
super(new RubyClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -26,21 +25,12 @@ public class RubyClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setGemName(GEM_NAME_VALUE);
|
clientCodegen.setGemName(RubyClientOptionsProvider.GEM_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setModuleName(MODULE_NAME_VALUE);
|
clientCodegen.setModuleName(RubyClientOptionsProvider.MODULE_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGemVersion(GEM_VERSION_VALUE);
|
clientCodegen.setGemVersion(RubyClientOptionsProvider.GEM_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(RubyClientCodegen.GEM_NAME, GEM_NAME_VALUE)
|
|
||||||
.put(RubyClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
|
||||||
.put(RubyClientCodegen.GEM_VERSION, GEM_VERSION_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.scala;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.ScalaClientCodegen;
|
import io.swagger.codegen.languages.ScalaClientCodegen;
|
||||||
|
import io.swagger.codegen.options.ScalaClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ScalaClientOptionsTest extends AbstractOptionsTest {
|
public class ScalaClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private ScalaClientCodegen clientCodegen;
|
private ScalaClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public ScalaClientOptionsTest() {
|
||||||
|
super(new ScalaClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class ScalaClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(ScalaClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(ScalaClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(ScalaClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.scalatra;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.ScalatraServerCodegen;
|
import io.swagger.codegen.languages.ScalatraServerCodegen;
|
||||||
|
import io.swagger.codegen.options.ScalatraServerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ScalatraServerOptionsTest extends AbstractOptionsTest {
|
public class ScalatraServerOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private ScalatraServerCodegen clientCodegen;
|
private ScalatraServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public ScalatraServerOptionsTest() {
|
||||||
|
super(new ScalatraServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class ScalatraServerOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(ScalatraServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(ScalatraServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(ScalatraServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.silex;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.SilexServerCodegen;
|
import io.swagger.codegen.languages.SilexServerCodegen;
|
||||||
|
import io.swagger.codegen.options.SilexServerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SilexServerOptionsTest extends AbstractOptionsTest {
|
public class SilexServerOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SilexServerCodegen clientCodegen;
|
private SilexServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public SilexServerOptionsTest() {
|
||||||
|
super(new SilexServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class SilexServerOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(SilexServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(SilexServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SilexServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,18 +3,20 @@ package io.swagger.codegen.sinatra;
|
|||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.languages.SinatraServerCodegen;
|
import io.swagger.codegen.languages.SinatraServerCodegen;
|
||||||
|
import io.swagger.codegen.options.SinatraServerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SinatraServerOptionsTest extends AbstractOptionsTest {
|
public class SinatraServerOptionsTest extends AbstractOptionsTest {
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SinatraServerCodegen clientCodegen;
|
private SinatraServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public SinatraServerOptionsTest() {
|
||||||
|
super(new SinatraServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -25,10 +27,4 @@ public class SinatraServerOptionsTest extends AbstractOptionsTest {
|
|||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
//SinatraServerCodegen doesn't have its own options and base options are cleared
|
|
||||||
return ImmutableMap.of();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,22 @@
|
|||||||
package io.swagger.codegen.springmvc;
|
package io.swagger.codegen.springmvc;
|
||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.java.JavaClientOptionsTest;
|
import io.swagger.codegen.java.JavaClientOptionsTest;
|
||||||
import io.swagger.codegen.languages.JavaClientCodegen;
|
|
||||||
import io.swagger.codegen.languages.SpringMVCServerCodegen;
|
import io.swagger.codegen.languages.SpringMVCServerCodegen;
|
||||||
|
import io.swagger.codegen.options.SpringMVCServerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SpringMVCServerOptionsTest extends JavaClientOptionsTest {
|
public class SpringMVCServerOptionsTest extends JavaClientOptionsTest {
|
||||||
protected static final String CONFIG_PACKAGE_VALUE = "configPackage";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SpringMVCServerCodegen clientCodegen;
|
private SpringMVCServerCodegen clientCodegen;
|
||||||
|
|
||||||
|
public SpringMVCServerOptionsTest() {
|
||||||
|
super(new SpringMVCServerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -28,39 +25,32 @@ public class SpringMVCServerOptionsTest extends JavaClientOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(SpringMVCServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(SpringMVCServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SpringMVCServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(SpringMVCServerOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
clientCodegen.setGroupId(SpringMVCServerOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(SpringMVCServerOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(SpringMVCServerOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(SpringMVCServerOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
clientCodegen.setLocalVariablePrefix(SpringMVCServerOptionsProvider.LOCAL_PREFIX_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
clientCodegen.setSerializableModel(Boolean.valueOf(SpringMVCServerOptionsProvider.SERIALIZABLE_MODEL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
clientCodegen.setLibrary(SpringMVCServerOptionsProvider.LIBRARY_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
clientCodegen.setFullJavaUtil(Boolean.valueOf(SpringMVCServerOptionsProvider.FULL_JAVA_UTIL_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setConfigPackage(CONFIG_PACKAGE_VALUE);
|
clientCodegen.setConfigPackage(SpringMVCServerOptionsProvider.CONFIG_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
Map<String, String> options = new HashMap<String, String>(super.getAvaliableOptions());
|
|
||||||
options.put(SpringMVCServerCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE);
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.staticDocs;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.StaticDocCodegen;
|
import io.swagger.codegen.languages.StaticDocCodegen;
|
||||||
|
import io.swagger.codegen.options.StaticDocOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class StaticDocOptionsTest extends AbstractOptionsTest {
|
public class StaticDocOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private StaticDocCodegen clientCodegen;
|
private StaticDocCodegen clientCodegen;
|
||||||
|
|
||||||
|
public StaticDocOptionsTest() {
|
||||||
|
super(new StaticDocOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class StaticDocOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(StaticDocOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(StaticDocOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(StaticDocOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.statichtml;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.StaticHtmlGenerator;
|
import io.swagger.codegen.languages.StaticHtmlGenerator;
|
||||||
|
import io.swagger.codegen.options.StaticHtmlOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class StaticHtmlOptionsTest extends AbstractOptionsTest {
|
public class StaticHtmlOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private StaticHtmlGenerator clientCodegen;
|
private StaticHtmlGenerator clientCodegen;
|
||||||
|
|
||||||
|
public StaticHtmlOptionsTest() {
|
||||||
|
super(new StaticHtmlOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class StaticHtmlOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(StaticHtmlOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(StaticHtmlOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(StaticHtmlOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.swagger;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.SwaggerGenerator;
|
import io.swagger.codegen.languages.SwaggerGenerator;
|
||||||
|
import io.swagger.codegen.options.SwaggerOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SwaggerOptionsTest extends AbstractOptionsTest {
|
public class SwaggerOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SwaggerGenerator clientCodegen;
|
private SwaggerGenerator clientCodegen;
|
||||||
|
|
||||||
|
public SwaggerOptionsTest() {
|
||||||
|
super(new SwaggerOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class SwaggerOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(SwaggerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(SwaggerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SwaggerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.swaggeryaml;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.SwaggerYamlGenerator;
|
import io.swagger.codegen.languages.SwaggerYamlGenerator;
|
||||||
|
import io.swagger.codegen.options.SwaggerYamlOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SwaggerYamlOptionsTest extends AbstractOptionsTest {
|
public class SwaggerYamlOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SwaggerYamlGenerator clientCodegen;
|
private SwaggerYamlGenerator clientCodegen;
|
||||||
|
|
||||||
|
public SwaggerYamlOptionsTest() {
|
||||||
|
super(new SwaggerYamlOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class SwaggerYamlOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(SwaggerYamlOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(SwaggerYamlOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SwaggerYamlOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,38 +2,21 @@ package io.swagger.codegen.swift;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.SwiftCodegen;
|
import io.swagger.codegen.languages.SwiftCodegen;
|
||||||
|
import io.swagger.codegen.options.SwiftOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SwiftOptionsTest extends AbstractOptionsTest {
|
public class SwiftOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
protected static final String PROJECT_NAME_VALUE = "Swagger";
|
|
||||||
protected static final String RESPONSE_AS_VALUE = "test";
|
|
||||||
protected static final String UNWRAP_REQUIRED_VALUE = "true";
|
|
||||||
protected static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," +
|
|
||||||
" :tag => 'v1.0.0-SNAPSHOT' }";
|
|
||||||
protected static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT";
|
|
||||||
protected static final String POD_AUTHORS_VALUE = "podAuthors";
|
|
||||||
protected static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL";
|
|
||||||
protected static final String POD_DOCSET_URL_VALUE = "podDocsetURL";
|
|
||||||
protected static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'";
|
|
||||||
protected static final String POD_HOMEPAGE_VALUE = "podHomepage";
|
|
||||||
protected static final String POD_SUMMARY_VALUE = "podSummary";
|
|
||||||
protected static final String POD_DESCRIPTION_VALUE = "podDescription";
|
|
||||||
protected static final String POD_SCREENSHOTS_VALUE = "podScreenshots";
|
|
||||||
protected static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private SwiftCodegen clientCodegen;
|
private SwiftCodegen clientCodegen;
|
||||||
|
|
||||||
|
public SwiftOptionsTest() {
|
||||||
|
super(new SwiftOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -42,41 +25,18 @@ public class SwiftOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(SwiftOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(SwiftOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SwiftOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setProjectName(PROJECT_NAME_VALUE);
|
clientCodegen.setProjectName(SwiftOptionsProvider.PROJECT_NAME_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setResponseAs(RESPONSE_AS_VALUE.split(","));
|
clientCodegen.setResponseAs(SwiftOptionsProvider.RESPONSE_AS_VALUE.split(","));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setUnwrapRequired(Boolean.valueOf(UNWRAP_REQUIRED_VALUE));
|
clientCodegen.setUnwrapRequired(Boolean.valueOf(SwiftOptionsProvider.UNWRAP_REQUIRED_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.put(SwiftCodegen.PROJECT_NAME, PROJECT_NAME_VALUE)
|
|
||||||
.put(SwiftCodegen.RESPONSE_AS, RESPONSE_AS_VALUE)
|
|
||||||
.put(SwiftCodegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_SOURCE, POD_SOURCE_VALUE)
|
|
||||||
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_AUTHORS, POD_AUTHORS_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_LICENSE, POD_LICENSE_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_SUMMARY, POD_SUMMARY_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE)
|
|
||||||
.put(SwiftCodegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.tizen;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.TizenClientCodegen;
|
import io.swagger.codegen.languages.TizenClientCodegen;
|
||||||
|
import io.swagger.codegen.options.TizenClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class TizenClientOptionsTest extends AbstractOptionsTest {
|
public class TizenClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private TizenClientCodegen clientCodegen;
|
private TizenClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public TizenClientOptionsTest() {
|
||||||
|
super(new TizenClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class TizenClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(TizenClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(TizenClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TizenClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.typescriptangular;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.TypeScriptAngularClientCodegen;
|
import io.swagger.codegen.languages.TypeScriptAngularClientCodegen;
|
||||||
|
import io.swagger.codegen.options.TypeScriptAngularClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest {
|
public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private TypeScriptAngularClientCodegen clientCodegen;
|
private TypeScriptAngularClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public TypeScriptAngularClientOptionsTest() {
|
||||||
|
super(new TypeScriptAngularClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(TypeScriptAngularClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(TypeScriptAngularClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,21 @@ package io.swagger.codegen.typescriptnode;
|
|||||||
|
|
||||||
import io.swagger.codegen.AbstractOptionsTest;
|
import io.swagger.codegen.AbstractOptionsTest;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
|
||||||
import io.swagger.codegen.languages.TypeScriptNodeClientCodegen;
|
import io.swagger.codegen.languages.TypeScriptNodeClientCodegen;
|
||||||
|
import io.swagger.codegen.options.TypeScriptNodeClientOptionsProvider;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import mockit.Expectations;
|
import mockit.Expectations;
|
||||||
import mockit.Tested;
|
import mockit.Tested;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest {
|
public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest {
|
||||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
|
||||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
|
||||||
protected static final String SORT_PARAMS_VALUE = "false";
|
|
||||||
|
|
||||||
@Tested
|
@Tested
|
||||||
private TypeScriptNodeClientCodegen clientCodegen;
|
private TypeScriptNodeClientCodegen clientCodegen;
|
||||||
|
|
||||||
|
public TypeScriptNodeClientOptionsTest() {
|
||||||
|
super(new TypeScriptNodeClientOptionsProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodegenConfig getCodegenConfig() {
|
protected CodegenConfig getCodegenConfig() {
|
||||||
return clientCodegen;
|
return clientCodegen;
|
||||||
@ -27,21 +25,12 @@ public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(TypeScriptNodeClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(TypeScriptNodeClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getAvaliableOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -149,6 +149,13 @@
|
|||||||
<artifactId>swagger-codegen</artifactId>
|
<artifactId>swagger-codegen</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-codegen</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
<type>test-jar</type>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
|
@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class Generator {
|
public class Generator {
|
||||||
static Logger LOGGER = LoggerFactory.getLogger(Generator.class);
|
static Logger LOGGER = LoggerFactory.getLogger(Generator.class);
|
||||||
|
@ -2,14 +2,45 @@ package io.swagger.generator.online;
|
|||||||
|
|
||||||
import static org.testng.Assert.assertNotEquals;
|
import static org.testng.Assert.assertNotEquals;
|
||||||
|
|
||||||
|
import io.swagger.codegen.options.AkkaScalaClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.AndroidClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.AsyncScalaClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.CSharpClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.CsharpDotNet2ClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.DartClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.FlashClienOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.JavaInflectorServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.JavaOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.JaxRSServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.NodeJSServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.ObjcClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.OptionsProvider;
|
||||||
|
import io.swagger.codegen.options.PerlClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.PhpClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.PythonClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.Qt5CPPOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.RubyClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.ScalaClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.ScalatraServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SilexServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SinatraServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SpringMVCServerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.StaticDocOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.StaticHtmlOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SwaggerOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SwaggerYamlOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.SwiftOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.TizenClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.TypeScriptAngularClientOptionsProvider;
|
||||||
|
import io.swagger.codegen.options.TypeScriptNodeClientOptionsProvider;
|
||||||
import io.swagger.generator.exception.ApiException;
|
import io.swagger.generator.exception.ApiException;
|
||||||
import io.swagger.generator.model.GeneratorInput;
|
import io.swagger.generator.model.GeneratorInput;
|
||||||
import io.swagger.generator.online.Generator;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.testng.annotations.DataProvider;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -19,19 +50,33 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class OnlineGeneratorOptionsTest {
|
public class OnlineGeneratorOptionsTest {
|
||||||
private final boolean isServer;
|
private static final String OPTIONS_PROVIDER = "optionsProvider";
|
||||||
private final String language;
|
|
||||||
|
|
||||||
protected OnlineGeneratorOptionsTest(String language, boolean isServer) {
|
@DataProvider(name = OPTIONS_PROVIDER)
|
||||||
this.language = language;
|
private Object[][] listOptions() {
|
||||||
this.isServer = isServer;
|
return new Object[][]{{new AkkaScalaClientOptionsProvider()}, {new AndroidClientOptionsProvider()},
|
||||||
|
{new AsyncScalaClientOptionsProvider()}, {new CSharpClientOptionsProvider()},
|
||||||
|
{new CsharpDotNet2ClientOptionsProvider()}, {new DartClientOptionsProvider()},
|
||||||
|
{new FlashClienOptionsProvider()}, {new JavaInflectorServerOptionsProvider()},
|
||||||
|
{new JavaOptionsProvider()}, {new JaxRSServerOptionsProvider()},
|
||||||
|
{new NodeJSServerOptionsProvider()}, {new ObjcClientOptionsProvider()},
|
||||||
|
{new PerlClientOptionsProvider()}, {new PhpClientOptionsProvider()},
|
||||||
|
{new PythonClientOptionsProvider()}, {new Qt5CPPOptionsProvider()},
|
||||||
|
{new RubyClientOptionsProvider()}, {new ScalaClientOptionsProvider()},
|
||||||
|
{new ScalatraServerOptionsProvider()}, {new SilexServerOptionsProvider()},
|
||||||
|
{new SinatraServerOptionsProvider()}, {new SpringMVCServerOptionsProvider()},
|
||||||
|
{new StaticDocOptionsProvider()}, {new StaticHtmlOptionsProvider()},
|
||||||
|
{new SwaggerOptionsProvider()}, {new SwaggerYamlOptionsProvider()},
|
||||||
|
{new SwiftOptionsProvider()}, {new TizenClientOptionsProvider()},
|
||||||
|
{new TypeScriptAngularClientOptionsProvider()}, {new TypeScriptNodeClientOptionsProvider()},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(dataProvider = OPTIONS_PROVIDER)
|
||||||
public void optionsTest() throws ApiException, IOException {
|
public void optionsTest(OptionsProvider provider) throws ApiException, IOException {
|
||||||
final GeneratorInput input = new GeneratorInput();
|
final GeneratorInput input = new GeneratorInput();
|
||||||
final HashMap<String, InvocationCounter> options = convertOptions();
|
final HashMap<String, InvocationCounter> options = convertOptions(provider);
|
||||||
|
|
||||||
final Maps.EntryTransformer<String, InvocationCounter, String> transformer =
|
final Maps.EntryTransformer<String, InvocationCounter, String> transformer =
|
||||||
new Maps.EntryTransformer<String, InvocationCounter, String>() {
|
new Maps.EntryTransformer<String, InvocationCounter, String>() {
|
||||||
@ -44,10 +89,10 @@ public abstract class OnlineGeneratorOptionsTest {
|
|||||||
final ObjectMapper mapper = new ObjectMapper();
|
final ObjectMapper mapper = new ObjectMapper();
|
||||||
input.setSpec(mapper.readTree(loadClassResource(getClass(), "petstore.json")));
|
input.setSpec(mapper.readTree(loadClassResource(getClass(), "petstore.json")));
|
||||||
String outputFilename;
|
String outputFilename;
|
||||||
if (isServer) {
|
if (provider.isServer()) {
|
||||||
outputFilename = Generator.generateServer(language, input);
|
outputFilename = Generator.generateServer(provider.getLanguage(), input);
|
||||||
} else {
|
} else {
|
||||||
outputFilename = Generator.generateClient(language, input);
|
outputFilename = Generator.generateClient(provider.getLanguage(), input);
|
||||||
}
|
}
|
||||||
final File dir = new File(new File(outputFilename).getParent());
|
final File dir = new File(new File(outputFilename).getParent());
|
||||||
FileUtils.deleteDirectory(dir);
|
FileUtils.deleteDirectory(dir);
|
||||||
@ -57,11 +102,9 @@ public abstract class OnlineGeneratorOptionsTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Map<String, String> getOptions();
|
private HashMap<String, InvocationCounter> convertOptions(OptionsProvider provider) {
|
||||||
|
|
||||||
private HashMap<String, InvocationCounter> convertOptions() {
|
|
||||||
HashMap<String, InvocationCounter> options = new HashMap<String, InvocationCounter>();
|
HashMap<String, InvocationCounter> options = new HashMap<String, InvocationCounter>();
|
||||||
for (Map.Entry<String, String> entry : getOptions().entrySet()) {
|
for (Map.Entry<String, String> entry : provider.createOptions().entrySet()) {
|
||||||
options.put(entry.getKey(), new InvocationCounter(entry.getValue()));
|
options.put(entry.getKey(), new InvocationCounter(entry.getValue()));
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package io.swagger.generator.online;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class OnlineJavaClientOptionsTest extends OnlineGeneratorOptionsTest {
|
|
||||||
|
|
||||||
public OnlineJavaClientOptionsTest() {
|
|
||||||
super("java", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected OnlineJavaClientOptionsTest(String language, boolean isServer) {
|
|
||||||
super(language, isServer);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getOptions() {
|
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
|
||||||
return builder.put("modelPackage", "package")
|
|
||||||
.put("apiPackage", "apiPackage")
|
|
||||||
.put("sortParamsByRequiredFlag", "false")
|
|
||||||
.put("invokerPackage", "io.swagger.client.test")
|
|
||||||
.put("groupId", "io.swagger.test")
|
|
||||||
.put("artifactId", "swagger-java-client-test")
|
|
||||||
.put("artifactVersion", "1.0.0-SNAPSHOT")
|
|
||||||
.put("sourceFolder", "src/main/java/test")
|
|
||||||
.put("localVariablePrefix", "tst")
|
|
||||||
.put("serializableModel", "false")
|
|
||||||
.put("fullJavaUtil", "true")
|
|
||||||
.put("library", "jersey2")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package io.swagger.generator.online;
|
|
||||||
|
|
||||||
public class OnlineJaxRSServerOptionsTest extends OnlineJavaClientOptionsTest{
|
|
||||||
|
|
||||||
public OnlineJaxRSServerOptionsTest() {
|
|
||||||
super("jaxrs", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user