adding some pce unit tests and remove ignore from olm class
[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.utils.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.networkanalyzer.PceCalculation;
16 import org.opendaylight.transportpce.pce.networkanalyzer.PceResult;
17 import org.opendaylight.transportpce.pce.utils.PceTestData;
18 import org.opendaylight.transportpce.test.AbstractTest;
19
20 public class PceCalculationTest extends AbstractTest {
21
22     private PceCalculation pceCalculation;
23
24     // setup object
25     @Before
26     public void setUp() {
27         PceResult pceResult = new PceResult();
28         pceResult.setRC("200");
29
30         pceCalculation = new PceCalculation(
31                 PceTestData.getPCERequest(),
32                 new NetworkTransactionImpl(new RequestProcessor(this.getDataBroker())),
33                 null,
34                 null,
35                 pceResult);
36
37
38     }
39
40     @Test
41     public void testPceCalculationValues() {
42
43         pceCalculation.retrievePceNetwork();
44         Assert.assertEquals("100GE", pceCalculation.getServiceType());
45         Assert.assertNotNull(pceCalculation.getReturnStructure());
46
47         Assert.assertNull(pceCalculation.getaendPceNode());
48         Assert.assertNull(pceCalculation.getzendPceNode());
49     }
50 }