mx4j/src/test/test/javax/management/remote/compliance/serialization/support OptionalRemoteComparator.java,1.1,1.2 OptionalRemoteInstantiator.java,1.2,1.3 RemoteComparator.java,1.3,1.4 RemoteInstantiator.java,1.3,1.4

Simone Bordet <[email protected]>
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/compliance/serialization/support
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30262/src/test/test/javax/management/remote/compliance/serialization/support

Modified Files:
	OptionalRemoteComparator.java OptionalRemoteInstantiator.java 
	RemoteComparator.java RemoteInstantiator.java 
Log Message:
Added copyright notice and author information

Index: OptionalRemoteComparator.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/compliance/serialization/support/OptionalRemoteComparator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** OptionalRemoteComparator.java	5 Aug 2003 14:08:56 -0000	1.1
--- OptionalRemoteComparator.java	10 Aug 2004 09:15:18 -0000	1.2
***************
*** 1,6 ****
  package test.javax.management.remote.compliance.serialization.support;
  
  /**
!  *
   * @version $Revision$
   */
--- 1,14 ----
+ /*
+  * Copyright (C) MX4J.
+  * All rights reserved.
+  *
+  * This software is distributed under the terms of the MX4J License version 1.0.
+  * See the terms of the MX4J License in the documentation provided with this software.
+  */
+ 
  package test.javax.management.remote.compliance.serialization.support;
  
  /**
!  * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
   */

Index: OptionalRemoteInstantiator.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/compliance/serialization/support/OptionalRemoteInstantiator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OptionalRemoteInstantiator.java	2 Nov 2003 15:33:48 -0000	1.2
--- OptionalRemoteInstantiator.java	10 Aug 2004 09:15:18 -0000	1.3
***************
*** 1,2 ****
--- 1,10 ----
+ /*
+  * Copyright (C) MX4J.
+  * All rights reserved.
+  *
+  * This software is distributed under the terms of the MX4J License version 1.0.
+  * See the terms of the MX4J License in the documentation provided with this software.
+  */
+ 
  package test.javax.management.remote.compliance.serialization.support;
  
***************
*** 5,9 ****
  import javax.management.remote.message.HandshakeEndMessage;
  import javax.management.remote.message.HandshakeErrorMessage;
- //import javax.management.remote.message.JMXMPMessage;
  import javax.management.remote.message.MBeanServerRequestMessage;
  import javax.management.remote.message.MBeanServerResponseMessage;
--- 13,16 ----
***************
*** 12,16 ****
  
  /**
!  *
   * @version $Revision$
   */
--- 19,23 ----
  
  /**
!  * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
   */

Index: RemoteComparator.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/compliance/serialization/support/RemoteComparator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RemoteComparator.java	28 Oct 2003 03:30:15 -0000	1.3
--- RemoteComparator.java	10 Aug 2004 09:15:18 -0000	1.4
***************
*** 1,2 ****
--- 1,10 ----
+ /*
+  * Copyright (C) MX4J.
+  * All rights reserved.
+  *
+  * This software is distributed under the terms of the MX4J License version 1.0.
+  * See the terms of the MX4J License in the documentation provided with this software.
+  */
+ 
  package test.javax.management.remote.compliance.serialization.support;
  
***************
*** 13,119 ****
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @author <a href="mailto:[email protected]">Brian Scully</a>
-  *
   * @version $Revision$
   */
  public class RemoteComparator
  {
- 	
- 	public void compareJMXConnectionNotification(Object obj1, Object obj2)
- 	{
- 		JMXConnectionNotification jcn1 = (JMXConnectionNotification)obj1;
- 		JMXConnectionNotification jcn2 = (JMXConnectionNotification)obj2;
- 		boolean valid = jcn1.getConnectionId().equals(jcn2.getConnectionId());
- 	    compareNotifications(jcn1,jcn2);
- 	    if (!valid) throw new RuntimeException();
- 	}
- 	
- 	public void compareJMXProviderException(Object obj1, Object obj2)
- 	{
- 		JMXProviderException jpe1 = (JMXProviderException)obj1;
- 		JMXProviderException jpe2 = (JMXProviderException)obj2;
- 		boolean valid = true;
- 		/*
- 		if (jpe1.getCause() != null)
- 		  valid = valid && (jpe1.getCause().equals(jpe2.getCause()));
- 		  */
- 		if (jpe1.getLocalizedMessage() != null)
- 		  valid = valid && (jpe1.getLocalizedMessage().equals(jpe2.getLocalizedMessage()));
- 		if (jpe1.getMessage() != null)
- 		  valid = valid && (jpe1.getMessage().equals(jpe2.getMessage()));
- 		  
- 		valid = valid && (jpe1.toString().equals(jpe2.toString()));
- 		if (!valid) throw new RuntimeException();
- 	}
- 	
- 	public void compareJMXServerErrorException(Object obj1, Object obj2)
- 	{
- 		JMXServerErrorException jse1 = (JMXServerErrorException)obj1;
- 		JMXServerErrorException jse2 = (JMXServerErrorException)obj2;
- 		boolean valid = true; // jse1.getCause().getClass().equals(jse2.getCause().getClass());
- 		valid = valid && (jse1.getLocalizedMessage().equals(jse2.getLocalizedMessage()));
- 		valid = valid && (jse1.getMessage().equals(jse2.getMessage()));
- 		valid = valid && (jse1.toString().equals(jse2.toString()));
- 		if (!valid) throw new RuntimeException();
- 	}
  
! 	public void compareNotificationResult(Object obj1, Object obj2)
! 	{
! 		NotificationResult nr1 = (NotificationResult)obj1;
! 		NotificationResult nr2 = (NotificationResult)obj2;
! 		boolean valid = nr1.getEarliestSequenceNumber() == nr2.getEarliestSequenceNumber();
! 		valid = valid && (nr1.getNextSequenceNumber() == nr2.getNextSequenceNumber());
! 		TargetedNotification[] tns1 = nr1.getTargetedNotifications();
! 		TargetedNotification[] tns2 = nr2.getTargetedNotifications();
! 		
! 		if (tns1.length != tns2.length)
! 		  throw new RuntimeException();
! 		  
! 		for (int i=0; i<tns1.length; i++)
! 		{
! 			compareTargetedNotification(tns1[i],tns2[i]);
! 		}
  
! 		if (!valid) throw new RuntimeException();
! 	}
  
! 	public void compareSubjectDelegationPermission(Object obj1, Object obj2)
! 	{
! 		SubjectDelegationPermission sdp1 = (SubjectDelegationPermission)obj1;
! 		SubjectDelegationPermission sdp2 = (SubjectDelegationPermission)obj2;
! 		boolean valid = sdp1.equals(sdp2);
! 		valid = valid && (sdp1.getActions().equals(sdp2.getActions()));
! 		valid = valid && (sdp1.getName().equals(sdp2.getName()));
! 		valid = valid && (sdp1.implies(sdp2));
  
! 		if (!valid) throw new RuntimeException();
! 	}
! 	
! 	public void compareTargetedNotification(Object obj1, Object obj2)
! 	{
! 		TargetedNotification tn1 = (TargetedNotification)obj1;
! 		TargetedNotification tn2 = (TargetedNotification)obj2;
! 		boolean valid = tn1.getListenerID().equals(tn2.getListenerID());
! 		compareNotifications(tn1.getNotification(),tn2.getNotification());
  
! 		if (!valid) throw new RuntimeException();
! 	}
! 	
! 	private void compareNotifications(Notification not1, Notification not2)
! 	{
! 		boolean valid = (not1.getMessage().equals(not2.getMessage()));
! 		valid = valid && (not1.getSequenceNumber() == not2.getSequenceNumber());
! 		valid = valid && (not1.getSource().equals(not2.getSource()));
! 		valid = valid && (not1.getType().equals(not2.getType()));
! 		valid = valid && (not1.getUserData().equals(not2.getUserData()));
! 		if (!valid) throw new RuntimeException();
! 	}
! 	
! 	public void compareRMIConnector(Object obj1, Object obj2)
! 	{
! 		RMIConnector rc1 = (RMIConnector)obj1;
! 		RMIConnector rc2 = (RMIConnector)obj2;
! 		boolean valid = true; // rc1.getConnectionId().equals(rc2.getConnectionId());
  
! 		if (!valid) throw new RuntimeException();
! 	}
  }
--- 21,126 ----
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @author <a href="mailto:[email protected]">Brian Scully</a>
   * @version $Revision$
   */
  public class RemoteComparator
  {
  
!    public void compareJMXConnectionNotification(Object obj1, Object obj2)
!    {
!       JMXConnectionNotification jcn1 = (JMXConnectionNotification)obj1;
!       JMXConnectionNotification jcn2 = (JMXConnectionNotification)obj2;
!       boolean valid = jcn1.getConnectionId().equals(jcn2.getConnectionId());
!       compareNotifications(jcn1, jcn2);
!       if (!valid) throw new RuntimeException();
!    }
  
!    public void compareJMXProviderException(Object obj1, Object obj2)
!    {
!       JMXProviderException jpe1 = (JMXProviderException)obj1;
!       JMXProviderException jpe2 = (JMXProviderException)obj2;
!       boolean valid = true;
!       /*
!       if (jpe1.getCause() != null)
!         valid = valid && (jpe1.getCause().equals(jpe2.getCause()));
!         */
!       if (jpe1.getLocalizedMessage() != null)
!          valid = valid && (jpe1.getLocalizedMessage().equals(jpe2.getLocalizedMessage()));
!       if (jpe1.getMessage() != null)
!          valid = valid && (jpe1.getMessage().equals(jpe2.getMessage()));
  
!       valid = valid && (jpe1.toString().equals(jpe2.toString()));
!       if (!valid) throw new RuntimeException();
!    }
  
!    public void compareJMXServerErrorException(Object obj1, Object obj2)
!    {
!       JMXServerErrorException jse1 = (JMXServerErrorException)obj1;
!       JMXServerErrorException jse2 = (JMXServerErrorException)obj2;
!       boolean valid = true; // jse1.getCause().getClass().equals(jse2.getCause().getClass());
!       valid = valid && (jse1.getLocalizedMessage().equals(jse2.getLocalizedMessage()));
!       valid = valid && (jse1.getMessage().equals(jse2.getMessage()));
!       valid = valid && (jse1.toString().equals(jse2.toString()));
!       if (!valid) throw new RuntimeException();
!    }
  
!    public void compareNotificationResult(Object obj1, Object obj2)
!    {
!       NotificationResult nr1 = (NotificationResult)obj1;
!       NotificationResult nr2 = (NotificationResult)obj2;
!       boolean valid = nr1.getEarliestSequenceNumber() == nr2.getEarliestSequenceNumber();
!       valid = valid && (nr1.getNextSequenceNumber() == nr2.getNextSequenceNumber());
!       TargetedNotification[] tns1 = nr1.getTargetedNotifications();
!       TargetedNotification[] tns2 = nr2.getTargetedNotifications();
  
!       if (tns1.length != tns2.length)
!          throw new RuntimeException();
! 
!       for (int i = 0; i < tns1.length; i++)
!       {
!          compareTargetedNotification(tns1[i], tns2[i]);
!       }
! 
!       if (!valid) throw new RuntimeException();
!    }
! 
!    public void compareSubjectDelegationPermission(Object obj1, Object obj2)
!    {
!       SubjectDelegationPermission sdp1 = (SubjectDelegationPermission)obj1;
!       SubjectDelegationPermission sdp2 = (SubjectDelegationPermission)obj2;
!       boolean valid = sdp1.equals(sdp2);
!       valid = valid && (sdp1.getActions().equals(sdp2.getActions()));
!       valid = valid && (sdp1.getName().equals(sdp2.getName()));
!       valid = valid && (sdp1.implies(sdp2));
! 
!       if (!valid) throw new RuntimeException();
!    }
! 
!    public void compareTargetedNotification(Object obj1, Object obj2)
!    {
!       TargetedNotification tn1 = (TargetedNotification)obj1;
!       TargetedNotification tn2 = (TargetedNotification)obj2;
!       boolean valid = tn1.getListenerID().equals(tn2.getListenerID());
!       compareNotifications(tn1.getNotification(), tn2.getNotification());
! 
!       if (!valid) throw new RuntimeException();
!    }
! 
!    private void compareNotifications(Notification not1, Notification not2)
!    {
!       boolean valid = (not1.getMessage().equals(not2.getMessage()));
!       valid = valid && (not1.getSequenceNumber() == not2.getSequenceNumber());
!       valid = valid && (not1.getSource().equals(not2.getSource()));
!       valid = valid && (not1.getType().equals(not2.getType()));
!       valid = valid && (not1.getUserData().equals(not2.getUserData()));
!       if (!valid) throw new RuntimeException();
!    }
! 
!    public void compareRMIConnector(Object obj1, Object obj2)
!    {
!       RMIConnector rc1 = (RMIConnector)obj1;
!       RMIConnector rc2 = (RMIConnector)obj2;
!       boolean valid = true; // rc1.getConnectionId().equals(rc2.getConnectionId());
! 
!       if (!valid) throw new RuntimeException();
!    }
  }

Index: RemoteInstantiator.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/compliance/serialization/support/RemoteInstantiator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RemoteInstantiator.java	28 Oct 2003 03:30:15 -0000	1.3
--- RemoteInstantiator.java	10 Aug 2004 09:15:18 -0000	1.4
***************
*** 1,7 ****
  package test.javax.management.remote.compliance.serialization.support;
  
  import java.net.MalformedURLException;
  import java.util.HashMap;
- 
  import javax.management.remote.JMXConnectionNotification;
  import javax.management.remote.JMXPrincipal;
--- 1,14 ----
+ /*
+  * Copyright (C) MX4J.
+  * All rights reserved.
+  *
+  * This software is distributed under the terms of the MX4J License version 1.0.
+  * See the terms of the MX4J License in the documentation provided with this software.
+  */
+ 
  package test.javax.management.remote.compliance.serialization.support;
  
  import java.net.MalformedURLException;
  import java.util.HashMap;
  import javax.management.remote.JMXConnectionNotification;
  import javax.management.remote.JMXPrincipal;
***************
*** 17,21 ****
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @author <a href="mailto:[email protected]">Brian Scully</a>
-  * 
   * @version $Revision$
   */
--- 24,27 ----
***************
*** 24,31 ****
     public JMXConnectionNotification createJMXConnectionNotification()
     {
!    	  JMXConnectionNotification jcn = new JMXConnectionNotification(
! 										JMXConnectionNotification.OPENED,
!    	  									"Source","ConnectionID",
!    	  									0L,"Message", "UserData");
        return jcn;
     }
--- 30,36 ----
     public JMXConnectionNotification createJMXConnectionNotification()
     {
!       JMXConnectionNotification jcn = new JMXConnectionNotification(JMXConnectionNotification.OPENED,
!                                                                     "Source", "ConnectionID",
!                                                                     0L, "Message", "UserData");
        return jcn;
     }
***************
*** 33,37 ****
     public JMXPrincipal createJMXPrincipal()
     {
!    	  JMXPrincipal jp = new JMXPrincipal(JMXPrincipal.class.getName());
        return jp;
     }
--- 38,42 ----
     public JMXPrincipal createJMXPrincipal()
     {
!       JMXPrincipal jp = new JMXPrincipal(JMXPrincipal.class.getName());
        return jp;
     }
***************
*** 39,43 ****
     public JMXProviderException createJMXProviderException()
     {
!    	  JMXProviderException ex = new JMXProviderException();
        return ex;
     }
--- 44,48 ----
     public JMXProviderException createJMXProviderException()
     {
!       JMXProviderException ex = new JMXProviderException();
        return ex;
     }
***************
*** 45,49 ****
     public JMXServerErrorException createJMXServerErrorException()
     {
!    	  JMXServerErrorException see = new JMXServerErrorException("Message",new Error());
        return see;
     }
--- 50,54 ----
     public JMXServerErrorException createJMXServerErrorException()
     {
!       JMXServerErrorException see = new JMXServerErrorException("Message", new Error());
        return see;
     }
***************
*** 51,76 ****
     public JMXServiceURL createJMXServiceURL()
     {
!    	 try
! 	 {
! 		JMXServiceURL jsu = new JMXServiceURL("rmi","localhost",1099);
! 		return jsu;
! 	 }
! 	 catch (MalformedURLException e)
! 	 {
! 	 	throw new RuntimeException();
! 	 }
     }
  
     public NotificationResult createNotificationResult()
     {
!    	 TargetedNotification[] notifs = 
!    	   { createTargetedNotification() };
!    	 NotificationResult result = new NotificationResult(0l,1l,notifs);
!      return result;
     }
  
     public SubjectDelegationPermission createSubjectDelegationPermission()
     {
!    	  SubjectDelegationPermission sdp = new SubjectDelegationPermission(SubjectDelegationPermission.class.getName());
        return sdp;
     }
--- 56,81 ----
     public JMXServiceURL createJMXServiceURL()
     {
!       try
!       {
!          JMXServiceURL jsu = new JMXServiceURL("rmi", "localhost", 1099);
!          return jsu;
!       }
!       catch (MalformedURLException e)
!       {
!          throw new RuntimeException();
!       }
     }
  
     public NotificationResult createNotificationResult()
     {
!       TargetedNotification[] notifs =
!               {createTargetedNotification()};
!       NotificationResult result = new NotificationResult(0l, 1l, notifs);
!       return result;
     }
  
     public SubjectDelegationPermission createSubjectDelegationPermission()
     {
!       SubjectDelegationPermission sdp = new SubjectDelegationPermission(SubjectDelegationPermission.class.getName());
        return sdp;
     }
***************
*** 78,82 ****
     public TargetedNotification createTargetedNotification()
     {
!    	  TargetedNotification tn = new TargetedNotification(createJMXConnectionNotification(), Integer.decode("1"));
        return tn;
     }
--- 83,87 ----
     public TargetedNotification createTargetedNotification()
     {
!       TargetedNotification tn = new TargetedNotification(createJMXConnectionNotification(), Integer.decode("1"));
        return tn;
     }
***************
*** 84,88 ****
     public RMIConnector createRMIConnector()
     {
!    	  RMIConnector rc = new RMIConnector(createJMXServiceURL(),new HashMap());
        return rc;
     }
--- 89,93 ----
     public RMIConnector createRMIConnector()
     {
!       RMIConnector rc = new RMIConnector(createJMXServiceURL(), new HashMap());
        return rc;
     }



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.