X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=servicehandler%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2FMappingConstraintsTest.java;h=dbec3e2d59e9c80bf66986e5ba8c470d3f75f8d2;hb=98dda60c2cd59d7c7dd8dba35d7d80473862646d;hp=bd64dce8932b7c596497ccaa34f2f13ba2a0f5bc;hpb=60a34046775bcff8272c14ac209f27dce472b8f3;p=transportpce.git diff --git a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/MappingConstraintsTest.java b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/MappingConstraintsTest.java index bd64dce893..dbec3e2d59 100644 --- a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/MappingConstraintsTest.java +++ b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/MappingConstraintsTest.java @@ -10,12 +10,12 @@ package org.opendaylight.transportpce.servicehandler; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.CoRoutingBuilder; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.GeneralBuilder; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraintsBuilder; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraintsBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.CoRoutingBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.GeneralBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraints; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraintsBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.SoftConstraints; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.SoftConstraintsBuilder; @@ -23,33 +23,35 @@ public class MappingConstraintsTest { private HardConstraints buildHardConstraintWithCoRouting() { return new HardConstraintsBuilder() - .setCoRoutingOrGeneral(new CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.openroadm.routing - .constrains.rev161014.constraints.co.routing.or.general.co.routing - .CoRoutingBuilder().setExistingService( - Arrays.asList("Some existing-service")).build()) + .setCoRoutingOrGeneral(new CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co + .routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) .build()) - .setCustomerCode(Arrays.asList("Some customer-code")) - .build(); + .build()) + .setCustomerCode(Arrays.asList("Some customer-code")) + .build(); } private HardConstraints buildHardConstraintWithGeneral() { return new HardConstraintsBuilder() - .setCoRoutingOrGeneral(new GeneralBuilder().build()) - .setCustomerCode(Arrays.asList("Some customer-code")) - .build(); + .setCoRoutingOrGeneral(new GeneralBuilder().build()) + .setCustomerCode(Arrays.asList("Some customer-code")) + .build(); } private SoftConstraints buildSoftConstraintWithCoRouting() { return new SoftConstraintsBuilder() - .setCoRoutingOrGeneral(new CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.openroadm.routing - .constrains.rev161014.constraints.co.routing.or.general.co.routing - .CoRoutingBuilder().setExistingService( - Arrays.asList("Some existing-service")).build()) + .setCoRoutingOrGeneral(new CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co + .routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) .build()) - .setCustomerCode(Arrays.asList("Some customer-code")) - .build(); + .build()) + .setCustomerCode(Arrays.asList("Some customer-code")) + .build(); } @Test @@ -104,44 +106,58 @@ public class MappingConstraintsTest { @Test public void serviceToServicePathConstraintsParameterizedConstructor() { MappingConstraints mappingConstraints = new MappingConstraints( - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder() - .setCustomerCode(Arrays.asList("Some customer-code")) - .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() - .setExistingService(Arrays.asList("Some existing-service")) - .build()) - .build()).build(), - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder() + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.HardConstraintsBuilder() .setCustomerCode(Arrays.asList("Some customer-code")) - .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() - .setExistingService(Arrays.asList("Some existing-service")) + .setCoRoutingOrGeneral( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints + .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) + .build()) .build()) - .build()).build()); + .build(), + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.SoftConstraintsBuilder() + .setCustomerCode(Arrays.asList("Some customer-code")) + .setCoRoutingOrGeneral( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints + .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) + .build()) + .build()) + .build()); mappingConstraints.serviceToServicePathConstarints(); - Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() - .setExistingService(Arrays.asList("Some existing-service")) - .build()) - .build(), mappingConstraints.getServicePathHardConstraints().getCoRoutingOrGeneral()); - Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder() - .setCustomerCode(Arrays.asList("Some customer-code")) - .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder() - .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing - .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() - .setExistingService(Arrays.asList("Some existing-service")) - .build()) - .build()).build(), mappingConstraints.getServicePathSoftConstraints()); + Assert.assertEquals( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) + .build()) + .build(), + mappingConstraints.getServicePathHardConstraints().getCoRoutingOrGeneral()); + Assert.assertEquals( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.SoftConstraintsBuilder() + .setCustomerCode(Arrays.asList("Some customer-code")) + .setCoRoutingOrGeneral( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.CoRoutingBuilder() + .setCoRouting( + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints + .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder() + .setExistingService(Arrays.asList("Some existing-service")) + .build()) + .build()) + .build(), + mappingConstraints.getServicePathSoftConstraints()); } }