X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Ftest%2FAbstractSchemaAwareTest.java;h=6b415a0a1243b393bc0d45c196dcbbf272863449;hb=03c13bd8a8bb89a729d739eb2fcd501a4dfa5439;hp=78febb50f7d8fbdb1f25bc108a18dbf26c0d83d9;hpb=797ebcb9bb6631538d8deee1ef6a0098e94788a2;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractSchemaAwareTest.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractSchemaAwareTest.java index 78febb50f7..6b415a0a12 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractSchemaAwareTest.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractSchemaAwareTest.java @@ -8,36 +8,32 @@ package org.opendaylight.controller.md.sal.binding.test; import org.junit.Before; -import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext; +import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext; import org.opendaylight.yangtools.yang.binding.YangModuleInfo; import org.opendaylight.yangtools.yang.binding.util.BindingReflections; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public abstract class AbstractSchemaAwareTest { - private Iterable moduleInfos; - private SchemaContext schemaContext; - - - protected Iterable getModuleInfos() { + protected Iterable getModuleInfos() throws Exception { return BindingReflections.loadModuleInfos(); } + protected SchemaContext getSchemaContext() throws Exception { + final Iterable moduleInfos = getModuleInfos(); + final ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create(); + moduleContext.addModuleInfos(moduleInfos); + return moduleContext.tryToCreateSchemaContext().get(); + } @Before - public final void setup() { - moduleInfos = getModuleInfos(); - ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create(); - moduleContext.addModuleInfos(moduleInfos); - schemaContext = moduleContext.tryToCreateSchemaContext().get(); - setupWithSchema(schemaContext); + public final void setup() throws Exception { + setupWithSchema(getSchemaContext()); } /** * Setups test with Schema context. * This method is called before {@link #setupWithSchemaService(SchemaService)} - * - * @param context */ protected abstract void setupWithSchema(SchemaContext context);