X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2FNodeModificationBuilderImplTest.java;h=70c2c81ab15fc63ca1771f693b5deb6f2758a68b;hb=e8582f5d9750a6eaa258143ac6f78c352c8e79c3;hp=f7fc7c22b8537663c70d10569c1fd3c6d679ec1b;hpb=71796f7bd699504e4de34d1e4d8d30b73f230bf5;p=yangtools.git diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/NodeModificationBuilderImplTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/NodeModificationBuilderImplTest.java index f7fc7c22b8..70c2c81ab1 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/NodeModificationBuilderImplTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/NodeModificationBuilderImplTest.java @@ -7,11 +7,11 @@ */ package org.opendaylight.yangtools.yang.data.impl; +import static org.junit.Assert.assertSame; + import java.net.URI; import java.util.Date; -import junit.framework.Assert; - import org.junit.Before; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; @@ -27,8 +27,9 @@ import org.w3c.dom.Document; /** * @author michal.rehak - * + * */ +@Deprecated public class NodeModificationBuilderImplTest { private static final Logger LOG = LoggerFactory.getLogger(NodeModificationBuilderImplTest.class); @@ -48,12 +49,12 @@ public class NodeModificationBuilderImplTest { CompositeNode diffTreeImmutable = NodeFactory.copyDeepAsImmutable(diffTree, null); Document diffShadow = NodeUtils.buildShadowDomTree(diffTreeImmutable); - NodeHelper.dumpDoc(diffShadow, System.out); + NodeHelper.dumpDoc(diffShadow, LOG); } /** * prepare schemaContext - * + * * @throws Exception */ @Before @@ -61,7 +62,7 @@ public class NodeModificationBuilderImplTest { schemaCtx = NodeHelper.loadSchemaContext(); ns = "urn:opendaylight:controller:network"; - qName = new QName(new URI(ns), new Date(1369000800000L), "topos"); + qName = QName.create(new URI(ns), new Date(1369000800000L), "topos"); network = NodeHelper.buildTestConfigTree(qName); nodeModificationBuilder = new NodeModificationBuilderImpl(schemaCtx); @@ -80,14 +81,14 @@ public class NodeModificationBuilderImplTest { Node mutableEquivalent = nodeModificationBuilder.getMutableEquivalent(topologies); CompositeNode topologiesMutable = rootMutable.getCompositesByName("topologies").iterator().next(); - Assert.assertSame(topologiesMutable, mutableEquivalent); + assertSame(topologiesMutable, mutableEquivalent); } /** * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -100,8 +101,9 @@ public class NodeModificationBuilderImplTest { MutableCompositeNode mutableParent = (MutableCompositeNode) nodeModificationBuilder .getMutableEquivalent(needle); - MutableSimpleNode newMutable = NodeFactory.createMutableSimpleNode(new QName(needle.getNodeType(), - "anySubNode"), mutableParent, "42", null, null); + MutableSimpleNode newMutable = NodeFactory.createMutableSimpleNode( + QName.create(needle.getNodeType(), + "anySubNode"), mutableParent, "42", null, null); nodeModificationBuilder.addNode(newMutable); dumpResult(); @@ -111,7 +113,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -124,11 +126,13 @@ public class NodeModificationBuilderImplTest { MutableCompositeNode mutableParent = (MutableCompositeNode) nodeModificationBuilder .getMutableEquivalent(needle); - MutableSimpleNode newMutable = NodeFactory.createMutableSimpleNode(new QName(needle.getNodeType(), - "anySubNode"), null, "42", null, null); + MutableSimpleNode newMutable = NodeFactory.createMutableSimpleNode( + QName.create(needle.getNodeType(), + "anySubNode"), null, "42", null, null); - MutableCompositeNode newMutableCom = NodeFactory.createMutableCompositeNode(new QName(needle.getNodeType(), - "anySubNode"), mutableParent, NodeUtils.buildChildrenList(newMutable), null, null); + MutableCompositeNode newMutableCom = NodeFactory.createMutableCompositeNode( + QName.create(needle.getNodeType(), + "anySubNode"), mutableParent, NodeUtils.buildChildrenList(newMutable), null, null); NodeUtils.fixChildrenRelation(newMutableCom); newMutableCom.init(); @@ -140,7 +144,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -152,7 +156,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); nodeModificationBuilder.deleteNode(mutableNeedle.getParent().asMutable()); dumpResult(); @@ -162,7 +166,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -174,7 +178,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); nodeModificationBuilder.deleteNode(mutableNeedle); dumpResult(); @@ -184,7 +188,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -196,7 +200,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); mutableNeedle.setValue("tpId_18x"); nodeModificationBuilder.mergeNode(mutableNeedle.getParent().asMutable()); @@ -207,7 +211,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -219,7 +223,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); nodeModificationBuilder.removeNode(mutableNeedle.getParent().asMutable()); dumpResult(); @@ -229,7 +233,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -241,7 +245,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); nodeModificationBuilder.removeNode(mutableNeedle); dumpResult(); @@ -251,7 +255,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -263,7 +267,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); mutableNeedle.setValue("tpId_18x"); nodeModificationBuilder.replaceNode(mutableNeedle.getParent().asMutable()); @@ -274,7 +278,7 @@ public class NodeModificationBuilderImplTest { * Test method for * {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()} * . - * + * * @throws Exception */ @Test @@ -286,7 +290,7 @@ public class NodeModificationBuilderImplTest { @SuppressWarnings("unchecked") MutableSimpleNode mutableNeedle = (MutableSimpleNode) nodeModificationBuilder - .getMutableEquivalent(needle); + .getMutableEquivalent(needle); mutableNeedle.setValue("tpId_18x"); nodeModificationBuilder.replaceNode(mutableNeedle);