import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
+import org.opendaylight.netconf.api.xml.XmlUtil;
public class NetconfHelloMessageToXMLEncoderTest {
@Test
public void testEncode() throws Exception {
- final NetconfMessage msg = new NetconfHelloMessage(XmlUtil.readXmlToDocument("<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"),
+ final NetconfMessage msg = new NetconfHelloMessage(XmlUtil.readXmlToDocument(
+ "<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"),
NetconfHelloMessageAdditionalHeader.fromString("[tomas;10.0.0.0:10000;tcp;client;]"));
final ByteBuf destination = Unpooled.buffer();
new NetconfHelloMessageToXMLEncoder().encode(ctx, msg, destination);
@Test
public void testEncodeNoHeader() throws Exception {
- final NetconfMessage msg = new NetconfHelloMessage(XmlUtil.readXmlToDocument("<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"));
+ final NetconfMessage msg = new NetconfHelloMessage(XmlUtil.readXmlToDocument(
+ "<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"));
final ByteBuf destination = Unpooled.buffer();
new NetconfHelloMessageToXMLEncoder().encode(ctx, msg, destination);
@Test(expected = IllegalStateException.class)
public void testEncodeNotHello() throws Exception {
- final NetconfMessage msg = new NetconfMessage(XmlUtil.readXmlToDocument("<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"));
+ final NetconfMessage msg = new NetconfMessage(XmlUtil.readXmlToDocument(
+ "<hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"/>"));
new NetconfHelloMessageToXMLEncoder().encode(ctx, msg, null);
}
-}
\ No newline at end of file
+}