Fixed bug in cross-broker RPC routing
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / sal / binding / test / AbstractDataServiceTest.java
1 package org.opendaylight.controller.sal.binding.test;
2
3 import java.io.File;
4 import java.io.InputStream;
5 import java.util.ArrayList;
6 import java.util.List;
7 import java.util.Set;
8
9 import javassist.ClassPool;
10
11 import org.junit.After;
12 import org.junit.Before;
13 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
14 import org.opendaylight.controller.sal.binding.impl.DataBrokerImpl;
15 import org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector;
16 import org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentMappingService;
17 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
18 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
19 import org.opendaylight.controller.sal.binding.dom.serializer.impl.RuntimeGeneratedMappingServiceImpl;
20 import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
21 import org.opendaylight.controller.sal.core.api.data.DataStore;
22 import org.opendaylight.controller.sal.dom.broker.impl.DataStoreStatsWrapper;
23 import org.opendaylight.controller.sal.dom.broker.impl.HashMapDataStore;
24 import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter;
25 import org.opendaylight.yangtools.yang.model.api.Module;
26 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
27 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
28 import org.reflections.Reflections;
29 import org.reflections.scanners.ResourcesScanner;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
32
33 import com.google.common.base.Predicate;
34 import com.google.common.util.concurrent.ListeningExecutorService;
35 import com.google.common.util.concurrent.MoreExecutors;
36
37 public abstract class AbstractDataServiceTest {
38     private static Logger log = LoggerFactory.getLogger(AbstractDataServiceTest.class);
39
40     protected org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService;
41     protected DataProviderService baDataService;
42     protected BindingIndependentMappingService mappingService;
43     private DataStoreStatsWrapper dataStoreStats;
44     protected DataStore dataStore;
45     protected BindingTestContext testContext;
46
47     @Before
48     public void setUp() {
49         ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
50         BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
51         factory.setExecutor(executor);
52         factory.setStartWithParsedSchema(getStartWithSchema());
53         testContext = factory.getTestContext();
54         testContext.start();
55         
56         baDataService = testContext.getBindingDataBroker();
57         biDataService = testContext.getDomDataBroker();
58         dataStore = testContext.getDomDataStore();
59         mappingService = testContext.getBindingToDomMappingService();
60     }
61
62     protected boolean getStartWithSchema() {
63         return true;
64     }
65
66     @After
67     public void afterTest() {
68
69         testContext.logDataStoreStatistics();
70
71     }
72 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.