mx4j/src/test/test/javax/management/remote JMXNotificationsTestCase.java,1.9,1.10

Simone Bordet <[email protected]> Mon, 10 Jan 2005 21:51:07 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1268/src/test/test/javax/management/remote

Modified Files:
	JMXNotificationsTestCase.java 
Log Message:
Cosmetics

Index: JMXNotificationsTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXNotificationsTestCase.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** JMXNotificationsTestCase.java	13 Nov 2004 16:38:50 -0000	1.9
--- JMXNotificationsTestCase.java	10 Jan 2005 21:51:04 -0000	1.10
***************
*** 12,15 ****
--- 12,16 ----
  import java.net.MalformedURLException;
  import java.util.Map;
+ 
  import javax.management.MBeanServer;
  import javax.management.MBeanServerConnection;
***************
*** 76,89 ****
           JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
  
!          Notification notification = (Notification)holder.get();
           if (!(notification instanceof JMXConnectionNotification)) fail();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntorServer != null) cntorServer.stop();
--- 77,88 ----
           JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
  
!          Notification notification = (Notification) holder.get();
           if (!(notification instanceof JMXConnectionNotification)) fail();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntorServer != null) cntorServer.stop();
***************
*** 113,126 ****
           cntor.close();
  
!          Notification notification = (Notification)holder.get();
           if (!(notification instanceof JMXConnectionNotification)) fail();
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntorServer != null) cntorServer.stop();
--- 112,123 ----
           cntor.close();
  
!          Notification notification = (Notification) holder.get();
           if (!(notification instanceof JMXConnectionNotification)) fail();
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntorServer != null) cntorServer.stop();
***************
*** 152,164 ****
           cntor.connect(getEnvironment());
  
!          JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 149,159 ----
           cntor.connect(getEnvironment());
  
!          JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 192,204 ****
           cntor.close();
  
!          JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 187,197 ----
           cntor.close();
  
!          JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 235,248 ****
           cntor.connect(clientEnv);
  
!          JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
           holder.set(null);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           cntorServer.stop();
--- 228,239 ----
           cntor.connect(clientEnv);
  
!          JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
           holder.set(null);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           cntorServer.stop();
***************
*** 253,257 ****
        sleep((retries * 3) * period);
  
!       JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
        assertNotNull(notification);
        assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
--- 244,248 ----
        sleep((retries * 3) * period);
  
!       JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
        assertNotNull(notification);
        assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
***************
*** 295,299 ****
           sleep(1000);
  
!          Notification notification = (Notification)holder.get();
           assertEquals(notification.getType(), MBeanServerNotification.REGISTRATION_NOTIFICATION);
           holder.set(null);
--- 286,290 ----
           sleep(1000);
  
!          Notification notification = (Notification) holder.get();
           assertEquals(notification.getType(), MBeanServerNotification.REGISTRATION_NOTIFICATION);
           holder.set(null);
***************
*** 305,318 ****
           sleep(1000);
  
!          notification = (Notification)holder.get();
           assertEquals(notification.getType(), MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
           holder.set(null);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 296,307 ----
           sleep(1000);
  
!          notification = (Notification) holder.get();
           assertEquals(notification.getType(), MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
           holder.set(null);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 375,386 ****
           assertNull(plainNotification.get());
           assertNotNull(connectionNotification.get());
!          assertEquals(((Notification)connectionNotification.get()).getType(), JMXConnectionNotification.NOTIFS_LOST);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 364,373 ----
           assertNull(plainNotification.get());
           assertNotNull(connectionNotification.get());
!          assertEquals(((Notification) connectionNotification.get()).getType(), JMXConnectionNotification.NOTIFS_LOST);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 428,433 ****
              }, null);
              fail();
!          }
!          catch (IOException x)
           {
           }
--- 415,419 ----
              }, null);
              fail();
!          } catch (IOException x)
           {
           }
***************
*** 438,443 ****
              mbsc.addNotificationListener(emitterName, listenerName, null, new Object());
              fail();
!          }
!          catch (IOException x)
           {
           }
--- 424,428 ----
              mbsc.addNotificationListener(emitterName, listenerName, null, new Object());
              fail();
!          } catch (IOException x)
           {
           }
***************
*** 454,459 ****
              }, new Object());
              fail();
!          }
!          catch (IOException x)
           {
           }
--- 439,443 ----
              }, new Object());
              fail();
!          } catch (IOException x)
           {
           }
***************
*** 495,502 ****
           // Be sure we got it
           assertEquals(handbackHolder.get(), handback);
!          Notification emitted = (Notification)notificationHolder.get();
           assertNotNull(emitted);
           if (!(notification instanceof MBeanServerNotification)) fail();
!          assertEquals(((MBeanServerNotification)emitted).getMBeanName(), name);
           notificationHolder.set(null);
           handbackHolder.set(null);
--- 479,486 ----
           // Be sure we got it
           assertEquals(handbackHolder.get(), handback);
!          Notification emitted = (Notification) notificationHolder.get();
           assertNotNull(emitted);
           if (!(notification instanceof MBeanServerNotification)) fail();
!          assertEquals(((MBeanServerNotification) emitted).getMBeanName(), name);
           notificationHolder.set(null);
           handbackHolder.set(null);
***************
*** 512,522 ****
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 496,504 ----
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 585,589 ****
           // Be sure we got the notification
           assertNull(handbackHolder.get());
!          Notification emitted = (Notification)notificationHolder.get();
           assertNotNull(emitted);
           notificationHolder.set(null);
--- 567,571 ----
           // Be sure we got the notification
           assertNull(handbackHolder.get());
!          Notification emitted = (Notification) notificationHolder.get();
           assertNotNull(emitted);
           notificationHolder.set(null);
***************
*** 600,610 ****
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 582,590 ----
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 654,658 ****
           // Be sure we got the notification
           assertSame(handbackHolder.get(), handback);
!          Notification emitted = (Notification)notificationHolder.get();
           assertNotNull(emitted);
           notificationHolder.set(null);
--- 634,638 ----
           // Be sure we got the notification
           assertSame(handbackHolder.get(), handback);
!          Notification emitted = (Notification) notificationHolder.get();
           assertNotNull(emitted);
           notificationHolder.set(null);
***************
*** 669,679 ****
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 649,657 ----
           assertNull(notificationHolder.get());
           assertNull(handbackHolder.get());
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 780,790 ****
           assertEquals(counter1.get(), 0);
           assertEquals(counter2.get(), 0);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 758,766 ----
           assertEquals(counter1.get(), 0);
           assertEquals(counter2.get(), 0);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();
***************
*** 844,854 ****
           // Be sure no listeners anymore
           assertEquals(counter.get(), 1);
!       }
!       catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       }
!       finally
        {
           if (cntor != null) cntor.close();
--- 820,828 ----
           // Be sure no listeners anymore
           assertEquals(counter.get(), 1);
!       } catch (Exception x)
        {
           x.printStackTrace();
           throw x;
!       } finally
        {
           if (cntor != null) cntor.close();



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt