/** * I want to figure out, if i need specialized generator for enum types, or i can use standard * instantiator generator. It doesn't assert anything, it's only simple check. First condition in * the InstantiatorGenerator has to be commented. */ @Test public void TestInstantiator() { GeneratorConfiguration gc = new GeneratorConfiguration(); gc.setInstantiatorClassIdentifier("Test%sInstantiator"); Generator generator = new InstantiatorGenerator(gc); GeneratorJobConfiguration job = new GeneratorJobConfiguration(); job.setApiId("enum"); job.setOutputDir("output/tests/enum"); job.setOutputPackage("test.%s"); generator.generate(api, job); }
@Test public void TestPlanets() { Generator generator = new InstantiatorGenerator(new GeneratorConfiguration()); GeneratorJobConfiguration job = new GeneratorJobConfiguration(); job.setApiId("enum"); job.setOutputDir("output/tests/enum"); job.setOutputPackage("test.%s"); generator.generate(api, job); File resultFile = new File("output/tests/enum/test/lib/PlanetInstantiator.java"); assertTrue(resultFile.exists()); File expected = new File("testres/enum_exp/test/lib/PlanetInstantiator.java"); assertEqualFiles(expected, resultFile); }