@@ -269,66 +269,57 @@ public void testNoAccess()
269269 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
270270 public void with (String _) throws IOException {
271271 noAccessCh .queueDeclare ("justaqueue" , false , false , true , null );
272- }},
273- "user noaccess should not be able to declare a queue"
272+ }}
274273 );
275274 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
276275 public void with (String _) throws IOException {
277276 noAccessCh .queueDelete ("configure" );
278277 }}
279- , "user noaccess should not be able to delete a queue"
280278 );
281279 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
282280 public void with (String _) throws IOException {
283281 noAccessCh .queueBind ("write" , "write" , "write" );
284- }},
285- "user noaccess should not be able to bind a queue"
282+ }}
286283 );
287284 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
288285 public void with (String _) throws IOException {
289286 noAccessCh .queuePurge ("read" );
290- }},
291- "user noaccess should not be able to purge a queue"
287+ }}
292288 );
293289 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
294290 public void with (String _) throws IOException {
295291 noAccessCh .exchangeDeclare ("justanexchange" , "direct" );
296- }},
297- "user noaccess should not be able to declare an exchange"
292+ }}
298293 );
299294 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
300295 public void with (String _) throws IOException {
301296 noAccessCh .exchangeDeclare ("configure" , "direct" );
302- }},
303- "user noaccess should not be able to delete an exchange"
297+ }}
304298 );
305299 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
306300 public void with (String _) throws IOException {
307301 noAccessCh .basicPublish ("write" , "" , null , "foo" .getBytes ());
308302 noAccessCh .queueDeclare ();
309- }},
310- "user noaccess should not be able to publish"
303+ }}
311304 );
312305 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
313306 public void with (String _) throws IOException {
314307 noAccessCh .basicGet ("read" , false );
315- }},
316- "user noaccess should not be able to get"
308+ }}
317309 );
318310 expectExceptionRun (AMQP .ACCESS_REFUSED , new WithName () {
319311 public void with (String _) throws IOException {
320312 noAccessCh .basicConsume ("read" , null );
321- }},
322- "user noaccess should not be able to consume"
313+ }}
323314 );
324315 }
325316
326- protected void expectExceptionRun (int exceptionCode , WithName action , String failMsg )
317+ protected void expectExceptionRun (int exceptionCode , WithName action )
327318 throws IOException
328319 {
329320 try {
330321 action .with ("" );
331- fail (failMsg );
322+ fail ();
332323 } catch (IOException e ) {
333324 noAccessCh = noAccessConn .createChannel ();
334325 checkShutdownSignal (exceptionCode , e );
0 commit comments