X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FIntegrationTestKit.java;h=1c4bfcfbb23dcf2d23faccdb6492d7f328656bf3;hp=01678ad74e90141ef238845ce6202fd922f35836;hb=64b9093c2c9ce670b92f2d0ea44c76dc9a385b5a;hpb=0f7dbbe9b8b3d7ddb22de34ac04650b7ba7fc440 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java index 01678ad74e..1c4bfcfbb2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java @@ -128,7 +128,7 @@ public class IntegrationTestKit extends ShardTestKit { final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem()); final Configuration config = new ConfigurationImpl(moduleShardsConfig, modulesConfig); - datastoreContextBuilder.dataStoreName(typeName); + setDataStoreName(typeName); final DatastoreContext datastoreContext = datastoreContextBuilder.build(); final DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class); @@ -152,12 +152,22 @@ public class IntegrationTestKit extends ShardTestKit { return dataStore; } + private void setDataStoreName(String typeName) { + if ("config".equals(typeName)) { + datastoreContextBuilder.logicalStoreType(LogicalDatastoreType.CONFIGURATION); + } else if ("operational".equals(typeName)) { + datastoreContextBuilder.logicalStoreType(LogicalDatastoreType.OPERATIONAL); + } else { + datastoreContextBuilder.dataStoreName(typeName); + } + } + public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName, final SchemaContext schemaContext) { final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem()); final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider()); - getDatastoreContextBuilder().dataStoreName(typeName); + setDataStoreName(typeName); final DatastoreContext datastoreContext = getDatastoreContextBuilder().build(); @@ -180,7 +190,7 @@ public class IntegrationTestKit extends ShardTestKit { final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem()); final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider()); - getDatastoreContextBuilder().dataStoreName(typeName); + setDataStoreName(typeName); final DatastoreContext datastoreContext = getDatastoreContextBuilder().logicalStoreType(storeType).build();