Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ConstantSchemaAbstractDataBrokerTest, faster than AbstractDataBrokerTest
[controller.git]
/
opendaylight
/
md-sal
/
sal-binding-broker
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
md
/
sal
/
binding
/
test
/
AbstractSchemaAwareTest.java
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 78febb50f7d8fbdb1f25bc108a18dbf26c0d83d9..21f806508fb12e286d17826d368b649e738147b6 100644
(file)
--- 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 {
public abstract class AbstractSchemaAwareTest {
- private Iterable<YangModuleInfo> moduleInfos;
- private SchemaContext schemaContext;
-
-
- protected Iterable<YangModuleInfo> getModuleInfos() {
+ protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
return BindingReflections.loadModuleInfos();
}
return BindingReflections.loadModuleInfos();
}
-
- @Before
- public final void setup() {
- moduleInfos = getModuleInfos();
+ protected SchemaContext getSchemaContext() throws Exception {
+ Iterable<YangModuleInfo> moduleInfos = getModuleInfos();
ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
moduleContext.addModuleInfos(moduleInfos);
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)}
}
/**
* Setups test with Schema context.
* This method is called before {@link #setupWithSchemaService(SchemaService)}
- *
- * @param context
*/
protected abstract void setupWithSchema(SchemaContext context);
*/
protected abstract void setupWithSchema(SchemaContext context);