X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Fcnsn%2Fto%2Fjson%2Ftest%2FCnSnToJsonIncorrectTopLevelTest.java;h=66f442ce6f3ca0e24edde1980a22955eeb7857af;hp=050a9925ff3f7f767af0c371ef651d2d3e0ba7a5;hb=783679071e01620bfc468cb9f9472f2a1030ae00;hpb=6fd408a04fe4a3611843e2246ece6d7c34b76903 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonIncorrectTopLevelTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonIncorrectTopLevelTest.java index 050a9925ff..66f442ce6f 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonIncorrectTopLevelTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonIncorrectTopLevelTest.java @@ -7,23 +7,11 @@ */ package org.opendaylight.controller.sal.restconf.impl.cnsn.to.json.test; -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.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.model.api.ConstraintDefinition; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; @@ -90,13 +78,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; } @@ -125,6 +113,7 @@ public class CnSnToJsonIncorrectTopLevelTest extends YangAndXmlAndDataSchemaLoad return null; } + @Override public boolean isAddedByUses() { // TODO Auto-generated method stub return false; @@ -144,26 +133,4 @@ public class CnSnToJsonIncorrectTopLevelTest extends YangAndXmlAndDataSchemaLoad } - @Test - public void incorrectTopLevelElementTest() { - - CompositeNode compositeNode = 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"); - - boolean exceptionRaised = false; - try { - TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, incorrectDataSchema, - StructuredDataToJsonProvider.INSTANCE); - } catch (UnsupportedDataTypeException e) { - exceptionRaised = true; - } catch (WebApplicationException | IOException e) { - LOG.error("WebApplicationException or IOException was raised"); - } - - assertTrue(exceptionRaised); - } - }