X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Ftest%2FAbstractSchemaAwareTest.java;h=21f806508fb12e286d17826d368b649e738147b6;hp=78febb50f7d8fbdb1f25bc108a18dbf26c0d83d9;hb=a12683b9e6445f48216ce0ca357dfcf359c8e3b3;hpb=797ebcb9bb6631538d8deee1ef6a0098e94788a2 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..21f806508f 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 @@ -15,29 +15,25 @@ 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(); } - - @Before - public final void setup() { - moduleInfos = getModuleInfos(); + protected SchemaContext getSchemaContext() throws Exception { + Iterable moduleInfos = getModuleInfos(); ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create(); moduleContext.addModuleInfos(moduleInfos); - schemaContext = moduleContext.tryToCreateSchemaContext().get(); - setupWithSchema(schemaContext); + return moduleContext.tryToCreateSchemaContext().get(); + } + + @Before + 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);