Skip to content

Commit

Permalink
Try to fix the tests again...
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrybig committed Aug 15, 2017
1 parent a5dc1af commit 8988c46
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -62,21 +62,22 @@ protected TeamspeakBootstrap creatBootstrap() {
}

protected Future<TeamspeakConnection> createConnection() {
return createConnection("TestingBot-" + getClass().getSimpleName());
return createConnection("TestingBot-" + getClass().getSimpleName().hashCode() % 200);
}

protected Future<TeamspeakConnection> createConnection(String clientname) {
String hostname = System.getProperty("teamspeak3.hostname", "");
if (hostname.isEmpty()) {
hostname = "localhost";
hostname = "127.0.0.1";
}
int port = Integer.parseInt(System.getProperty("teamspeak3.port", "").isEmpty()
? String.valueOf(TeamspeakBootstrap.DEFAULT_QUERY_PORT)
: System.getProperty("teamspeak3.port"));
return creatBootstrap().clientName(clientname).connect(hostname, port);
}

protected void assumeConnectionWorking(Future<TeamspeakConnection>... cons)
@SafeVarargs
protected final void assumeConnectionWorking(Future<TeamspeakConnection>... cons)
throws InterruptedException {
if (Boolean.valueOf(System.getProperty("teamspeak3.required"))) {
return;
Expand Down

0 comments on commit 8988c46

Please sign in to comment.