Skip to content

Commit 91174f7

Browse files
author
Emile Joubert
committed
Refactor
1 parent 82339f9 commit 91174f7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

test/src/com/rabbitmq/client/test/functional/ClusteredTestBase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.rabbitmq.client.Connection;
2222
import com.rabbitmq.client.ConnectionFactory;
2323
import com.rabbitmq.client.test.BrokerTestCase;
24+
import com.rabbitmq.tools.Host;
2425

2526
import java.io.IOException;
2627

@@ -121,4 +122,12 @@ public void closeConnection() throws IOException {
121122
}
122123
super.closeConnection();
123124
}
125+
126+
protected void stopSecondary() throws IOException {
127+
Host.executeCommand("cd ../rabbitmq-test; make stop-secondary-app");
128+
}
129+
130+
protected void startSecondary() throws IOException {
131+
Host.executeCommand("cd ../rabbitmq-test; make start-secondary-app");
132+
}
124133
}

test/src/com/rabbitmq/client/test/functional/DurableOnTransient.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.rabbitmq.client.GetResponse;
2323
import com.rabbitmq.client.MessageProperties;
24-
import com.rabbitmq.tools.Host;
2524

2625
public class DurableOnTransient extends ClusteredTestBase
2726
{
@@ -62,14 +61,6 @@ public void testBindDurableToTransient()
6261
assertNotNull(basicGet());
6362
}
6463

65-
private void stopSecondary() throws IOException {
66-
Host.executeCommand("cd ../rabbitmq-test; make stop-secondary-app");
67-
}
68-
69-
private void startSecondary() throws IOException {
70-
Host.executeCommand("cd ../rabbitmq-test; make start-secondary-app");
71-
}
72-
7364
public void testSemiDurableBindingRemoval() throws IOException {
7465
if (clusteredConnection != null) {
7566
declareTransientTopicExchange("x");

test/src/com/rabbitmq/client/test/server/AbsentQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public class AbsentQueue extends ClusteredTestBase {
3434
@Override protected void setUp() throws IOException {
3535
super.setUp();
3636
if (clusteredConnection != null)
37-
Host.executeCommand("cd ../rabbitmq-test; make stop-secondary-app");
37+
stopSecondary();
3838
}
3939

4040
@Override protected void tearDown() throws IOException {
4141
if (clusteredConnection != null)
42-
Host.executeCommand("cd ../rabbitmq-test; make start-secondary-app");
42+
startSecondary();
4343
super.tearDown();
4444
}
4545

0 commit comments

Comments
 (0)