X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2FExiEncodeDecodeTest.java;h=58c6566d91dfb7b86230e6fcd48cfd3f12d12912;hp=d7beb5df9b4393eb4e88b8e1ba7f4e42ea9c01e7;hb=9c9d6e69da3aff2d0576d8c15ea0fa0692595b6d;hpb=7974eb6a8ede81ed2593fe3fb5cda65cee51ee5d diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java index d7beb5df9b..58c6566d91 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java @@ -1,43 +1,43 @@ -/* - * Copyright (c) 2013 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.netconf.impl; - -import static junit.framework.Assert.assertNotNull; - -import org.junit.Test; -import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.test.XmlFileLoader; - -public class ExiEncodeDecodeTest { - @Test - public void encodeExi() throws Exception{ - - String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml"); - assertNotNull(startExiString); - - NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml")); - assertNotNull(startExiMessage); - - /* - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument().getDocumentElement())); - assertNotNull(exiParams); - - ByteBuf encodedBuf = Unpooled.buffer(); - ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes()); - ExiUtil.encode(sourceBuf, encodedBuf, exiParams); - - List newOut = new ArrayList(); - ExiUtil.decode(encodedBuf, newOut, exiParams); - - ByteBuf decodedBuf = (ByteBuf)newOut.get(0); - String decodedString = new String(decodedBuf.array(),"UTF-8"); - assertNotNull(decodedString); - */ - } -} +/* + * Copyright (c) 2013 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.netconf.impl; + +import static junit.framework.Assert.assertNotNull; + +import org.junit.Test; +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.test.XmlFileLoader; + +public class ExiEncodeDecodeTest { + @Test + public void encodeExi() throws Exception{ + + String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml"); + assertNotNull(startExiString); + + NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml")); + assertNotNull(startExiMessage); + + /* + ExiParameters exiParams = new ExiParameters(); + exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument().getDocumentElement())); + assertNotNull(exiParams); + + ByteBuf encodedBuf = Unpooled.buffer(); + ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes()); + ExiUtil.encode(sourceBuf, encodedBuf, exiParams); + + List newOut = new ArrayList(); + ExiUtil.decode(encodedBuf, newOut, exiParams); + + ByteBuf decodedBuf = (ByteBuf)newOut.get(0); + String decodedString = new String(decodedBuf.array(),"UTF-8"); + assertNotNull(decodedString); + */ + } +}