Skip to content

Commit 6a72415

Browse files
committed
take advantage of better API to simplify test/example code
1 parent 61289ab commit 6a72415

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,8 @@ public void checkShutdownSignal(int expectedCode, IOException ioe) {
129129
checkShutdownSignal(expectedCode, sse);
130130
}
131131

132-
public void checkShutdownSignal(int expectedCode, AlreadyClosedException ace) {
133-
ShutdownNotifierComponent snc = (ShutdownNotifierComponent) ace.getReference();
134-
ShutdownSignalException sse = snc.getCloseReason();
135-
checkShutdownSignal(expectedCode, sse);
136-
}
137-
138132
public void checkShutdownSignal(int expectedCode, ShutdownSignalException sse) {
139-
Object reason = sse.getReason();
140-
Method method;
141-
if (reason instanceof Command) {
142-
method = ((Command) reason).getMethod();
143-
} else {
144-
method = (Method) reason;
145-
}
133+
Method method = sse.getReason();
146134
channel = null;
147135
if (sse.isHardError()) {
148136
connection = null;

test/src/com/rabbitmq/examples/perf/MulticastParams.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,8 @@ private static boolean exists(Connection connection, Checker checker) throws IOE
237237
}
238238
catch (IOException e) {
239239
ShutdownSignalException sse = (ShutdownSignalException) e.getCause();
240-
Command closeCommand = (Command) sse.getReason();
241240
if (!sse.isHardError()) {
242-
AMQP.Channel.Close closeMethod = (AMQP.Channel.Close) closeCommand.getMethod();
241+
AMQP.Channel.Close closeMethod = (AMQP.Channel.Close) sse.getReason();
243242
if (closeMethod.getReplyCode() == AMQP.NOT_FOUND) {
244243
return false;
245244
}

0 commit comments

Comments
 (0)