Search in sources :

Example 1 with ChildOf

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);
}
Also used : ChildOf(org.opendaylight.yangtools.yang.binding.ChildOf) URLClassLoader(java.net.URLClassLoader) URLClassLoader(java.net.URLClassLoader) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 URLClassLoader (java.net.URLClassLoader)1 Test (org.junit.Test)1 ChildOf (org.opendaylight.yangtools.yang.binding.ChildOf)1