Fix modules Restconf call for mounted devices
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / sal / binding / test / AbstractDataServiceTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.binding.test;
9
10 import org.junit.Before;
11 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
12 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
13 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
14 import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
15
16 import com.google.common.util.concurrent.ListeningExecutorService;
17 import com.google.common.util.concurrent.MoreExecutors;
18
19 @SuppressWarnings("deprecation")
20 public abstract class AbstractDataServiceTest {
21
22     protected org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService;
23     protected DataProviderService baDataService;
24     protected BindingIndependentMappingService mappingService;
25     protected BindingTestContext testContext;
26
27     @Before
28     public void setUp() {
29         ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
30         BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
31         factory.setExecutor(executor);
32         factory.setStartWithParsedSchema(getStartWithSchema());
33         testContext = factory.getTestContext();
34         testContext.start();
35
36         baDataService = testContext.getBindingDataBroker();
37         biDataService = testContext.getDomDataBroker();
38         mappingService = testContext.getBindingToDomMappingService();
39     }
40
41     protected boolean getStartWithSchema() {
42         return true;
43     }
44 }