Merge "add tests for impl layer pce module"
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / networkanalyzer / PceCalculationTest.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.networkanalyzer;
9
10 import org.junit.Assert;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
14 import org.opendaylight.transportpce.common.network.RequestProcessor;
15 import org.opendaylight.transportpce.pce.utils.PceTestData;
16 import org.opendaylight.transportpce.test.AbstractTest;
17
18 public class PceCalculationTest extends AbstractTest {
19
20     private PceCalculation pceCalculation;
21
22     // setup object
23     @Before
24     public void setUp() {
25         PceResult pceResult = new PceResult();
26         pceResult.setRC("200");
27
28         pceCalculation = new PceCalculation(
29                 PceTestData.getPCERequest(),
30                 new NetworkTransactionImpl(new RequestProcessor(this.getDataBroker())),
31                 null,
32                 null,
33                 pceResult);
34
35
36     }
37
38     @Test
39     public void testPceCalculationValues() {
40
41         pceCalculation.retrievePceNetwork();
42         Assert.assertEquals("100GE", pceCalculation.getServiceType());
43         Assert.assertNotNull(pceCalculation.getReturnStructure());
44
45         Assert.assertNull(pceCalculation.getaendPceNode());
46         Assert.assertNull(pceCalculation.getzendPceNode());
47     }
48 }