Remove unneeded StompConnection instance from the test.
This commit is contained in:
Timothy Bish 2015-05-19 18:02:45 -04:00
parent a7a3c78fd9
commit aedf4ea5ff
1 changed files with 26 additions and 40 deletions

View File

@ -40,11 +40,10 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
enum TestType {FRAME_MAX_GREATER_THAN_HEADER_MAX, FRAME_MAX_LESS_THAN_HEADER_MAX, FRAME_MAX_LESS_THAN_ACTION_MAX};
//set max data size higher than max frame size so that max frame size gets tested
// set max data size higher than max frame size so that max frame size gets tested
private static final int MAX_DATA_SIZE = 100 * 1024;
private StompConnection connection;
private TestType testType;
private int maxFrameSize;
private final TestType testType;
private final int maxFrameSize;
/**
* This defines the different possible max header sizes for this test.
@ -52,11 +51,11 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
@Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {
//The maximum size exceeds the default max header size of 10 * 1024
// The maximum size exceeds the default max header size of 10 * 1024
{TestType.FRAME_MAX_GREATER_THAN_HEADER_MAX, 64 * 1024},
//The maximum size is less than the default max header size of 10 * 1024
// The maximum size is less than the default max header size of 10 * 1024
{TestType.FRAME_MAX_LESS_THAN_HEADER_MAX, 5 * 1024},
//The maximum size is less than the default max action size of 1024
// The maximum size is less than the default max action size of 1024
{TestType.FRAME_MAX_LESS_THAN_ACTION_MAX, 512}
});
}
@ -77,16 +76,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
super.setUp();
}
@Override
public void tearDown() throws Exception {
if (connection != null) {
try {
connection.close();
} catch (Throwable ex) {}
}
super.tearDown();
}
@Override
protected void addStompConnector() throws Exception {
TransportConnector connector = null;
@ -134,7 +123,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
doOversizedTestMessage(nioSslPort, true, maxFrameSize + 100);
}
/**
* These tests should cause a Stomp error because even though the body size is less than max frame size,
* the action and headers plus data size should cause a max frame size failure
@ -163,7 +151,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
doOversizedTestMessage(nioSslPort, true, maxFrameSize - 50);
}
/**
* These tests will test a successful Stomp message when the total size is than max frame size
*/
@ -249,7 +236,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
doTestOversizedHeaders(nioSslPort, true);
}
protected void doTestOversizedAction(int port, boolean useSsl) throws Exception {
initializeStomp(port, useSsl);