Fix previous and add new PCE Junit test cases
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / PceSendingPceRPCsTest.java
1 /*
2  * Copyright © 2020 Orange Labs, 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.transportpce.pce;
9
10 import org.junit.Assert;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.junit.runner.RunWith;
14 import org.mockito.junit.MockitoJUnitRunner;
15 import org.opendaylight.mdsal.binding.api.DataBroker;
16 import org.opendaylight.transportpce.common.DataStoreContext;
17 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
18 import org.opendaylight.transportpce.common.network.RequestProcessor;
19 import org.opendaylight.transportpce.pce.utils.PceTestData;
20 import org.opendaylight.transportpce.test.AbstractTest;
21
22
23
24 @RunWith(MockitoJUnitRunner.class)
25 public class PceSendingPceRPCsTest extends AbstractTest {
26
27     private PceSendingPceRPCs pceSendingPceRPCs;
28     private NetworkTransactionImpl networkTransaction;
29     private DataStoreContext dataStoreContext = this.getDataStoreContextUtil();
30     private DataBroker dataBroker = dataStoreContext.getDataBroker();
31
32
33     @Before
34     public void setUp() throws Exception {
35 //        PceTestUtils.writeTopologyIntoDataStore(
36 //                dataBroker, dataStoreContext, "./topologyData/basePceTopology.json");
37         networkTransaction = new NetworkTransactionImpl(new RequestProcessor(dataBroker));
38         pceSendingPceRPCs = new PceSendingPceRPCs();
39         pceSendingPceRPCs =
40                 new PceSendingPceRPCs(PceTestData.getPCERequest(), networkTransaction
41                 );
42     }
43
44     @Test
45     public void cancelResourceReserve() {
46         pceSendingPceRPCs.cancelResourceReserve();
47         Assert.assertEquals(true, pceSendingPceRPCs.getSuccess());
48     }
49
50     @Test
51     public void pathComputationTest() throws Exception {
52         pceSendingPceRPCs.pathComputation();
53
54     }
55
56     @Test
57     public void checkMessage() {
58         Assert.assertNull(pceSendingPceRPCs.getMessage());
59     }
60
61     @Test
62     public void responseCodeTest() {
63         Assert.assertNull(pceSendingPceRPCs.getResponseCode());
64     }
65
66     @Test
67     public void gnpyAtoZ() {
68         Assert.assertNull(pceSendingPceRPCs.getGnpyAtoZ());
69     }
70
71     @Test
72     public void getGnpyZtoA() {
73         Assert.assertNull(pceSendingPceRPCs.getGnpyZtoA());
74     }
75
76
77 }