aa80e117ab65c155f4407e85156ee78636048421
[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 com.google.common.util.concurrent.ListeningExecutorService;
11 import com.google.common.util.concurrent.MoreExecutors;
12 import org.junit.Before;
13 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
14 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
15
16 public abstract class AbstractDataServiceTest {
17
18     protected BindingTestContext testContext;
19
20     @Before
21     public void setUp() {
22         ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();
23         BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
24         factory.setExecutor(executor);
25         factory.setStartWithParsedSchema(getStartWithSchema());
26         testContext = factory.getTestContext();
27         testContext.start();
28     }
29
30     protected boolean getStartWithSchema() {
31         return true;
32     }
33 }