Merge "Changed NetconfDeviceDatastoreAdapter and NetconfDeviceTopologyAdapter to...
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / cnsn / to / json / test / CnSnToJsonIncorrectTopLevelTest.java
index 47222571b8d8d927b0a1886db6025c04e5513c02..82b700758af08e8c66939114b6de0ecdeeed1ba3 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.restconf.impl.cnsn.to.json.test;
 
 import static org.junit.Assert.assertTrue;
@@ -5,18 +12,17 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 import java.util.List;
 import java.util.Set;
-
 import javax.activation.UnsupportedDataTypeException;
 import javax.ws.rs.WebApplicationException;
-
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.StructuredDataToJsonProvider;
 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
 import org.opendaylight.controller.sal.restconf.impl.test.YangAndXmlAndDataSchemaLoader;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
@@ -26,7 +32,6 @@ import org.opendaylight.yangtools.yang.model.api.Status;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.UsesNode;
-import org.opendaylight.yangtools.yang.model.api.YangNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -84,13 +89,13 @@ public class CnSnToJsonIncorrectTopLevelTest extends YangAndXmlAndDataSchemaLoad
         }
 
         @Override
-        public DataSchemaNode getDataChildByName(QName arg0) {
+        public DataSchemaNode getDataChildByName(final QName arg0) {
             // TODO Auto-generated method stub
             return null;
         }
 
         @Override
-        public DataSchemaNode getDataChildByName(String arg0) {
+        public DataSchemaNode getDataChildByName(final String arg0) {
             // TODO Auto-generated method stub
             return null;
         }
@@ -119,6 +124,7 @@ public class CnSnToJsonIncorrectTopLevelTest extends YangAndXmlAndDataSchemaLoad
             return null;
         }
 
+        @Override
         public boolean isAddedByUses() {
             // TODO Auto-generated method stub
             return false;
@@ -139,19 +145,20 @@ public class CnSnToJsonIncorrectTopLevelTest extends YangAndXmlAndDataSchemaLoad
     }
 
     @Test
+    @Ignore
     public void incorrectTopLevelElementTest() {
 
-        CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/data.xml", XmlToCompositeNodeProvider.INSTANCE);
+        final Node<?> node = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/data.xml", XmlToCompositeNodeProvider.INSTANCE);
         DataSchemaNode incorrectDataSchema = null;
         incorrectDataSchema = new IncorrectDataSchema();
 
-        TestUtils.normalizeCompositeNode(compositeNode, modules, "simple-data-types:cont");
+        TestUtils.normalizeCompositeNode(node, modules, "simple-data-types:cont");
 
         boolean exceptionRaised = false;
         try {
-            TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, incorrectDataSchema,
+            TestUtils.writeCompNodeWithSchemaContextToOutput(node, modules, incorrectDataSchema,
                     StructuredDataToJsonProvider.INSTANCE);
-        } catch (UnsupportedDataTypeException e) {
+        } catch (final UnsupportedDataTypeException e) {
             exceptionRaised = true;
         } catch (WebApplicationException | IOException e) {
             LOG.error("WebApplicationException or IOException was raised");