Skip to content

Commit

Permalink
Fix test method references
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry McQueary committed Oct 30, 2016
1 parent eb04ca5 commit 2d108c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/test/java/io/nats/stan/PublisherTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.nats.stan;

import static io.nats.stan.UnitTestUtilities.runDefaultServer;
import static io.nats.stan.UnitTestUtilities.runServer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -58,7 +58,7 @@ public void testPublisherStringArraySync() throws Exception {
String[] args = new String[argList.size()];
args = argList.toArray(args);

try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(clusterId)) {
new Publisher(args).run();
}
}
Expand All @@ -74,7 +74,7 @@ public void testPublisherStringArrayAsync() throws Exception {
String[] args = new String[argList.size()];
args = argList.toArray(args);

try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(clusterId)) {
new Publisher(args).run();
}
}
Expand Down Expand Up @@ -125,14 +125,14 @@ public void testParseArgsNotEnoughArgs() {

@Test(expected = IllegalArgumentException.class)
public void testMainFails() throws Exception {
try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(clusterId)) {
Publisher.main(new String[] { "foobar" });
}
}

@Test
public void testMainSuccess() throws Exception {
try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(clusterId)) {
Publisher.main(new String[] { "-c", clusterId, "foo", "bar" });
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/io/nats/stan/StanBenchTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.nats.stan;

import static io.nats.stan.UnitTestUtilities.runDefaultServer;
import static io.nats.stan.UnitTestUtilities.runServer;
import static io.nats.stan.UnitTestUtilities.testClusterName;
import static org.junit.Assert.fail;

import io.nats.client.NUID;
Expand Down Expand Up @@ -48,7 +49,7 @@ public void tearDown() throws Exception {}

@Test
public void testStanBenchStringArray() {
try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(testClusterName)) {
final String urls = "nats://localhost:4222";
final String clientId = NUID.nextGlobal();
final String clusterId = "my_test_cluster";
Expand Down Expand Up @@ -98,7 +99,7 @@ public void testStanBenchStringArray() {

@Test
public void testStanBenchProperties() {
try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(testClusterName)) {
Properties props = new Properties();
String client = NUID.nextGlobal();
props.setProperty("bench.stan.servers", "nats://localhost:4222");
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/io/nats/stan/SubscriberTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.nats.stan;

import static io.nats.stan.UnitTestUtilities.runDefaultServer;
import static io.nats.stan.UnitTestUtilities.runServer;
import static io.nats.stan.UnitTestUtilities.testClusterName;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -114,7 +115,7 @@ public void testParseArgsNotEnoughArgs() {

@Test(timeout = 5000)
public void testMainSuccess() throws Exception {
try (StanServer srv = runDefaultServer()) {
try (StanServer srv = runServer(testClusterName)) {
Publisher.main(new String[] { "-c", clusterId, "foo", "bar" });
Subscriber.main(new String[] { "-c", clusterId, "--all", "--count", "1", "foo" });
}
Expand Down
8 changes: 0 additions & 8 deletions src/test/java/io/nats/stan/UnitTestUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,6 @@ static boolean await(CountDownLatch latch, long timeout, TimeUnit unit) {
return val;
}

// static StanServer runDefaultServer() {
// return runServer(testClusterName, false);
// }
//
// static StanServer runDefaultServer(boolean debug) {
// return runServer(testClusterName, debug);
// }

static StanServer runServer(String clusterId) {
return runServer(clusterId, false);
}
Expand Down

0 comments on commit 2d108c8

Please sign in to comment.