Skip to content

Commit 75042ec

Browse files
Update more tests to explicitly delete queues
See dae7b13 for background.
1 parent 6a6b26c commit 75042ec

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,38 @@
3939
public class CcRoutes extends BrokerTestCase {
4040

4141
static private final String[] queues = new String[]{"queue1", "queue2", "queue3"};
42-
protected final String exDirect = "direct_cc_exchange";
43-
protected final String exTopic = "topic_cc_exchange";
44-
protected BasicProperties.Builder propsBuilder;
42+
private final String exDirect = "direct_cc_exchange";
43+
private final String exTopic = "topic_cc_exchange";
44+
private BasicProperties.Builder propsBuilder;
4545
protected Map<String, Object> headers;
46-
protected List<String> ccList;
47-
protected List<String> bccList;
46+
private List<String> ccList;
47+
private List<String> bccList;
4848

4949
@Override public void setUp() throws IOException, TimeoutException {
5050
super.setUp();
5151
propsBuilder = new BasicProperties.Builder();
52-
headers = new HashMap<String, Object>();
53-
ccList = new ArrayList<String>();
54-
bccList = new ArrayList<String>();
52+
headers = new HashMap<>();
53+
ccList = new ArrayList<>();
54+
bccList = new ArrayList<>();
5555
}
5656

5757
@Override protected void createResources() throws IOException, TimeoutException {
5858
super.createResources();
5959
for (String q : queues) {
60-
channel.queueDeclare(q, false, true, true, null);
60+
channel.queueDeclare(q, false, false, true, null);
6161
}
6262
channel.exchangeDeclare(exDirect, "direct", false, true, null);
6363
channel.exchangeDeclare(exTopic, "topic", false, true, null);
6464
}
6565

66+
@Override
67+
protected void releaseResources() throws IOException {
68+
super.releaseResources();
69+
for (String q : queues) {
70+
channel.queueDelete(q);
71+
}
72+
}
73+
6674
@Test public void ccList() throws IOException {
6775
ccList.add("queue2");
6876
ccList.add("queue3");

0 commit comments

Comments
 (0)