58c6566d91dfb7b86230e6fcd48cfd3f12d12912
[controller.git] / opendaylight / netconf / netconf-impl / src / test / java / org / opendaylight / controller / 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.controller.netconf.impl;
9
10 import static junit.framework.Assert.assertNotNull;
11
12 import org.junit.Test;
13 import org.opendaylight.controller.netconf.api.NetconfMessage;
14 import org.opendaylight.controller.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().getDocumentElement()));
29         assertNotNull(exiParams);
30
31         ByteBuf encodedBuf = Unpooled.buffer();
32         ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes());
33         ExiUtil.encode(sourceBuf, encodedBuf, exiParams);
34
35         List<Object> newOut = new ArrayList<Object>();
36         ExiUtil.decode(encodedBuf, newOut, exiParams);
37
38         ByteBuf decodedBuf = (ByteBuf)newOut.get(0);
39         String decodedString = new String(decodedBuf.array(),"UTF-8");
40         assertNotNull(decodedString);
41         */
42     }
43 }