2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.binding.test;
10 import org.junit.After;
11 import org.junit.Before;
12 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
13 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
14 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
15 import org.opendaylight.controller.sal.core.api.data.DataStore;
16 import org.opendaylight.controller.sal.dom.broker.impl.DataStoreStatsWrapper;
17 import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 import com.google.common.util.concurrent.ListeningExecutorService;
22 import com.google.common.util.concurrent.MoreExecutors;
24 public abstract class AbstractDataServiceTest {
25 private static Logger log = LoggerFactory.getLogger(AbstractDataServiceTest.class);
27 protected org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService;
28 protected DataProviderService baDataService;
29 protected BindingIndependentMappingService mappingService;
30 private DataStoreStatsWrapper dataStoreStats;
31 protected DataStore dataStore;
32 protected BindingTestContext testContext;
36 ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
37 BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
38 factory.setExecutor(executor);
39 factory.setStartWithParsedSchema(getStartWithSchema());
40 testContext = factory.getTestContext();
43 baDataService = testContext.getBindingDataBroker();
44 biDataService = testContext.getDomDataBroker();
45 dataStore = testContext.getDomDataStore();
46 mappingService = testContext.getBindingToDomMappingService();
49 protected boolean getStartWithSchema() {
54 public void afterTest() {
56 testContext.logDataStoreStatistics();