codec-socks test cleanup
Motivation: The unit tests in codec-socks contained redundant casts and empty test classes. Modifications: - Remove redundant casts - Delete empty test classes Result: Cleanup
This commit is contained in:
parent
075190f711
commit
5386c851c8
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 The Netty Project
|
|
||||||
*
|
|
||||||
* The Netty Project licenses this file to you under the Apache License,
|
|
||||||
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at:
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package io.netty.handler.codec.socksx.v4;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class Socks4CmdRequestTest {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Socks4CmdRequestTest.class);
|
|
||||||
}
|
|
@ -33,7 +33,7 @@ public class Socks4CmdResponseDecoderTest {
|
|||||||
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
||||||
Socks4CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
Socks4CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
||||||
|
|
||||||
msg = (Socks4Response) embedder.readInbound();
|
msg = embedder.readInbound();
|
||||||
assertEquals(((Socks4CmdResponse) msg).cmdStatus(), cmdStatus);
|
assertEquals(((Socks4CmdResponse) msg).cmdStatus(), cmdStatus);
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
assertEquals(((Socks4CmdResponse) msg).host(), host);
|
assertEquals(((Socks4CmdResponse) msg).host(), host);
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 The Netty Project
|
|
||||||
*
|
|
||||||
* The Netty Project licenses this file to you under the Apache License,
|
|
||||||
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at:
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package io.netty.handler.codec.socksx.v4;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class Socks4CmdResponseTest {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Socks4CmdResponseTest.class);
|
|
||||||
}
|
|
@ -30,7 +30,7 @@ public class Socks5AuthRequestDecoderTest {
|
|||||||
Socks5AuthRequestDecoder decoder = new Socks5AuthRequestDecoder();
|
Socks5AuthRequestDecoder decoder = new Socks5AuthRequestDecoder();
|
||||||
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
||||||
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
||||||
msg = (Socks5AuthRequest) embedder.readInbound();
|
msg = embedder.readInbound();
|
||||||
assertEquals(msg.username(), username);
|
assertEquals(msg.username(), username);
|
||||||
assertEquals(msg.username(), password);
|
assertEquals(msg.username(), password);
|
||||||
assertNull(embedder.readInbound());
|
assertNull(embedder.readInbound());
|
||||||
|
@ -32,7 +32,7 @@ public class Socks5AuthResponseDecoderTest {
|
|||||||
Socks5AuthResponseDecoder decoder = new Socks5AuthResponseDecoder();
|
Socks5AuthResponseDecoder decoder = new Socks5AuthResponseDecoder();
|
||||||
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
|
||||||
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
|
||||||
msg = (Socks5AuthResponse) embedder.readInbound();
|
msg = embedder.readInbound();
|
||||||
assertSame(msg.authStatus(), authStatus);
|
assertSame(msg.authStatus(), authStatus);
|
||||||
assertNull(embedder.readInbound());
|
assertNull(embedder.readInbound());
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class Socks5CmdRequestDecoderTest {
|
|||||||
if (msg.addressType() == Socks5AddressType.UNKNOWN) {
|
if (msg.addressType() == Socks5AddressType.UNKNOWN) {
|
||||||
assertTrue(embedder.readInbound() instanceof UnknownSocks5Request);
|
assertTrue(embedder.readInbound() instanceof UnknownSocks5Request);
|
||||||
} else {
|
} else {
|
||||||
msg = (Socks5CmdRequest) embedder.readInbound();
|
msg = embedder.readInbound();
|
||||||
assertSame(msg.cmdType(), cmdType);
|
assertSame(msg.cmdType(), cmdType);
|
||||||
assertSame(msg.addressType(), addressType);
|
assertSame(msg.addressType(), addressType);
|
||||||
assertEquals(msg.host(), host);
|
assertEquals(msg.host(), host);
|
||||||
|
@ -35,7 +35,7 @@ public class Socks5CmdResponseDecoderTest {
|
|||||||
if (addressType == Socks5AddressType.UNKNOWN) {
|
if (addressType == Socks5AddressType.UNKNOWN) {
|
||||||
assertTrue(embedder.readInbound() instanceof UnknownSocks5Response);
|
assertTrue(embedder.readInbound() instanceof UnknownSocks5Response);
|
||||||
} else {
|
} else {
|
||||||
msg = (Socks5Response) embedder.readInbound();
|
msg = embedder.readInbound();
|
||||||
assertEquals(((Socks5CmdResponse) msg).cmdStatus(), cmdStatus);
|
assertEquals(((Socks5CmdResponse) msg).cmdStatus(), cmdStatus);
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
assertEquals(((Socks5CmdResponse) msg).host(), host);
|
assertEquals(((Socks5CmdResponse) msg).host(), host);
|
||||||
|
Loading…
Reference in New Issue
Block a user