This closes #2764
This commit is contained in:
commit
fa000524e1
|
@ -100,6 +100,8 @@ public class StompV11Test extends StompTestBase {
|
||||||
server.getSecurityStore().setSecurityEnabled(true);
|
server.getSecurityStore().setSecurityEnabled(true);
|
||||||
StompClientConnection connection = StompClientConnectionFactory.createClientConnection(v10Uri);
|
StompClientConnection connection = StompClientConnectionFactory.createClientConnection(v10Uri);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
connection.connect(defUser, defPass);
|
connection.connect(defUser, defPass);
|
||||||
|
|
||||||
assertTrue(connection.isConnected());
|
assertTrue(connection.isConnected());
|
||||||
|
@ -108,6 +110,8 @@ public class StompV11Test extends StompTestBase {
|
||||||
|
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
|
|
||||||
|
connection.closeTransport();
|
||||||
|
|
||||||
connection = StompClientConnectionFactory.createClientConnection(uri);
|
connection = StompClientConnectionFactory.createClientConnection(uri);
|
||||||
|
|
||||||
connection.connect(defUser, defPass);
|
connection.connect(defUser, defPass);
|
||||||
|
@ -118,6 +122,8 @@ public class StompV11Test extends StompTestBase {
|
||||||
|
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
|
|
||||||
|
connection.closeTransport();
|
||||||
|
|
||||||
connection = StompClientConnectionFactory.createClientConnection(uri);
|
connection = StompClientConnectionFactory.createClientConnection(uri);
|
||||||
|
|
||||||
connection.connect();
|
connection.connect();
|
||||||
|
@ -132,12 +138,19 @@ public class StompV11Test extends StompTestBase {
|
||||||
|
|
||||||
conn.disconnect();
|
conn.disconnect();
|
||||||
|
|
||||||
|
conn.closeTransport();
|
||||||
|
|
||||||
//invalid user
|
//invalid user
|
||||||
conn = (StompClientConnectionV11) StompClientConnectionFactory.createClientConnection(uri);
|
conn = (StompClientConnectionV11) StompClientConnectionFactory.createClientConnection(uri);
|
||||||
ClientStompFrame frame = conn.connect("invaliduser", defPass);
|
ClientStompFrame frame = conn.connect("invaliduser", defPass);
|
||||||
assertFalse(conn.isConnected());
|
assertFalse(conn.isConnected());
|
||||||
assertTrue(Stomp.Responses.ERROR.equals(frame.getCommand()));
|
assertTrue(Stomp.Responses.ERROR.equals(frame.getCommand()));
|
||||||
assertTrue(frame.getBody().contains("Security Error occurred"));
|
assertTrue(frame.getBody().contains("Security Error occurred"));
|
||||||
|
|
||||||
|
conn.closeTransport();
|
||||||
|
} finally {
|
||||||
|
connection.closeTransport();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue