mirror of https://github.com/apache/activemq.git
Remove unneeded StompConnection instance from the test.
This commit is contained in:
parent
a7a3c78fd9
commit
aedf4ea5ff
|
@ -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};
|
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 static final int MAX_DATA_SIZE = 100 * 1024;
|
||||||
private StompConnection connection;
|
private final TestType testType;
|
||||||
private TestType testType;
|
private final int maxFrameSize;
|
||||||
private int maxFrameSize;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This defines the different possible max header sizes for this test.
|
* This defines the different possible max header sizes for this test.
|
||||||
|
@ -52,11 +51,11 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
|
||||||
@Parameters
|
@Parameters
|
||||||
public static Collection<Object[]> data() {
|
public static Collection<Object[]> data() {
|
||||||
return Arrays.asList(new Object[][] {
|
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},
|
{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},
|
{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}
|
{TestType.FRAME_MAX_LESS_THAN_ACTION_MAX, 512}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -77,16 +76,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tearDown() throws Exception {
|
|
||||||
if (connection != null) {
|
|
||||||
try {
|
|
||||||
connection.close();
|
|
||||||
} catch (Throwable ex) {}
|
|
||||||
}
|
|
||||||
super.tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addStompConnector() throws Exception {
|
protected void addStompConnector() throws Exception {
|
||||||
TransportConnector connector = null;
|
TransportConnector connector = null;
|
||||||
|
@ -134,7 +123,6 @@ public class StompMaxFrameSizeTest extends StompTestSupport {
|
||||||
doOversizedTestMessage(nioSslPort, true, maxFrameSize + 100);
|
doOversizedTestMessage(nioSslPort, true, maxFrameSize + 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These tests should cause a Stomp error because even though the body size is less than max frame size,
|
* 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
|
* 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);
|
doOversizedTestMessage(nioSslPort, true, maxFrameSize - 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These tests will test a successful Stomp message when the total size is than max frame size
|
* 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);
|
doTestOversizedHeaders(nioSslPort, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void doTestOversizedAction(int port, boolean useSsl) throws Exception {
|
protected void doTestOversizedAction(int port, boolean useSsl) throws Exception {
|
||||||
initializeStomp(port, useSsl);
|
initializeStomp(port, useSsl);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue