@Test
public void testAugmentToUsesInAugment() throws IOException, URISyntaxException {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "augment-uses-to-augment");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "augment-uses-to-augment");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("augment-uses-to-augment");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("augment-uses-to-augment");
final List<File> sourceFiles = CompilationTestUtils.getSourceFiles("/compilation/augment-uses-to-augment");
final SchemaContext context = YangParserTestUtils.parseYangFiles(sourceFiles);
final List<Type> types = bindingGenerator.generateTypes(context);
@Test
public void test() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug1276");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug1276");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug1276");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug1276");
generateTestSources("/compilation/bug1276", sourcesOutputDir);
// Test if sources are compilable
@Test
public void test() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + BUG_ID);
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + BUG_ID);
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput(BUG_ID);
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput(BUG_ID);
generateTestSources(CompilationTestUtils.FS + "compilation" + CompilationTestUtils.FS + BUG_ID, sourcesOutputDir);
// Test if sources are compilable
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.BASE_PKG;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.COMPILER_OUTPUT_PATH;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.FS;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.GENERATOR_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.cleanUp;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.getSourceFiles;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.testCompilation;
@Test
public void test() throws Exception {
- final File sourcesOutputDir = new File(GENERATOR_OUTPUT_PATH + FS + "bug532");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(COMPILER_OUTPUT_PATH + FS + "bug532");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug532");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug532");
generateTestSources("/compilation/list-gen-test", sourcesOutputDir);
// Test if sources are compilable
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.BASE_PKG;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.COMPILER_OUTPUT_PATH;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.FS;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.GENERATOR_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.NS_BAR;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.NS_BAZ;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.NS_FOO;
@Test
public void testCascadeUsesCompilation() throws Exception {
- final File sourcesOutputDir = new File(GENERATOR_OUTPUT_PATH + FS + "cascade-uses");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(COMPILER_OUTPUT_PATH + FS + "cascade-uses");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("cascade-uses");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("cascade-uses");
final List<File> sourceFiles = getSourceFiles("/compilation/cascade-uses");
final SchemaContext context = YangParserTestUtils.parseYangFiles(sourceFiles);
final List<Type> types = bindingGenerator.generateTypes(context);
@Test
public void testListGeneration() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "list-gen");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "list-gen");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("list-gen");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("list-gen");
generateTestSources("/compilation/list-gen", sourcesOutputDir);
// Test if all sources are generated
@Test
public void testAugmentUnderUsesGeneration() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "augment-under-uses");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "augment-under-uses");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("augment-under-uses");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("augment-under-uses");
generateTestSources("/compilation/augment-under-uses", sourcesOutputDir);
// Test if all sources were generated from 'module foo'
@Test
public void testAugmentOfAugmentGeneration() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "aug-of-aug");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "aug-of-aug");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("aug-of-aug");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("aug-of-aug");
generateTestSources("/compilation/augment-of-augment", sourcesOutputDir);
// Test if all sources were generated from 'module foo'
@Test
public void testLeafReturnTypes() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "leaf-return-types");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "leaf-return-types");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("leaf-return-types");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("leaf-return-types");
generateTestSources("/compilation/leaf-return-types", sourcesOutputDir);
final File parent = new File(sourcesOutputDir, CompilationTestUtils.NS_TEST);
@Test
public void testGenerationContextReferenceExtension() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "context-reference");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "context-reference");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("context-reference");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("context-reference");
generateTestSources("/compilation/context-reference", sourcesOutputDir);
// Test if all sources are generated
@Test
public void compilationTest() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "yang");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "yang");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("yang");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("yang");
generateTestSources("/yang", sourcesOutputDir);
// Test if sources are compilable
@Test
public void testBug586() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug586");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug586");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug586");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug586");
generateTestSources("/compilation/bug586", sourcesOutputDir);
// Test if sources are compilable
@Test
public void testBug4760() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug4760");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug4760");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug4760");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug4760");
generateTestSources("/compilation/bug4760", sourcesOutputDir);
// Test if sources are compilable
*/
@Test
public void testBug1172() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug1172");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug1172");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug1172");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug1172");
generateTestSources("/compilation/bug1172", sourcesOutputDir);
// Test if sources are compilable
@Test
public void testBug5461() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug5461");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug5461");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug5461");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug5461");
generateTestSources("/compilation/bug5461", sourcesOutputDir);
// Test if sources are compilable
@Test
public void testBug5882() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug5882");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug5882");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug5882");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug5882");
generateTestSources("/compilation/bug5882", sourcesOutputDir);
// Test if sources are compilable
*/
@Test
public void testBug1377() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "bug1377");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "bug1377");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug1377");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug1377");
generateTestSources("/compilation/bug1377", sourcesOutputDir);
@Test
public void classNamesColisionTest() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "class-name-collision");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "class-name-collision");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("class-name-collision");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("class-name-collision");
generateTestSources("/compilation/class-name-collision", sourcesOutputDir);
CompilationTestUtils.testCompilation(sourcesOutputDir, compiledOutputDir);
CompilationTestUtils.cleanUp(sourcesOutputDir, compiledOutputDir);
*/
package org.opendaylight.mdsal.binding.java.api.generator.test;
+import static com.google.common.base.Preconditions.checkState;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
static final String GENERATOR_OUTPUT_PATH = TEST_PATH + FS + "src";
static final File GENERATOR_OUTPUT_DIR = new File(GENERATOR_OUTPUT_PATH);
- static final String COMPILER_OUTPUT_PATH = TEST_PATH + FS + "bin";
+ private static final String COMPILER_OUTPUT_PATH = TEST_PATH + FS + "bin";
static final File COMPILER_OUTPUT_DIR = new File(COMPILER_OUTPUT_PATH);
static final String AUGMENTATION = "interface org.opendaylight.yangtools.yang.binding.Augmentation";
static final String NS_BAZ = BASE_PATH + FS + "urn" + FS + "opendaylight" + FS + "baz" + FS + "rev131008";
static final String NS_BUG5882 = BASE_PATH + FS + "urn" + FS + "yang" + FS + "foo" + FS + "rev160102";
+ static File compilerOutput(final String name) {
+ return createDirectory(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + name);
+ }
+
+ static File generatorOutput(final String name) {
+ return createDirectory(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + name);
+ }
+
+ private static File createDirectory(final String path) {
+ final File ret = new File(path);
+ checkState(ret.mkdir(), "Failed to create test directory %s", path);
+ return ret;
+ }
+
/**
* Method to clean resources. It is manually called at the end of each test
* instead of marking it with @After annotation to prevent removing
*/
package org.opendaylight.mdsal.binding.java.api.generator.test;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.COMPILER_OUTPUT_PATH;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.FS;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.GENERATOR_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.cleanUp;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.getSourceFiles;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.testCompilation;
@Test
public void testAugmentToUsesInAugment() throws Exception {
- final File sourcesOutputDir = new File(GENERATOR_OUTPUT_PATH + FS + "encoding-javadoc");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(COMPILER_OUTPUT_PATH + FS + "encoding-javadoc");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("encoding-javadoc");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("encoding-javadoc");
final List<File> sourceFiles = getSourceFiles("/compilation/encoding-javadoc");
final SchemaContext context = YangParserTestUtils.parseYangFiles(sourceFiles);
final List<Type> types = bindingGenerator.generateTypes(context);
import static org.junit.Assert.assertTrue;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.BASE_PKG;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.COMPILER_OUTPUT_PATH;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.FS;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.GENERATOR_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.NS_TEST;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.assertFilesCount;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.assertImplementsIfc;
@Test
public void testListGeneration() throws Exception {
- final File sourcesOutputDir = new File(GENERATOR_OUTPUT_PATH + FS + "nested-grouping");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(COMPILER_OUTPUT_PATH + FS + "nested-grouping");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("nested-grouping");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("nested-grouping");
generateTestSources("/compilation/nested-grouping", sourcesOutputDir);
// Test if all sources are generated
@Test
public void test() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "typedef");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "typedef");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("typedef");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("typedef");
final List<File> sourceFiles = CompilationTestUtils.getSourceFiles("/compilation/typedef");
final SchemaContext context = YangParserTestUtils.parseYangFiles(sourceFiles);
final List<Type> types = bindingGenerator.generateTypes(context);
package org.opendaylight.mdsal.binding.java.api.generator.test;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.COMPILER_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.FS;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.GENERATOR_OUTPUT_PATH;
import static org.opendaylight.mdsal.binding.java.api.generator.test.CompilationTestUtils.cleanUp;
@Test
public void testUnionTypedefUnusedImport() throws Exception {
- final File sourcesOutputDir = new File(GENERATOR_OUTPUT_PATH + FS + "union-typedef");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(COMPILER_OUTPUT_PATH + FS + "union-typedef");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("union-typedef");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("union-typedef");
final List<File> sourceFiles = getSourceFiles("/compilation/union-typedef");
final SchemaContext context = YangParserTestUtils.parseYangFiles(sourceFiles);
final List<Type> types = bindingGenerator.generateTypes(context);
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import com.google.common.collect.ImmutableSet;
import java.io.File;
@Test
public void test() throws Exception {
- final File sourcesOutputDir = new File(CompilationTestUtils.GENERATOR_OUTPUT_PATH + CompilationTestUtils.FS + "union-with-identityref");
- assertTrue("Failed to create test file '" + sourcesOutputDir + "'", sourcesOutputDir.mkdir());
- final File compiledOutputDir = new File(CompilationTestUtils.COMPILER_OUTPUT_PATH + CompilationTestUtils.FS + "union-with-identityref");
- assertTrue("Failed to create test file '" + compiledOutputDir + "'", compiledOutputDir.mkdir());
-
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("union-with-identityref");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("union-with-identityref");
generateTestSources("/compilation/union-with-identityref", sourcesOutputDir);
// Test if sources are compilable