X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fcore%2FTlsDetectorTest.java;h=32685846379c857d69a1967ec5eb3c163764b5e5;hb=0d942e8fb70b2c21f97eea3ed8904336ab5c54a4;hp=f0d941160d408e8f3aa49d6207beedc944559548;hpb=537927d0952c74dd362ede53fbbed7db8d53fc7b;p=openflowjava.git diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TlsDetectorTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TlsDetectorTest.java index f0d94116..32685846 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TlsDetectorTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TlsDetectorTest.java @@ -1,44 +1,51 @@ -/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */ -package org.opendaylight.openflowjava.protocol.impl.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES; - -/** - * - * @author michal.polkorab - */ -public class TlsDetectorTest { - - private EmbeddedChannel embch; - - /** - * Sets up test environment - */ - @Before - public void setUp() { - TlsDetector tlsDetector = new TlsDetector(); - embch = new EmbeddedChannel(new DummyDecoder()); - embch.pipeline().addFirst(TcpHandler.COMPONENT_NAMES.TLS_DETECTOR.name(), tlsDetector); - } - - /** - * Test of decode {@link TlsDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List) } - * @throws Exception - */ - @Test - public void testDecodeNotEncryptedMessage() throws Exception { - byte[] msgs = new byte[]{0x04, 0x0, 0x0, 0x08, 0x0, 0x0, 0x0, 0x01}; - ByteBuf writeObj = embch.alloc().buffer(64); - writeObj.writeBytes(msgs); - embch.writeInbound(writeObj); - - Assert.assertNull(embch.pipeline().get(COMPONENT_NAMES.TLS_DETECTOR.name())); - Assert.assertNull(embch.pipeline().get(COMPONENT_NAMES.SSL_HANDLER.name())); - } +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.core; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.embedded.EmbeddedChannel; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES; + +/** + * + * @author michal.polkorab + */ +public class TlsDetectorTest { + + private EmbeddedChannel embch; + + /** + * Sets up test environment + */ + @Before + public void setUp() { + TlsDetector tlsDetector = new TlsDetector(); + embch = new EmbeddedChannel(new DummyDecoder()); + embch.pipeline().addFirst(TcpHandler.COMPONENT_NAMES.TLS_DETECTOR.name(), tlsDetector); + } + + /** + * Test of decode {@link TlsDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List) } + * @throws Exception + */ + @Test + public void testDecodeNotEncryptedMessage() throws Exception { + byte[] msgs = new byte[]{0x04, 0x0, 0x0, 0x08, 0x0, 0x0, 0x0, 0x01}; + ByteBuf writeObj = embch.alloc().buffer(64); + writeObj.writeBytes(msgs); + embch.writeInbound(writeObj); + + Assert.assertNull(embch.pipeline().get(COMPONENT_NAMES.TLS_DETECTOR.name())); + Assert.assertNull(embch.pipeline().get(COMPONENT_NAMES.SSL_HANDLER.name())); + } } \ No newline at end of file