@@ -75,27 +75,22 @@ public void testRegisterNonNotificationListenerType() throws Exception {
75
75
try {
76
76
exporter .setNotificationListenerMappings (listeners );
77
77
fail ("Must have thrown a ClassCastException when registering a non-NotificationListener instance as a NotificationListener." );
78
- } catch (ClassCastException expected ) {
78
+ }
79
+ catch (ClassCastException expected ) {
79
80
}
80
81
}
81
82
82
- // Note that @Ignore has no effect for JUnit 3.8 TestCase-based tests,
83
- // but we leave it here to allow developers to easily search for ignored
84
- // tests. As a work-around, the method is prefixed with "ignore"
85
- // instead of "test" as required by JUnit 3.x.
86
- //
87
- // See: https://jira.springsource.org/browse/SPR-8091
88
- @ Ignore ("[SPR-8091] NotificationListenerBean constructor does not throw the expected IllegalArgumentException" )
89
83
@ SuppressWarnings ({ "rawtypes" , "unchecked" })
90
- public void ignoreTestRegisterNullNotificationListenerType () throws Exception {
84
+ public void testRegisterNullNotificationListenerType () throws Exception {
91
85
Map listeners = new HashMap ();
92
86
// put null in as a value...
93
87
listeners .put ("*" , null );
94
88
MBeanExporter exporter = new MBeanExporter ();
95
89
try {
96
90
exporter .setNotificationListenerMappings (listeners );
97
91
fail ("Must have thrown an IllegalArgumentException when registering a null instance as a NotificationListener." );
98
- } catch (IllegalArgumentException expected ) {
92
+ }
93
+ catch (IllegalArgumentException expected ) {
99
94
}
100
95
}
101
96
@@ -116,7 +111,8 @@ public void handleNotification(Notification notification, Object handback) {
116
111
try {
117
112
exporter .afterPropertiesSet ();
118
113
fail ("Must have thrown an MBeanExportException when registering a NotificationListener on a non-existent MBean." );
119
- } catch (MBeanExportException expected ) {
114
+ }
115
+ catch (MBeanExportException expected ) {
120
116
assertTrue (expected .contains (InstanceNotFoundException .class ));
121
117
}
122
118
}
@@ -473,7 +469,8 @@ public void testSetAutodetectModeToOutOfRangeNegativeValue() throws Exception {
473
469
MBeanExporter exporter = new MBeanExporter ();
474
470
exporter .setAutodetectMode (-1 );
475
471
fail ("Must have failed when supplying an invalid negative out-of-range autodetect mode" );
476
- } catch (IllegalArgumentException expected ) {
472
+ }
473
+ catch (IllegalArgumentException expected ) {
477
474
}
478
475
}
479
476
@@ -482,7 +479,8 @@ public void testSetAutodetectModeToOutOfRangePositiveValue() throws Exception {
482
479
MBeanExporter exporter = new MBeanExporter ();
483
480
exporter .setAutodetectMode (5 );
484
481
fail ("Must have failed when supplying an invalid positive out-of-range autodetect mode" );
485
- } catch (IllegalArgumentException expected ) {
482
+ }
483
+ catch (IllegalArgumentException expected ) {
486
484
}
487
485
}
488
486
@@ -491,7 +489,8 @@ public void testSetAutodetectModeNameToNull() throws Exception {
491
489
MBeanExporter exporter = new MBeanExporter ();
492
490
exporter .setAutodetectModeName (null );
493
491
fail ("Must have failed when supplying a null autodetect mode name" );
494
- } catch (IllegalArgumentException expected ) {
492
+ }
493
+ catch (IllegalArgumentException expected ) {
495
494
}
496
495
}
497
496
@@ -500,7 +499,8 @@ public void testSetAutodetectModeNameToAnEmptyString() throws Exception {
500
499
MBeanExporter exporter = new MBeanExporter ();
501
500
exporter .setAutodetectModeName ("" );
502
501
fail ("Must have failed when supplying an empty autodetect mode name" );
503
- } catch (IllegalArgumentException expected ) {
502
+ }
503
+ catch (IllegalArgumentException expected ) {
504
504
}
505
505
}
506
506
@@ -509,7 +509,8 @@ public void testSetAutodetectModeNameToAWhitespacedString() throws Exception {
509
509
MBeanExporter exporter = new MBeanExporter ();
510
510
exporter .setAutodetectModeName (" \t " );
511
511
fail ("Must have failed when supplying a whitespace-only autodetect mode name" );
512
- } catch (IllegalArgumentException expected ) {
512
+ }
513
+ catch (IllegalArgumentException expected ) {
513
514
}
514
515
}
515
516
@@ -518,7 +519,8 @@ public void testSetAutodetectModeNameToARubbishValue() throws Exception {
518
519
MBeanExporter exporter = new MBeanExporter ();
519
520
exporter .setAutodetectModeName ("That Hansel is... *sssooo* hot right now!" );
520
521
fail ("Must have failed when supplying a whitespace-only autodetect mode name" );
521
- } catch (IllegalArgumentException expected ) {
522
+ }
523
+ catch (IllegalArgumentException expected ) {
522
524
}
523
525
}
524
526
@@ -530,7 +532,8 @@ public void testNotRunningInBeanFactoryAndPassedBeanNameToExport() throws Except
530
532
exporter .setBeans (beans );
531
533
exporter .afterPropertiesSet ();
532
534
fail ("Expecting exception because MBeanExporter is not running in a BeanFactory and was passed bean name to (lookup and then) export" );
533
- } catch (MBeanExportException expected ) {
535
+ }
536
+ catch (MBeanExportException expected ) {
534
537
}
535
538
}
536
539
@@ -540,7 +543,8 @@ public void testNotRunningInBeanFactoryAndAutodetectionIsOn() throws Exception {
540
543
exporter .setAutodetectMode (MBeanExporter .AUTODETECT_ALL );
541
544
exporter .afterPropertiesSet ();
542
545
fail ("Expecting exception because MBeanExporter is not running in a BeanFactory and was configured to autodetect beans" );
543
- } catch (MBeanExportException expected ) {
546
+ }
547
+ catch (MBeanExportException expected ) {
544
548
}
545
549
}
546
550
@@ -634,7 +638,8 @@ public void testMBeanIsUnregisteredForRuntimeExceptionDuringInitialization() thr
634
638
try {
635
639
exporter .afterPropertiesSet ();
636
640
fail ("Must have failed during creation of RuntimeExceptionThrowingConstructorBean" );
637
- } catch (RuntimeException expected ) {
641
+ }
642
+ catch (RuntimeException expected ) {
638
643
}
639
644
640
645
assertIsNotRegistered ("Must have unregistered all previously registered MBeans due to RuntimeException" ,
0 commit comments