1 package org.opendaylight.controller.sal.binding.test;
3 import org.junit.After;
4 import org.junit.Before;
5 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
6 import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
7 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
8 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
9 import org.opendaylight.controller.sal.core.api.data.DataStore;
10 import org.opendaylight.controller.sal.dom.broker.impl.DataStoreStatsWrapper;
11 import org.opendaylight.controller.sal.dom.broker.impl.HashMapDataStore;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 import com.google.common.util.concurrent.ListeningExecutorService;
16 import com.google.common.util.concurrent.MoreExecutors;
18 public abstract class AbstractDataServiceTest {
19 private static Logger log = LoggerFactory.getLogger(AbstractDataServiceTest.class);
21 protected org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService;
22 protected DataProviderService baDataService;
23 protected BindingIndependentMappingService mappingService;
24 private DataStoreStatsWrapper dataStoreStats;
25 protected DataStore dataStore;
26 protected BindingTestContext testContext;
30 ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
31 BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
32 factory.setExecutor(executor);
33 factory.setStartWithParsedSchema(getStartWithSchema());
34 testContext = factory.getTestContext();
37 baDataService = testContext.getBindingDataBroker();
38 biDataService = testContext.getDomDataBroker();
39 dataStore = testContext.getDomDataStore();
40 mappingService = testContext.getBindingToDomMappingService();
43 protected boolean getStartWithSchema() {
48 public void afterTest() {
50 testContext.logDataStoreStatistics();