Skip to content

Commit

Permalink
NO-JIRA remove unused SmokeTestBase#waitForServerToStart
Browse files Browse the repository at this point in the history
  • Loading branch information
amarkevich authored and clebertsuconic committed Jul 19, 2023
1 parent c8d685e commit 671f48f
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
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.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.util.ServerUtil;
import org.junit.After;
Expand Down Expand Up @@ -158,24 +156,6 @@ protected static final void recreateBrokerDirectory(final String homeInstance) {
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 {
Assert.assertTrue(logFile.exists());
boolean hasRecord = false;
Expand Down

0 comments on commit 671f48f

Please sign in to comment.