X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FIntegrationTestKit.java;h=e1d866db11f14ae3a8391e482e9e140dc1de6f63;hb=b7cedcc1c346813f71a56eebb0e4abe9e6828ee6;hp=d6bb8182a747b0c16700cb52acf280efc551aae3;hpb=9dde5085f50832148a6f3766e1bc988be0327401;p=controller.git 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 d6bb8182a7..e1d866db11 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();