Skip to content

Commit 1587a94

Browse files
author
David R. MacIver
committed
openChannel seems to work fine now, and there's no reason the previous code shoudl be expected to work except that it happened to use to
1 parent 5aba22b commit 1587a94

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/src/com/rabbitmq/client/test/ChannelNumberAllocationTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public void testManualAllocationDoesntBreakThings() throws Exception{
7777

7878
public void testReuseManuallyAllocatedChannelNumber() throws Exception{
7979
connection.createChannel(1).close();
80-
assertNotNull(connection.createChannel(1));
80+
Channel ch = connection.createChannel(1);
81+
assertNotNull(ch);
82+
ch.close();
83+
84+
for(int repeat = 0; repeat < 3; repeat++){
85+
Channel[] channels = new Channel[8];
86+
for(int i = 1; i <= channels.length; i++)
87+
assertNotNull(channels[i-1] = connection.createChannel(i));
88+
for(Channel ch2 : channels) ch2.close();
89+
}
8190
}
8291
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ protected void runTest(boolean exp, String name, WithName test)
285285
assertEquals(msg,
286286
AMQP.ACCESS_REFUSED,
287287
((AMQP.Channel.Close)m).getReplyCode());
288-
//This fails due to bug 20296
289-
//openChannel();
290-
channel = connection.createChannel(channel.getChannelNumber() + 1);
288+
openChannel();
291289
}
292290
}
293291

0 commit comments

Comments
 (0)