geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/remoting/src/test/org/apache/geronimo/remoting JMXRemotingTestMain.java
Date Fri, 23 Jan 2004 01:23:26 GMT
dain        2004/01/22 17:23:26

  Modified:    modules/remoting project.xml
               modules/remoting/src/test/org/apache/geronimo/remoting
                        JMXRemotingTestMain.java
  Log:
  Removed unused dependencies
  
  Revision  Changes    Path
  1.4       +7 -8      incubator-geronimo/modules/remoting/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/remoting/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	22 Jan 2004 06:39:23 -0000	1.3
  +++ project.xml	23 Jan 2004 01:23:26 -0000	1.4
  @@ -12,10 +12,11 @@
   
       <name>Geronimo :: Remoting</name>
       <id>geronimo-remoting</id>
  -    <shortDescription></shortDescription>
  -    <description></description>
  -    <siteDirectory></siteDirectory>
  -    <distributionDirectory></distributionDirectory>
  +    <shortDescription>Geronimo Remoting</shortDescription>
  +    <description>Geronimo Remoting</description>
  +    <url>http://incubator.apache.org/projects/geronimo/remoting/</url>
  +    <siteDirectory>/www/incubator.apache.org/projects/geronimo/remoting</siteDirectory>
  +    <distributionDirectory>/www/incubator.apache.org/projects/geronimo/builds/remoting</distributionDirectory>
   
       <package>org.apache.geronimo.remoting</package>
       <currentVersion>DEV</currentVersion>
  @@ -27,9 +28,8 @@
   
       <dependencies>
   
  -        <!-- Plugin Dependencies -->
  -
           <!-- Module Dependencies -->
  +
           <dependency>
               <groupId>geronimo</groupId>
               <artifactId>geronimo-common</artifactId>
  @@ -101,7 +101,6 @@
               </properties>
           </dependency>
       </dependencies>
  -
   
       <build>
           <unitTest>
  
  
  
  1.6       +22 -26    incubator-geronimo/modules/remoting/src/test/org/apache/geronimo/remoting/JMXRemotingTestMain.java
  
  Index: JMXRemotingTestMain.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/remoting/src/test/org/apache/geronimo/remoting/JMXRemotingTestMain.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JMXRemotingTestMain.java	24 Nov 2003 05:12:17 -0000	1.5
  +++ JMXRemotingTestMain.java	23 Jan 2004 01:23:26 -0000	1.6
  @@ -56,16 +56,14 @@
   
   package org.apache.geronimo.remoting;
   
  -import java.rmi.Remote;
   import java.io.Serializable;
  -
  +import java.rmi.Remote;
   import javax.management.MBeanServer;
   import javax.management.Notification;
  +import javax.management.NotificationFilter;
   import javax.management.NotificationListener;
   import javax.management.ObjectName;
  -import javax.management.NotificationFilter;
   
  -import org.apache.geronimo.kernel.jmx.JMXUtil;
   import org.apache.geronimo.kernel.deployment.client.DeploymentNotification;
   import org.apache.geronimo.remoting.jmx.RemoteMBeanServerFactory;
   
  @@ -82,53 +80,51 @@
    */
   public class JMXRemotingTestMain {
   
  -    Latch eventLatch = new Latch(); 
  -    
  +    Latch eventLatch = new Latch();
  +
       public void XtestCheckClassLoaders() throws Exception {
           MBeanServer server = RemoteMBeanServerFactory.create("localhost");
           String[] strings = server.getDomains();
  -        for(int i=0; i < strings.length; i++){
  -            System.out.println("domain: "+strings[i]);
  +        for (int i = 0; i < strings.length; i++) {
  +            System.out.println("domain: " + strings[i]);
           }
       }
  -    
  +
       class MyListner implements NotificationListener, Remote {
           private int lookingForID = -1;
   
  -        /**
  -         * @see javax.management.NotificationListener#handleNotification(javax.management.Notification,
java.lang.Object)
  -         */
           public void handleNotification(Notification not, Object handback) {
  -            if(not instanceof DeploymentNotification) {
  -                int id = ((DeploymentNotification)not).getDeploymentID();
  -                if(lookingForID == -1) {
  +            if (not instanceof DeploymentNotification) {
  +                int id = ((DeploymentNotification) not).getDeploymentID();
  +                if (lookingForID == -1) {
                       lookingForID = id;
                   } else {
  -                    if(id != lookingForID) {
  -                        System.err.println("FAILED: should not get notification for ID
"+id+" (expecting "+lookingForID+")");
  +                    if (id != lookingForID) {
  +                        System.err.println("FAILED: should not get notification for ID
" + id + " (expecting " + lookingForID + ")");
                           return;
                       }
                   }
               }
  -            System.out.println("Got notification: "+not.getType());
  +            System.out.println("Got notification: " + not.getType());
               eventLatch.release();
           }
  -        
  +
       }
   
       static class MyFilter implements NotificationFilter, Serializable {
           public boolean isNotificationEnabled(Notification notification) {
  -            System.err.println("Filtering a notification: "+notification.getType());
  +            System.err.println("Filtering a notification: " + notification.getType());
               return true;
           }
  -        
  +
           public int hashCode() {
               return 1;
           }
  +
           public boolean equals(Object obj) {
  -            if( obj == null )
  +            if (obj == null)
                   return false;
  -            if( obj.getClass() != getClass() )
  +            if (obj.getClass() != getClass())
                   return false;
               return true;
           }
  @@ -137,15 +133,15 @@
       public void testNotificationListner() throws Exception {
           System.out.println("adding listner..");
           MBeanServer server = RemoteMBeanServerFactory.create("localhost");
  -        ObjectName name = JMXUtil.getObjectName("geronimo.deployment:role=DeploymentController");
  +        ObjectName name = ObjectName.getInstance("geronimo.deployment:role=DeploymentController");
           MyListner listner = new MyListner();
           MyFilter filter = new MyFilter();
  -        server.addNotificationListener(name,listner,filter,null);
  +        server.addNotificationListener(name, listner, filter, null);
           eventLatch.acquire();
           System.out.println("Event received.");
           server.removeNotificationListener(name, listner, filter, null);
           System.out.println("Notifications removed.");
  -        Thread.sleep(1000*60);
  +        Thread.sleep(1000 * 60);
       }
   
       public static void main(String[] args) throws Exception {
  
  
  

Mime
View raw message