NO-JIRA remove unused SmokeTestBase#waitForServerToStart
This commit is contained in:
parent
c8d685ee87
commit
671f48fb31
|
@ -30,9 +30,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
|
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
|
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
|
||||||
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
|
|
||||||
import org.apache.activemq.artemis.cli.commands.Stop;
|
import org.apache.activemq.artemis.cli.commands.Stop;
|
||||||
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
|
||||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||||
import org.apache.activemq.artemis.util.ServerUtil;
|
import org.apache.activemq.artemis.util.ServerUtil;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
@ -158,24 +156,6 @@ public class SmokeTestBase extends ActiveMQTestBase {
|
||||||
recreateDirectory(homeInstance + "/log");
|
recreateDirectory(homeInstance + "/log");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean waitForServerToStart(String uri, String username, String password, long timeout) throws InterruptedException {
|
|
||||||
long realTimeout = System.currentTimeMillis() + timeout;
|
|
||||||
while (System.currentTimeMillis() < realTimeout) {
|
|
||||||
try (ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactory(uri, null)) {
|
|
||||||
cf.createConnection(username, password).close();
|
|
||||||
System.out.println("server " + uri + " started");
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.out.println("awaiting server " + uri + " start at ");
|
|
||||||
Thread.sleep(500);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void checkLogRecord(File logFile, boolean exist, String... values) throws Exception {
|
protected void checkLogRecord(File logFile, boolean exist, String... values) throws Exception {
|
||||||
Assert.assertTrue(logFile.exists());
|
Assert.assertTrue(logFile.exists());
|
||||||
boolean hasRecord = false;
|
boolean hasRecord = false;
|
||||||
|
|
Loading…
Reference in New Issue