2fe0d5173cacce09349663f0505bd28b4edb38cd
[transportpce.git] / tests / honeynode / 1.2.1 / netconf-impl / src / test / java / org / opendaylight / netconf / impl / ExiEncodeDecodeTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.impl;
9
10 import static org.junit.Assert.assertNotNull;
11
12 import org.junit.Test;
13 import org.opendaylight.netconf.api.NetconfMessage;
14 import org.opendaylight.netconf.util.test.XmlFileLoader;
15
16 public class ExiEncodeDecodeTest {
17     @Test
18     public void encodeExi() throws Exception {
19
20         String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml");
21         assertNotNull(startExiString);
22
23         NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml"));
24         assertNotNull(startExiMessage);
25
26         /*
27         ExiParameters exiParams = new ExiParameters();
28         exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument()
29         .getDocumentElement()));
30         assertNotNull(exiParams);
31
32         ByteBuf encodedBuf = Unpooled.buffer();
33         ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes());
34         ExiUtil.encode(sourceBuf, encodedBuf, exiParams);
35
36         List<Object> newOut = new ArrayList<Object>();
37         ExiUtil.decode(encodedBuf, newOut, exiParams);
38
39         ByteBuf decodedBuf = (ByteBuf)newOut.get(0);
40         String decodedString = new String(decodedBuf.array(),"UTF-8");
41         assertNotNull(decodedString);
42         */
43     }
44 }