Updating licenses in all files
[appc.git] / appc-provider / appc-provider-bundle / src / test / java / org / openecomp / appc / AppcProviderTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  */
22
23 package org.openecomp.appc;
24
25 import java.util.concurrent.ExecutorService;
26 import java.util.concurrent.Executors;
27
28 import org.junit.After;
29 import org.junit.Ignore;
30 import org.junit.Test;
31 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
32 import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
33 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
34 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
35 import org.openecomp.appc.provider.AppcProvider;
36
37 /**
38  * Defines a unit test class which tests the provider. This class leverages the AbstractDataBrokerTest class which
39  * starts a real MD-SAL implementation to use inside of your unit tests. This is not an exhaustive test, but rather is
40  * used to illustrate how one can leverage the AbstractDataBrokerTest to test MD-SAL providers/listeners.
41  */
42 public class AppcProviderTest extends AbstractDataBrokerTest {
43
44     private ExecutorService threadPool = Executors.newSingleThreadExecutor();
45     private AppcProvider provider;
46     private DataBroker dataBroker;
47
48     /**
49      * The @Before annotation is defined in the AbstractDataBrokerTest class. The method setupWithDataBroker is invoked
50      * from inside the @Before method and is used to initialize the databroker with objects for a test runs. In our case
51      * we use this oportunity to create an instance of our provider and initialize it (which registers it as a listener
52      * etc). This method runs before every @Test method below.
53      */
54     @Override
55     protected void setupWithDataBroker(DataBroker dataBroker) {
56         super.setupWithDataBroker(dataBroker);
57
58         this.dataBroker = dataBroker;
59         NotificationProviderService nps = null;
60         RpcProviderRegistry registry = null;
61
62         provider = new AppcProvider(dataBroker, nps, registry);
63     }
64
65     /**
66      * Shuts down our provider, testing close code. @After runs after every @Test method below.
67      */
68     @After
69     public void stop() throws Exception {
70         if (provider != null) {
71             provider.close();
72         }
73     }
74
75     /**
76      * This validates that when a task is created, the run count is initialized to 0
77      */
78     @Ignore
79     @Test
80     public void sampleUnitTest() {
81         // This is where you add your unit testing. You can access "DataBroker" as
82         // needed to create items etc.
83         // This a "Real" data broker.
84     }
85 }