Delete netconf
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / MultipleEqualNamesForDataNodesTest.java
index 42131026a5218cdb59079cc2324059930e816dd6..8c017341e9e39b1f213b5ceebb11f983912fec9f 100644 (file)
@@ -7,78 +7,13 @@
  */
 package org.opendaylight.controller.sal.restconf.impl.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.ext.MessageBodyReader;
-import org.junit.Test;
-import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider;
-import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
-import org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.controller.sal.restconf.impl.RestconfError;
-import org.opendaylight.controller.sal.restconf.impl.RestconfError.ErrorTag;
-import org.opendaylight.controller.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.model.api.Module;
 
 /**
- * If more then one data element with equal name exists where container or
- * leaf schema node should be present the RestconfDocumentedException has to
- * be raised
+ * If more then one data element with equal name exists where container or leaf schema node should be present the
+ * RestconfDocumentedException has to be raised
  *
  * Tests for BUG 1204
  */
 public class MultipleEqualNamesForDataNodesTest {
 
-    @Test
-    public void multipleEqualNameDataNodeTestForContainerJsonTest() {
-        multipleEqualNameDataNodeTest("/equal-data-node-names/equal-name-data-for-container.json", ErrorType.APPLICATION,
-                ErrorTag.BAD_ELEMENT,JsonToCompositeNodeProvider.INSTANCE);
-    }
-
-    @Test
-    public void multipleEqualNameDataNodeTestForLeafJsonTest() {
-        multipleEqualNameDataNodeTest("/equal-data-node-names/equal-name-data-for-leaf.json", ErrorType.PROTOCOL,
-                ErrorTag.MALFORMED_MESSAGE,JsonToCompositeNodeProvider.INSTANCE);
-    }
-
-    @Test
-    public void multipleEqualNameDataNodeTestForContainerXmlTest() {
-        multipleEqualNameDataNodeTest("/equal-data-node-names/equal-name-data-for-container.xml", ErrorType.APPLICATION,
-                ErrorTag.BAD_ELEMENT,XmlToCompositeNodeProvider.INSTANCE);
-    }
-
-    @Test
-    public void multipleEqualNameDataNodeTestForLeafXmlTest() {
-        multipleEqualNameDataNodeTest("/equal-data-node-names/equal-name-data-for-leaf.xml", ErrorType.APPLICATION,
-                ErrorTag.BAD_ELEMENT,XmlToCompositeNodeProvider.INSTANCE);
-    }
-
-    private void multipleEqualNameDataNodeTest(String path, ErrorType errorType, ErrorTag errorTag,MessageBodyReader<CompositeNode> messageBodyReader) {
-        try {
-            CompositeNode compositeNode = TestUtils.readInputToCnSn(path, false,messageBodyReader);
-            assertNotNull(compositeNode);
-
-            Set<Module> modules = null;
-            modules = TestUtils.loadModulesFrom("/equal-data-node-names/yang");
-            assertNotNull(modules);
-
-            TestUtils.normalizeCompositeNode(compositeNode, modules, "equal-data-node-names" + ":" + "cont");
-            fail("Exception RestconfDocumentedException should be raised");
-        } catch (RestconfDocumentedException e) {
-            List<RestconfError> errors = e.getErrors();
-            assertNotNull(errors);
-
-            assertEquals(1, errors.size());
-
-            RestconfError restconfError = errors.get(0);
-
-            assertEquals(errorType, restconfError.getErrorType());
-            assertEquals(errorTag, restconfError.getErrorTag());
-        }
-    }
-
 }