Given a set of test parameters and template files, FuncGen can generate an infinite number of test files. FuncGen is an appropriate tool when testing complex permutations and frequently changing test parameters in an automated functional test environment.
FuncGen has a Maven 2 Plugin to simplify usage.
Although the FuncGen model and templates have not stabilized and will be refined, the underlying JavaGen Agile code generation framework is robust and stable.
FuncGen is being developed to allow extensive functional testing of RevGen. See the RevGen Functional Tests for the results of the various combinations of target persistence technologies, ORM (Object Relational Mappings) configurations, table types, foreign keys and databases.
Test generation is configured using FuncGenSpringConfig.xml which is a Spring XML bean configuration file. FuncGen is based on JavaGen Agile a template-based, highly-configurable code generation framework.
The specific tests generated are model in funcgen-tests.xml using suite, test and permutations elements:
<suite name="doa-impl">
<!-- This tests all permutations of DAO implementations:
daoImplType = spring, jpa, hibernate
annotations = true, false
-->
<context>
<entry key="includeTables"><value>PERSONS</value></entry>
</context>
<permutations name="daoImplType">
<value>jpa</value>
<value>spring</value>
<value>hibernate</value>
</permutations>
<permutations name="annotations">
<value>true</value>
<value>false</value>
</permutations>
</suite>This model segment results in 6 tests being generated to test every combination of the 3 daoImplType settings with the 2 annotations settings.
FuncGen test generation configuration is largely handled by two files:
Use src/funcgen/funcgen.properties for simple configuration. If you need more control, use src/funcgen/FuncGenSpringConfig.xml.
To run funcgen stand-alone type (classpath left out):
java org.javagen.funcgen.Main src/funcgen/FuncGenSpringConfig.xml