mirror of https://github.com/apache/activemq.git
Ensure all resources shut down.
This commit is contained in:
parent
3aec42db4f
commit
9b017fdb39
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.apache.activemq.transport.ws;
|
package org.apache.activemq.transport.ws;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
@ -47,8 +49,6 @@ import org.openqa.selenium.firefox.FirefoxProfile;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
public class WSTransportTest {
|
public class WSTransportTest {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(WSTransportTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(WSTransportTest.class);
|
||||||
|
@ -137,13 +137,21 @@ public class WSTransportTest {
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
// Some tests explicitly disconnect from stomp so can ignore
|
// Some tests explicitly disconnect from stomp so can ignore
|
||||||
} finally {
|
} finally {
|
||||||
|
try {
|
||||||
stopBroker();
|
stopBroker();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.warn("Error on Broker stop.");
|
||||||
|
}
|
||||||
if (driver != null) {
|
if (driver != null) {
|
||||||
|
try {
|
||||||
driver.quit();
|
driver.quit();
|
||||||
|
} catch (Exception e) {}
|
||||||
driver = null;
|
driver = null;
|
||||||
}
|
}
|
||||||
if (server != null) {
|
if (server != null) {
|
||||||
|
try {
|
||||||
server.stop();
|
server.stop();
|
||||||
|
} catch (Exception e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,6 +258,7 @@ public class WSTransportTest {
|
||||||
|
|
||||||
assertTrue("Should have disconnected", Wait.waitFor(new Wait.Condition() {
|
assertTrue("Should have disconnected", Wait.waitFor(new Wait.Condition() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSatisified() throws Exception {
|
public boolean isSatisified() throws Exception {
|
||||||
return webStatus.getText().equals("Disconnected");
|
return webStatus.getText().equals("Disconnected");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue