Use ImmutableNodes.fromInstanceId in restconf
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / NormalizeNodeTest.java
index 6d2723c2f17391e8fff4d30e983d236aa5e39c10..a2aff72d1fa8a01d7e77c544e85dffbe7154880d 100644 (file)
@@ -7,17 +7,7 @@
  */
 package org.opendaylight.controller.sal.restconf.impl.test;
 
-import static org.junit.Assert.*;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.restconf.impl.CompositeNodeWrapper;
-import org.opendaylight.controller.sal.restconf.impl.ResponseException;
-import org.opendaylight.controller.sal.restconf.impl.SimpleNodeWrapper;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
 public class NormalizeNodeTest extends YangAndXmlAndDataSchemaLoader {
 
@@ -26,65 +16,4 @@ public class NormalizeNodeTest extends YangAndXmlAndDataSchemaLoader {
         dataLoad("/normalize-node/yang/");
     }
 
-    @Test
-    public void namespaceNotNullAndInvalidNamespaceAndNoModuleNameTest() {
-        boolean exceptionReised = false;
-        try {
-            TestUtils.normalizeCompositeNode(prepareCnSn("wrongnamespace"), modules, schemaNodePath);
-        } catch (ResponseException e) {
-            exceptionReised = true;
-        }
-        assertTrue(exceptionReised);
-    }
-
-    @Test
-    public void namespaceNullTest() {
-        String exceptionMessage = null;
-        try {
-            TestUtils.normalizeCompositeNode(prepareCnSn(null), modules, schemaNodePath);
-        } catch (ResponseException e) {
-            exceptionMessage = String.valueOf(e.getResponse().getEntity());
-        }
-        assertNull(exceptionMessage);
-    }
-
-    @Test
-    public void namespaceValidNamespaceTest() {
-        String exceptionMessage = null;
-        try {
-            TestUtils.normalizeCompositeNode(prepareCnSn("normalize:node:module"), modules, schemaNodePath);
-        } catch (ResponseException e) {
-            exceptionMessage = String.valueOf(e.getResponse().getEntity());
-        }
-        assertNull(exceptionMessage);
-    }
-
-    @Test
-    public void namespaceValidModuleNameTest() {
-        String exceptionMessage = null;
-        try {
-            TestUtils.normalizeCompositeNode(prepareCnSn("normalize-node-module"), modules, schemaNodePath);
-        } catch (ResponseException e) {
-            exceptionMessage = String.valueOf(e.getResponse().getEntity());
-        }
-        assertNull(exceptionMessage);
-    }
-
-    private CompositeNode prepareCnSn(String namespace) {
-        URI uri = null;
-        if (namespace != null) {
-            try {
-                uri = new URI(namespace);
-            } catch (URISyntaxException e) {
-            }
-            assertNotNull(uri);
-        }
-
-        SimpleNodeWrapper lf1 = new SimpleNodeWrapper(uri, "lf1", 43);
-        CompositeNodeWrapper cont = new CompositeNodeWrapper(uri, "cont");
-        cont.addValue(lf1);
-
-        return cont;
-    }
-
 }