|
39 | 39 | public class CcRoutes extends BrokerTestCase { |
40 | 40 |
|
41 | 41 | 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; |
45 | 45 | 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; |
48 | 48 |
|
49 | 49 | @Override public void setUp() throws IOException, TimeoutException { |
50 | 50 | super.setUp(); |
51 | 51 | 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<>(); |
55 | 55 | } |
56 | 56 |
|
57 | 57 | @Override protected void createResources() throws IOException, TimeoutException { |
58 | 58 | super.createResources(); |
59 | 59 | for (String q : queues) { |
60 | | - channel.queueDeclare(q, false, true, true, null); |
| 60 | + channel.queueDeclare(q, false, false, true, null); |
61 | 61 | } |
62 | 62 | channel.exchangeDeclare(exDirect, "direct", false, true, null); |
63 | 63 | channel.exchangeDeclare(exTopic, "topic", false, true, null); |
64 | 64 | } |
65 | 65 |
|
| 66 | + @Override |
| 67 | + protected void releaseResources() throws IOException { |
| 68 | + super.releaseResources(); |
| 69 | + for (String q : queues) { |
| 70 | + channel.queueDelete(q); |
| 71 | + } |
| 72 | + } |
| 73 | + |
66 | 74 | @Test public void ccList() throws IOException { |
67 | 75 | ccList.add("queue2"); |
68 | 76 | ccList.add("queue3"); |
|
0 commit comments