*/
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;
/**
* @author michal.rehak
- *
+ *
*/
+@Deprecated
public class NodeModificationBuilderImplTest {
private static final Logger LOG = LoggerFactory.getLogger(NodeModificationBuilderImplTest.class);
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
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);
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
MutableCompositeNode mutableParent = (MutableCompositeNode) nodeModificationBuilder
.getMutableEquivalent(needle);
- MutableSimpleNode<String> newMutable = NodeFactory.createMutableSimpleNode(new QName(needle.getNodeType(),
- "anySubNode"), mutableParent, "42", null, null);
+ MutableSimpleNode<String> newMutable = NodeFactory.createMutableSimpleNode(
+ QName.create(needle.getNodeType(),
+ "anySubNode"), mutableParent, "42", null, null);
nodeModificationBuilder.addNode(newMutable);
dumpResult();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
MutableCompositeNode mutableParent = (MutableCompositeNode) nodeModificationBuilder
.getMutableEquivalent(needle);
- MutableSimpleNode<String> newMutable = NodeFactory.createMutableSimpleNode(new QName(needle.getNodeType(),
- "anySubNode"), null, "42", null, null);
+ MutableSimpleNode<String> 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();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
nodeModificationBuilder.deleteNode(mutableNeedle.getParent().asMutable());
dumpResult();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
nodeModificationBuilder.deleteNode(mutableNeedle);
dumpResult();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
mutableNeedle.setValue("tpId_18x");
nodeModificationBuilder.mergeNode(mutableNeedle.getParent().asMutable());
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
nodeModificationBuilder.removeNode(mutableNeedle.getParent().asMutable());
dumpResult();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
nodeModificationBuilder.removeNode(mutableNeedle);
dumpResult();
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
mutableNeedle.setValue("tpId_18x");
nodeModificationBuilder.replaceNode(mutableNeedle.getParent().asMutable());
* Test method for
* {@link org.opendaylight.yangtools.yang.data.impl.NodeModificationBuilderImpl#buildDiffTree()}
* .
- *
+ *
* @throws Exception
*/
@Test
@SuppressWarnings("unchecked")
MutableSimpleNode<String> mutableNeedle = (MutableSimpleNode<String>) nodeModificationBuilder
- .getMutableEquivalent(needle);
+ .getMutableEquivalent(needle);
mutableNeedle.setValue("tpId_18x");
nodeModificationBuilder.replaceNode(mutableNeedle);