openapi-generator/bin/windows/jaxrs-cxf-petstore-server-test-data.bat

11 lines
796 B
Batchfile
Raw Permalink Normal View History

JAX-RS/CXF 1158 Options to generate fully functional method bodies passing fully populated test data (#1879) * add option to generate alias as model * [JAXRS/CXF] Emit method bodies, test data (#1158) New jaxrs-cxf-extended generator with options: - supportMultipleSpringServices Support generation of Spring services from multiple specifications - generateOperationBody (boolean) Enables generation of fully functional test/service method bodies that pass/return random but valid values & models. - loadTestDataFromFile (boolean) When true, generated method bodies load test data from a generated JSON file. When false, generated method bodies contain inline code to construct the test data. - testDataFile (string) The path of a JSON file to contain generated test data. The file is initially generated but editable; edits are preserved by subsequent generations. - testDataControlFile (string) The path of a JSON file to control test data generation - specifically, to control the number of items required in array properties, structured by API class / operation name / parameter name. The file is initially generated but editable; edits are preserved by subsequent generations. - tests for the jaxrs-cxf-extended generator, including the new options Bug fixes: - fix bug (DefaultGenerator): handle absolute paths in supporting file spec - fix bug (DefaultCodegen): process enums in allVars - fix bug (AbstractJavaCodegen): support multiple inheritance via allOf (inheritance code deleted, as a subsequent pull broke it) - fix bug (JavaCXFServerCodegen): use operationId instead of nickname (gets out of step with duplicate operationIds) - fix bug (JavaCXFServerCodegen): set appropriate default consumes/produces for operations with body parameters or non-void returns (CXF providers don't handle */*) - fix indentation (DefaultCodegen) - add support for a system property openapitools.implementation.version to specify the package implementation version when running non-JAR'd classes in an IDE (otherwise {{{generatorVersion}}} evaluates to 'unset'. * reformat code * make sh executable * fix template folder * fix template folder, update samples * run test data manually to avoid ci failure
2019-03-06 00:58:11 +00:00
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
[core] GeneratorSettings, WorkflowSettings, and cleanup in CodegenConfigurator (#2946) * Introduce GeneratorSettings + cleanup GeneratorSettings is an immutable settings object, intended to limit the manipulation of generator settings. To move to GeneratorSettings, lots of modification was done to CodegenConfigurator. The goal here is that CodegenConfigurator would create the contextual information required to initiate a generator run: * GeneratorSettings * Workflow related settings * Configuring "system" GeneratorProperties (ThreadLocal properties) * Deserializing from file to config object * Input spec document (OpenAPI, intending to target others) ClientOpts was generally unused, and the few places it was being used have been updated to pass the properties to codegen.additionalProperties. * Add sanity to system properties The -D argument for the generate command is an application argument which is easily confused for Java System Properties. This isn't the case, as setting values here doesn't update the configuration in System.getProperties(). This adds a warning and deprecation to that option, as defining these values as system properties will also continue to work as expected. This makes the -D application argument redundant and confusing. * Contextualize generator/workflow settings This splits settings relevant to generator configuration (the what) and workflow configuration (the how) in an attempt to make configuration easier to conceptualize. * Update Gradle task w/ CodegenConfigurator setters * Remove -D usage in scripts * Add -p option for additional properties * Regnerate samples
2019-06-07 17:07:52 +00:00
set ags=generate --artifact-id cxf-test-data -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf-ext -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf-extended -o samples\server\petstore\jaxrs-cxf-test-data --additional-properties hideGenerationTimestamp=true,useAnnotatedBasePath=true --generate-alias-as-model --additional-properties java8=true,generateSpringApplication=true,generateSpringBootApplication=true,generateOperationBody=true,loadTestDataFromFile=true %*
JAX-RS/CXF 1158 Options to generate fully functional method bodies passing fully populated test data (#1879) * add option to generate alias as model * [JAXRS/CXF] Emit method bodies, test data (#1158) New jaxrs-cxf-extended generator with options: - supportMultipleSpringServices Support generation of Spring services from multiple specifications - generateOperationBody (boolean) Enables generation of fully functional test/service method bodies that pass/return random but valid values & models. - loadTestDataFromFile (boolean) When true, generated method bodies load test data from a generated JSON file. When false, generated method bodies contain inline code to construct the test data. - testDataFile (string) The path of a JSON file to contain generated test data. The file is initially generated but editable; edits are preserved by subsequent generations. - testDataControlFile (string) The path of a JSON file to control test data generation - specifically, to control the number of items required in array properties, structured by API class / operation name / parameter name. The file is initially generated but editable; edits are preserved by subsequent generations. - tests for the jaxrs-cxf-extended generator, including the new options Bug fixes: - fix bug (DefaultGenerator): handle absolute paths in supporting file spec - fix bug (DefaultCodegen): process enums in allVars - fix bug (AbstractJavaCodegen): support multiple inheritance via allOf (inheritance code deleted, as a subsequent pull broke it) - fix bug (JavaCXFServerCodegen): use operationId instead of nickname (gets out of step with duplicate operationIds) - fix bug (JavaCXFServerCodegen): set appropriate default consumes/produces for operations with body parameters or non-void returns (CXF providers don't handle */*) - fix indentation (DefaultCodegen) - add support for a system property openapitools.implementation.version to specify the package implementation version when running non-JAR'd classes in an IDE (otherwise {{{generatorVersion}}} evaluates to 'unset'. * reformat code * make sh executable * fix template folder * fix template folder, update samples * run test data manually to avoid ci failure
2019-03-06 00:58:11 +00:00
java %JAVA_OPTS% -jar %executable% %ags%