Fix previous and add new PCE Junit test cases
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / service / PathComputationServiceImplTest.java
index 71d57e075c300af6cb6dba39fe8aba2c4d765dcf..b7ccf9183314c6424413b45928483ba772d4d9dd 100644 (file)
@@ -5,14 +5,16 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.transportpce.pce.utils.service;
+package org.opendaylight.transportpce.pce.service;
 
+import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
 import org.opendaylight.transportpce.common.network.RequestProcessor;
-import org.opendaylight.transportpce.pce.service.PathComputationServiceImpl;
+import org.opendaylight.transportpce.pce.gnpy.GnpyResult;
+import org.opendaylight.transportpce.pce.gnpy.GnpyTopoImpl;
 import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.test.AbstractTest;
 
@@ -30,7 +32,24 @@ public class PathComputationServiceImplTest extends AbstractTest {
 
     @Test
     public void pathComputationRequestTest() {
-        Assert.assertNotNull(pathComputationServiceImpl.pathComputationRequest(PceTestData.getPCERequest()));
+        Assert.assertNotNull(
+                pathComputationServiceImpl.pathComputationRequest(PceTestData.getEmptyPCERequest()));
+
+    }
+
+    @Test(expected = Exception.class)
+    public void generateGnpyResponse() throws Exception {
+
+        GnpyResult gnpyResult =
+                new GnpyResult("A-to-Z",
+                        new GnpyTopoImpl(new NetworkTransactionImpl(
+                                new RequestProcessor(this.getNewDataBroker()))));
+        pathComputationServiceImpl.generateGnpyResponse(gnpyResult.getResponse(), "A-to-Z");
+    }
+
+
+    @After
+    public void destroy() {
         pathComputationServiceImpl.close();
     }
 }