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:
Norman Maurer 2014-08-20 06:53:37 +02:00
parent 5b3b48409f
commit 56fd33df23
7 changed files with 5 additions and 51 deletions

View File

@ -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);
}

View File

@ -33,7 +33,7 @@ public class Socks4CmdResponseDecoderTest {
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
Socks4CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
msg = (Socks4Response) embedder.readInbound();
msg = embedder.readInbound();
assertEquals(((Socks4CmdResponse) msg).cmdStatus(), cmdStatus);
if (host != null) {
assertEquals(((Socks4CmdResponse) msg).host(), host);

View File

@ -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);
}

View File

@ -30,7 +30,7 @@ public class Socks5AuthRequestDecoderTest {
Socks5AuthRequestDecoder decoder = new Socks5AuthRequestDecoder();
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
msg = (Socks5AuthRequest) embedder.readInbound();
msg = embedder.readInbound();
assertEquals(msg.username(), username);
assertEquals(msg.username(), password);
assertNull(embedder.readInbound());

View File

@ -32,7 +32,7 @@ public class Socks5AuthResponseDecoderTest {
Socks5AuthResponseDecoder decoder = new Socks5AuthResponseDecoder();
EmbeddedChannel embedder = new EmbeddedChannel(decoder);
Socks5CommonTestUtils.writeMessageIntoEmbedder(embedder, msg);
msg = (Socks5AuthResponse) embedder.readInbound();
msg = embedder.readInbound();
assertSame(msg.authStatus(), authStatus);
assertNull(embedder.readInbound());
}

View File

@ -39,7 +39,7 @@ public class Socks5CmdRequestDecoderTest {
if (msg.addressType() == Socks5AddressType.UNKNOWN) {
assertTrue(embedder.readInbound() instanceof UnknownSocks5Request);
} else {
msg = (Socks5CmdRequest) embedder.readInbound();
msg = embedder.readInbound();
assertSame(msg.cmdType(), cmdType);
assertSame(msg.addressType(), addressType);
assertEquals(msg.host(), host);

View File

@ -35,7 +35,7 @@ public class Socks5CmdResponseDecoderTest {
if (addressType == Socks5AddressType.UNKNOWN) {
assertTrue(embedder.readInbound() instanceof UnknownSocks5Response);
} else {
msg = (Socks5Response) embedder.readInbound();
msg = embedder.readInbound();
assertEquals(((Socks5CmdResponse) msg).cmdStatus(), cmdStatus);
if (host != null) {
assertEquals(((Socks5CmdResponse) msg).host(), host);