X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-dom-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Fbugfix%2FDOMCodecBug01Test.java;h=471935248506b9cf4c3cdf53d37e8ad43568b33b;hb=673fd147e0dac242e6531e53d587ebc399b25ffc;hp=ec8c8372c1446989f4b1c96477d5e38b1fff76d7;hpb=94d0d20b41d64bb6696c2a573ec367fcfddc44e9;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug01Test.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug01Test.java index ec8c8372c1..4719352485 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug01Test.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug01Test.java @@ -7,6 +7,10 @@ */ package org.opendaylight.controller.sal.binding.test.bugfix; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -15,17 +19,11 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; - - - - - - - +import org.junit.Ignore; import org.junit.Test; import org.opendaylight.controller.md.sal.common.api.TransactionStatus; -import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest; import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction; +import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; @@ -40,15 +38,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -63,8 +59,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import static org.junit.Assert.*; - public class DOMCodecBug01Test extends AbstractDataServiceTest { private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id"); @@ -122,8 +116,14 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest { * * Reported by Depthi V V * + * @deprecated This test tests indirect generation, which should be tested + * different way. the test creates conflicting transactions + * and assumes correct commit - to test codec generation + * */ @Test + @Ignore + @Deprecated public void testIndirectGeneration() throws Exception { ExecutorService basePool = Executors.newFixedThreadPool(2); @@ -182,7 +182,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest { flow.setNode(NODE_REF); InstructionsBuilder instructions = new InstructionsBuilder(); InstructionBuilder instruction = new InstructionBuilder(); - + instruction.setOrder(10); ApplyActionsBuilder applyActions = new ApplyActionsBuilder(); List actionList = new ArrayList<>(); @@ -204,7 +204,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest { assertNotNull(ret); assertEquals(TransactionStatus.COMMITED, ret.getResult()); } - + private void createFlow2() throws Exception { DataModificationTransaction modification = baDataService.beginTransaction(); long id = 123; @@ -215,7 +215,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest { MatchBuilder match = new MatchBuilder(); match.setLayer4Match(new TcpMatchBuilder().build()); flow.setMatch(match.build()); - + path1 = InstanceIdentifier.builder(Flows.class).child(Flow.class, key).toInstance(); // DataObject cls = (DataObject) modification.readConfigurationData(path1); modification.putConfigurationData(path1, flow.build()); @@ -225,7 +225,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest { private class CreateFlowTask implements Callable { - public CreateFlowTask(Object startSync) { + public CreateFlowTask(final Object startSync) { } @Override