Skip to content

Commit af9ed5e

Browse files
author
Matthew Sackman
committed
Simplify secondary channel
1 parent 0a52b07 commit af9ed5e

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

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

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,13 @@
3434
import java.io.IOException;
3535

3636
import com.rabbitmq.client.AMQP;
37-
import com.rabbitmq.client.Channel;
3837
import com.rabbitmq.client.test.BrokerTestCase;
3938

4039
public class ExchangeExchangeBindingsAutoDelete extends BrokerTestCase {
4140

42-
private Channel secondaryChannel = null;
43-
44-
@Override
45-
protected void createResources() throws IOException {
46-
super.createResources();
47-
maybeCreateSecondaryChannel();
48-
}
49-
50-
private void maybeCreateSecondaryChannel() throws IOException {
51-
if (null != secondaryChannel && ! secondaryChannel.isOpen()) {
52-
secondaryChannel = null;
53-
}
54-
if (null == secondaryChannel) {
55-
secondaryChannel = connection.createChannel();
56-
}
57-
}
58-
59-
@Override
60-
protected void releaseResources() throws IOException {
61-
super.releaseResources();
62-
if (null != secondaryChannel && secondaryChannel.isOpen()) {
63-
secondaryChannel.close();
64-
}
65-
}
66-
6741
private void assertExchangeNotExists(String name) throws IOException {
68-
maybeCreateSecondaryChannel();
6942
try {
70-
secondaryChannel.exchangeDeclarePassive(name);
43+
connection.createChannel().exchangeDeclarePassive(name);
7144
fail("Exchange " + name + " still exists.");
7245
} catch (IOException e) {
7346
checkShutdownSignal(AMQP.NOT_FOUND, e);

0 commit comments

Comments
 (0)