X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fservice%2FPathComputationServiceImplTest.java;h=0ab6d1c1e1227526f53eeb798889bba2b26ee2d5;hb=952583aa9f0de2de04f230291a5989413591a7b7;hp=9553a741a24a9572ecc00d74fba2017125a6e4ea;hpb=7be521daacc5ce221474b434ab34c27eb37ec158;p=transportpce.git diff --git a/pce/src/test/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImplTest.java b/pce/src/test/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImplTest.java index 9553a741a..0ab6d1c1e 100644 --- a/pce/src/test/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImplTest.java +++ b/pce/src/test/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImplTest.java @@ -12,20 +12,15 @@ import java.util.Map; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.mockito.Mockito; import org.opendaylight.mdsal.binding.api.DataBroker; -import org.opendaylight.transportpce.common.DataStoreContext; -import org.opendaylight.transportpce.common.network.NetworkTransactionImpl; import org.opendaylight.transportpce.common.network.NetworkTransactionService; -import org.opendaylight.transportpce.common.network.RequestProcessor; 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.pce.utils.PceTestUtils; -import org.opendaylight.transportpce.pce.utils.TransactionUtils; import org.opendaylight.transportpce.test.AbstractTest; +import org.opendaylight.transportpce.test.DataStoreContext; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.PathBandwidth; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.PathPropertiesBuilder; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.path.properties.PathMetric; @@ -33,10 +28,11 @@ import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties. import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.no.path.info.NoPathBuilder; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.Response; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.ResponseBuilder; +import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.ResponseKey; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.response.response.type.NoPathCaseBuilder; import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.response.response.type.PathCaseBuilder; +import org.opendaylight.yangtools.yang.common.Uint32; -@Ignore public class PathComputationServiceImplTest extends AbstractTest { private PathComputationServiceImpl pathComputationServiceImpl; @@ -67,7 +63,8 @@ public class PathComputationServiceImplTest extends AbstractTest { @Test public void testPathComputationRequestNoPath() { - Response response = new ResponseBuilder().setResponseType(new NoPathCaseBuilder() + Response response = new ResponseBuilder() + .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new NoPathCaseBuilder() .setNoPath(new NoPathBuilder().setNoPath("no path").build()).build()).build(); pathComputationServiceImpl.generateGnpyResponse(response,"path"); @@ -81,7 +78,8 @@ public class PathComputationServiceImplTest extends AbstractTest { PathMetric pathMetric = new PathMetricBuilder() .setAccumulativeValue(new BigDecimal(21)) .setMetricType(PathBandwidth.class).build(); - Response response = new ResponseBuilder().setResponseType(new PathCaseBuilder() + Response response = new ResponseBuilder() + .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new PathCaseBuilder() .setPathProperties(new PathPropertiesBuilder().setPathMetric(Map.of(pathMetric.key(),pathMetric)) .build()).build()).build(); @@ -91,17 +89,6 @@ public class PathComputationServiceImplTest extends AbstractTest { } - @Test(expected = Exception.class) - public void generateGnpyResponse() throws Exception { - PceTestUtils.writeNetworkIntoDataStore(dataBroker, dataStoreContext, TransactionUtils.getNetworkForSpanLoss()); - GnpyResult gnpyResult2 = - new GnpyResult("A-to-Z", - new GnpyTopoImpl(new NetworkTransactionImpl( - new RequestProcessor(dataBroker))), null); - pathComputationServiceImpl.generateGnpyResponse(gnpyResult2.getResponse(), "A-to-Z"); - } - - @After public void destroy() { pathComputationServiceImpl.close();