use of org.opendaylight.yangtools.yang.binding.ChildOf in project mdsal by opendaylight.
the class CompilationTest method testBug1377.
/**
* Test if class generated for node from grouping implements ChildOf.
*/
@Test
public void testBug1377() throws Exception {
final File sourcesOutputDir = CompilationTestUtils.generatorOutput("bug1377");
final File compiledOutputDir = CompilationTestUtils.compilerOutput("bug1377");
generateTestSources("/compilation/bug1377", sourcesOutputDir);
// Test if sources are compilable
CompilationTestUtils.testCompilation(sourcesOutputDir, compiledOutputDir);
final ClassLoader loader = new URLClassLoader(new URL[] { compiledOutputDir.toURI().toURL() });
final Class<?> outputActionClass = Class.forName(CompilationTestUtils.BASE_PKG + ".urn.test.foo.rev140717.action.action.output.action._case.OutputAction", true, loader);
final Class<?> actionClass = Class.forName(CompilationTestUtils.BASE_PKG + ".urn.test.foo.rev140717.Action", true, loader);
// Test generated 'container output-action'
assertTrue(outputActionClass.isInterface());
CompilationTestUtils.assertImplementsParameterizedIfc(outputActionClass, ChildOf.class.toString(), actionClass.getCanonicalName());
CompilationTestUtils.cleanUp(sourcesOutputDir, compiledOutputDir);
}
Aggregations