harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r406944 [27/30] - in /incubator/harmony/enhanced/classlib/trunk/modules/rmi2: ./ build/ doc/ doc/testing/ doc/testing/rmi http tunneling/ doc/testing/rmi http tunneling/Results - ITC/ doc/testing/rmi http tunneling/Results - SUN/ doc/testin...
Date Tue, 16 May 2006 13:52:07 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/TestUnicastRemoteObject.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/TestUnicastRemoteObject.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/TestUnicastRemoteObject.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/TestUnicastRemoteObject.java Tue May 16 06:51:00 2006
@@ -0,0 +1,1364 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server;
+
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.server.RMISocketFactory;
+import java.rmi.server.RemoteObject;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.RemoteStub;
+import java.rmi.server.UnicastRemoteObject;
+
+import ar.org.fitc.test.rmi.object2test.Echo;
+// import ar.org.fitc.test.rmi.object2test.EchoActivatable_Imp;
+import ar.org.fitc.test.rmi.object2test.EchoUnicast_Imp;
+// import ar.org.fitc.test.rmi.object2test.EchoWithStubActivatable_Imp;
+import ar.org.fitc.test.rmi.object2test.EchoWithStubUnicast_Imp;
+import ar.org.fitc.test.rmi.object2test.EchoWithStub_Imp;
+import ar.org.fitc.test.rmi.object2test.Echo_Imp;
+
+public class TestUnicastRemoteObject extends TestRemoteServer {
+
+    static boolean justDo = false;
+
+    private class MyUnicastRemoteObject extends UnicastRemoteObject implements
+            Cloneable {
+        private static final long serialVersionUID = 1L;
+
+        public MyUnicastRemoteObject(boolean b) throws RemoteException {
+            super();
+            if (b)
+                this.ref = null;
+        }
+
+        public MyUnicastRemoteObject(RemoteRef r) throws RemoteException {
+            super();
+            this.ref = r;
+        }
+
+        public void nullRef() {
+            ref = null;
+        }
+    }
+
+    public RemoteObject constructor() {
+        try {
+            return new MyUnicastRemoteObject(true);
+        } catch (RemoteException e) {
+            fail("Couldn't create an UnicastRemoteObject");
+            return null;
+        }
+    }
+
+    public RemoteObject constructor(RemoteRef r) {
+        try {
+            return new MyUnicastRemoteObject(r);
+        } catch (RemoteException e) {
+            fail("Couldn't create an UnicastRemoteObject");
+            return null;
+        }
+    }
+
+    public synchronized void testToStub002() {
+        // This test can't be done for UnicastRemoteObject
+    }
+
+    /*
+     * Test method for 'java.rmi.server.UnicastRemoteObject.clone()'
+     */
+
+    /**
+     * This test instance an object that extends UnicasRemoteObject and
+     * implements clonable without ref. Checks that this object is not the same
+     * as its clone.
+     */
+    public void testClone001() {
+        try {
+            MyUnicastRemoteObject uro = new MyUnicastRemoteObject(false);
+            assertNotSame("A clone not is the same object", uro, uro.clone());
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /**
+     * This test instance an object that extends UnicasRemoteObject and
+     * implements clonable without ref. Checks that this object is not equal as
+     * its clone.
+     */
+    public void testClone002() {
+        try {
+            MyUnicastRemoteObject uro = new MyUnicastRemoteObject(false);
+            assertFalse("A clone is not equal", uro.equals(uro.clone()));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /**
+     * This test instance an object that extends UnicasRemoteObject and
+     * implements clonable. Checks that this object is not the same as its
+     * clone.
+     */
+    public void testClone003() {
+        try {
+            MyUnicastRemoteObject uro = new MyUnicastRemoteObject(true);
+            assertNotSame("A clone not is the same object", uro, uro.clone());
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /**
+     * This test instance an object that extends UnicasRemoteObject and
+     * implements clonable. Checks that this object is not equal as its clone.
+     */
+    public void testClone004() {
+        try {
+            MyUnicastRemoteObject uro = new MyUnicastRemoteObject(true);
+            assertFalse("A clone is not equal", uro.equals(uro.clone()));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /**
+     * This test instance an object that extends UnicasRemoteObject and does not
+     * implements clonable. if a clone is called, CloneNotSupportedException is
+     * thrown.
+     */
+    public void testClone005() {
+        try {
+            UnicastRemoteObject uro = new EchoUnicast_Imp();
+            uro.clone();
+            fail("clone not supported, this class does not implements Clonable");
+        } catch (CloneNotSupportedException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /*
+     * Test method for
+     * 'java.rmi.server.UnicastRemoteObject.exportObject(Remote)'
+     */
+
+    public void testExportObjectRemote001() {
+        try {
+            UnicastRemoteObject.exportObject(new Echo_Imp());
+            fail("There isn't stub");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote002() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp());
+            fail("There isn't stub and object has just exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote003() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoWithStubUnicast_Imp());
+            fail("object has been exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote004() {
+        try {
+            UnicastRemoteObject.exportObject(null);
+            fail("null shoud throw an exception");
+        } catch (RemoteException e) {
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote005() {
+        try {
+            Echo e = new EchoWithStub_Imp();
+            RemoteStub rs = UnicastRemoteObject.exportObject(e);
+            assertTrue("Must be an implementation of Echo", rs instanceof Echo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote006() {
+        try {
+            Echo e = new EchoWithStub_Imp();
+            RemoteStub rs = UnicastRemoteObject.exportObject(e);
+            assertNotSame("Stub is not the object", rs, e);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote007() {
+        try {
+            Echo e = new EchoWithStub_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            justDo = false;
+            Remote r = UnicastRemoteObject.exportObject(e);
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just done", true, justDo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemote008() {
+        try {
+            Echo e = new EchoWithStubUnicast_Imp();
+            UnicastRemoteObject.exportObject(e);
+            UnicastRemoteObject.exportObject(e);
+            fail("Non export object who has just exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    // /**
+    // * Exports an EchoActivatable object.
+    // * This methods finishes with RemoteException,
+    // * because there is not a stub and the object has just been exported
+    // *
+    // */
+    //  
+    // public void testExportObjectRemote009() {
+    // try{
+    // UnicastRemoteObject.exportObject(new EchoActivatable_Imp());
+    // fail("There isn't stub and object has just exported");
+    // } catch (RemoteException e) {
+    // } catch (Throwable e) {
+    // e.printStackTrace();
+    // fail("Failed with:" + e);
+    // }
+    // }
+
+    // /**
+    // * Exports an EchoWithStubActivatable object.
+    // * This methods finishes with RemoteException,
+    // * because the object has just been exported.
+    // *
+    // */
+    // public void testExportObjectRemote010() {
+    // try{
+    // UnicastRemoteObject.exportObject(new EchoWithStubActivatable_Imp());
+    // fail("object has just been exported");
+    // } catch (RemoteException e) {
+    // } catch (Throwable e) {
+    // fail("Failed with:" + e);
+    // }
+    // }
+
+    /*
+     * Test method for 'java.rmi.server.UnicastRemoteObject.exportObject(Remote,
+     * int)'
+     */
+
+    public void testExportObjectRemoteInt001() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100);
+            assertTrue("The remote return is an instance of Echo",
+                    r instanceof Echo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt002() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), 1100);
+            fail("Non export object who has just been exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt003() {
+        try {
+            UnicastRemoteObject.exportObject(null, 1100);
+            fail("null make throws an exception");
+        } catch (RuntimeException e) {
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt004() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100);
+            assertNotSame("Stub is not the object", r, e);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt005() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is done yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100);
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt006() {
+        try {
+            justDo = false;
+            Echo e = new EchoWithStub_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is done it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100);
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+            justDo = false;
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", r, RemoteObject
+                    .toStub(e));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt007() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, -1100);
+            fail("Port should not be negative");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt008() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), -111);
+            fail("Or an exported object must raise an exception, or a negative port must raise an exception");
+        } catch (RemoteException e) {
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt009() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 80);
+            fail("Port is already in use, wait to permission denied");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteInt010() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 60340345);
+            fail("port is to big, must be out of range");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    // /**
+    // * Exports an EchoActivatable object form the port 1100.
+    // * This method finishes with RemoteException,
+    // * because the object has just been exported.
+    // *
+    // */
+    // public void testExportObjectRemoteInt011() {
+    // try{
+    // UnicastRemoteObject.exportObject(new EchoActivatable_Imp(),1100);
+    // fail("Non exportObject who has just been exported");
+    // } catch (RemoteException e) {
+    // } catch (Throwable e) {
+    // fail("Failed with:" + e);
+    // }
+    // }
+
+    // /**
+    // * Exports an EchoWithStubActivatable object form the port 1100.
+    // * This method finishes with RemoteException,
+    // * because the object has just been exported.
+    // *
+    // */
+    // public void testExportObjectRemoteInt012() {
+    // try{
+    // UnicastRemoteObject.exportObject(new EchoWithStubActivatable_Imp(),1100);
+    // fail("Non exportObject who has just been exported");
+    // } catch (RemoteException e) {
+    // } catch (Throwable e) {
+    // fail("Failed with:" + e);
+    // }
+    // }
+
+    /**
+     * Export a EchoWithStubUnicast object form the port 1100. This methods
+     * finishes with RemoteException, because the object has just exported.
+     * 
+     */
+    public void testExportObjectRemoteInt013() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoWithStubUnicast_Imp(),
+                    1100);
+            fail("Non export object who has just exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /*
+     * Test method for 'java.rmi.server.UnicastRemoteObject.exportObject(Remote,
+     * int, RMIClientSocketFactory, RMIServerSocketFactory)'
+     */
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory001() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            assertTrue("The remote object returned is an instance of Echo",
+                    r instanceof Echo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory002() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), 1100,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            fail("Non export object who has just been exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory003() {
+        try {
+            UnicastRemoteObject.exportObject(null, 1100, RMISocketFactory
+                    .getSocketFactory(), RMISocketFactory.getSocketFactory());
+            fail("null make throw an exception");
+        } catch (RuntimeException e) {
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory004() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory005() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is done it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory006() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is done it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+            justDo = false;
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", r, RemoteObject
+                    .toStub(e));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory007() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, -1100, RMISocketFactory
+                    .getSocketFactory(), RMISocketFactory.getSocketFactory());
+            fail("port shoud not be negative");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory008() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), -111,
+                    RMISocketFactory.getSocketFactory(), RMISocketFactory
+                            .getSocketFactory());
+            fail("Or object exported must raise an exception, or negative port must raise an exception");
+        } catch (RemoteException e) {
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory009() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 80, RMISocketFactory
+                    .getSocketFactory(), RMISocketFactory.getSocketFactory());
+            fail("Port already in use, permission denied");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory010() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 60340345, RMISocketFactory
+                    .getSocketFactory(), RMISocketFactory.getSocketFactory());
+            fail("port is to big, must be out of range");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory011() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 60340345, RMISocketFactory
+                    .getSocketFactory(), null);
+            fail("port is to big, must be out of range");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory012() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), null);
+            assertTrue("The remote return is an instance of Echo",
+                    r instanceof Echo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory013() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), 1100,
+                    RMISocketFactory.getSocketFactory(), null);
+            fail("Non export object who has just exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory014() {
+        try {
+            UnicastRemoteObject.exportObject(null, 1100, RMISocketFactory
+                    .getSocketFactory(), null);
+            fail("null make throws an exception");
+        } catch (RuntimeException e) {
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory015() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), null);
+            assertNotSame("Stub is not the object", r, e);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory016() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is do it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), null);
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just done", true, justDo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory017() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is do it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100,
+                    RMISocketFactory.getSocketFactory(), null);
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+            justDo = false;
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", r, RemoteObject
+                    .toStub(e));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory018() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, -1100, RMISocketFactory
+                    .getSocketFactory(), null);
+            fail("Non negative number may be a port");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory019() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), -111,
+                    RMISocketFactory.getSocketFactory(), null);
+            fail("Or object exported must raise a exception, or negative port must raise a exception");
+        } catch (RemoteException e) {
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory020() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 80, RMISocketFactory
+                    .getSocketFactory(), null);
+            fail("Port already in use, wait to permission denied");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory021() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 60340345, null,
+                    RMISocketFactory.getSocketFactory());
+            fail("to big port, must be out of range");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory022() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100, null,
+                    RMISocketFactory.getSocketFactory());
+            assertTrue("The remote return is instance of Echo",
+                    r instanceof Echo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory023() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), 1100, null,
+                    RMISocketFactory.getSocketFactory());
+            fail("Non export object who has just exported");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory024() {
+        try {
+            UnicastRemoteObject.exportObject(null, 1100, null, RMISocketFactory
+                    .getSocketFactory());
+            fail("null make throw a exception");
+        } catch (RuntimeException e) {
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory025() {
+        try {
+            Echo e = new Echo_Imp();
+            Remote r = UnicastRemoteObject.exportObject(e, 1100, null,
+                    RMISocketFactory.getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory026() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is do it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100, null,
+                    RMISocketFactory.getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory027() {
+        try {
+            justDo = false;
+            Echo e = new Echo_Imp() {
+                public String echo(String msg) {
+                    justDo = true;
+                    return Echo_Imp.class + " - Have said: " + msg;
+                }
+            };
+            assertEquals("Non work is do it yet", false, justDo);
+            Remote r = UnicastRemoteObject.exportObject(e, 1100, null,
+                    RMISocketFactory.getSocketFactory());
+            assertNotSame("Stub is not the object", r, e);
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", true, justDo);
+            justDo = false;
+            ((Echo) r).echo("hi");
+            assertEquals("Same work has just been done", r, RemoteObject
+                    .toStub(e));
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory028() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, -1100, null, RMISocketFactory
+                    .getSocketFactory());
+            fail("port should not be negative");
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory029() {
+        try {
+            UnicastRemoteObject.exportObject(new EchoUnicast_Imp(), -111, null,
+                    RMISocketFactory.getSocketFactory());
+            fail("Or object exported must raise an exception, or negative port must raise an exception");
+        } catch (RemoteException e) {
+        } catch (RuntimeException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    public void testExportObjectRemoteIntRMIClientSocketFactoryRMIServerSocketFactory030() {
+        try {
+            Echo e = new Echo_Imp();
+            UnicastRemoteObject.exportObject(e, 80, null, RMISocketFactory
+                    .getSocketFactory());
+            fail("Port already in use, wait to permission denied");
+        } catch (RemoteException e) {
+        } catch (Throwable e) {
+            fail("Failed with:" + e);
+        }
+    }
+
+    /*
+     * Test method for
+     * 'java.rmi.server.UnicastRemoteObject.unexportObject(Remote, boolean)'
+     */
+
+    /**
+     * Unexport a Echo without force. This methods finishes with
+     * NoSuchObjectException, because the object has not exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean001() {
+        Echo e = new Echo_Imp();
+        try {
+            UnicastRemoteObject.unexportObject(e, false);
+            fail("The object is not exported ");
+        } catch (NoSuchObjectException ex) {
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+
+    }
+
+    /**
+     * Unexport a Echo with stub without force. This methods finishes with
+     * NoSuchObjectException, because the object has not exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean002() throws RemoteException {
+        Echo e = new EchoWithStub_Imp();
+        try {
+            UnicastRemoteObject.unexportObject(e, false);
+            fail("The object is not exported ");
+        } catch (NoSuchObjectException ex) {
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+
+    }
+
+    /**
+     * Unexport a Echo extends UnicastRemoteObject without force. This methods
+     * finishes normally, and the object has not exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean003() throws RemoteException {
+        Echo e = new EchoUnicast_Imp();
+        try {
+            assertTrue("The object can't unexport", UnicastRemoteObject
+                    .unexportObject(e, false));
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+    }
+
+    /**
+     * Unexport a Echo extends UnicastRemoteObject with stub without force. This
+     * methods finishes normally, and the object has not exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean004() throws RemoteException {
+        Echo e = new EchoWithStubUnicast_Imp();
+        try {
+            assertTrue("The object can't unexport", UnicastRemoteObject
+                    .unexportObject(e, false));
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+    }
+
+    // /**
+    // * Unexport an Echo extends Activatable without force.
+    // * This methods finishes normally,
+    // * and the object has not exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean005() throws IOException {
+    // Echo e = new EchoActivatable_Imp();
+    // try {
+    // assertTrue("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(e,false));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // try {
+    // RemoteObject.toStub(e);
+    // fail("The object is not exported any more");
+    // } catch (NoSuchObjectException ex) {
+    // }
+    // }
+
+    // /**
+    // * Unexport an Echo extends Activatable with stub without force.
+    // * This methods finishes normally,
+    // * and the object has not exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean006() throws IOException {
+    // Echo e = new EchoWithStubActivatable_Imp();
+    // try {
+    // assertTrue("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(e,false));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // try {
+    // RemoteObject.toStub(e);
+    // fail("The object is not exported any more");
+    // } catch (NoSuchObjectException ex) {
+    // }
+    // }
+
+    /**
+     * Unexport an Echo extends UnicastRemoteObject without force in the middle
+     * of a call. This methods finishes normally, and the object continuous
+     * exported.
+     * 
+     */
+
+    public void testUnexportObjectRemoteBoolean007() throws RemoteException {
+        Echo e = new EchoUnicast_Imp() {
+            private static final long serialVersionUID = 1L;
+
+            public String echo(String msg) throws RemoteException {
+                msgCount += 1;
+                try {
+                    assertFalse("The object can't unexport",
+                            UnicastRemoteObject.unexportObject(this, false));
+                } catch (Throwable ex) {
+                    fail("Failed with:" + ex);
+                }
+                return EchoUnicast_Imp.class + " - Have said: " + msg;
+            }
+        };
+
+        ((Echo) RemoteObject.toStub(e)).echo("hello");
+
+    }
+
+    /**
+     * Unexport an Echo extends UnicastRemoteObject with stub without force in
+     * the middle of a call. This methods finishes normally, and the object
+     * continuous exported.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean008() throws RemoteException {
+        Echo e = new EchoWithStubUnicast_Imp() {
+            private static final long serialVersionUID = 1L;
+
+            public String echo(String msg) throws RemoteException {
+                // ("Se recibio mensaje: " + msg);
+                msgCount += 1;
+                try {
+                    assertFalse("The object can't unexport",
+                            UnicastRemoteObject.unexportObject(this, false));
+                } catch (Throwable ex) {
+                    fail("Failed with:" + ex);
+                }
+                return EchoUnicast_Imp.class + " - Have said: " + msg;
+            }
+        };
+
+        ((Echo) RemoteObject.toStub(e)).echo("hello");
+
+    }
+
+    // /**
+    // * Unexport a Echo extends Activatable without force in the middle of a
+    // call.
+    // * This methods finishes normally,
+    // * and the object continuous exported.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean009() throws IOException {
+    // Echo e = new EchoActivatable_Imp() {
+    // private static final long serialVersionUID = 1L;
+    // public String echo(String msg) throws RemoteException {
+    // msgCount += 1;
+    // try {
+    // assertFalse("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(this,false));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // return EchoUnicast_Imp.class + " - Have said: " + msg;
+    // }
+    // };
+    //  
+    // ((Echo)RemoteObject.toStub(e)).echo("hello");
+    // }
+
+    // /**
+    // * Unexport a Echo extends Activatable with stub without force in the
+    // middle of a call.
+    // * This methods finishes normally,
+    // * and the object continuous exported.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean010() throws IOException {
+    // Echo e = new EchoWithStubActivatable_Imp() {
+    // private static final long serialVersionUID = 1L;
+    // public String echo(String msg) throws RemoteException {
+    //  
+    // msgCount += 1;
+    // try {
+    // assertFalse("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(this,false));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // return EchoUnicast_Imp.class + " - Have said: " + msg;
+    // }
+    // };
+    //  
+    // ((Echo)RemoteObject.toStub(e)).echo("hello");
+    // }
+
+    /**
+     * Unexport a Echo with force. This methods finishes with
+     * NoSuchObjectException, because the object has not been exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean011() {
+        Echo e = new Echo_Imp();
+        try {
+            UnicastRemoteObject.unexportObject(e, true);
+            fail("The object is not exported ");
+        } catch (NoSuchObjectException ex) {
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+
+    }
+
+    /**
+     * Unexport a Echo with stub with force. This methods finishes with
+     * NoSuchObjectException, because the object has not been exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean012() throws RemoteException {
+        Echo e = new EchoWithStub_Imp();
+        try {
+            UnicastRemoteObject.unexportObject(e, true);
+            fail("The object is not exported ");
+        } catch (NoSuchObjectException ex) {
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+
+    }
+
+    /**
+     * Unexport a Echo extends UnicastRemoteObject with force. This method
+     * finishes normally, and the object has not been exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean013() throws RemoteException {
+        Echo e = new EchoUnicast_Imp();
+        try {
+            assertTrue("The object can't unexport", UnicastRemoteObject
+                    .unexportObject(e, true));
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+    }
+
+    /**
+     * Unexport a Echo extends UnicastRemoteObject with stub with force. This
+     * methods finishes normally, and the object has not been exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean014() throws RemoteException {
+        Echo e = new EchoWithStubUnicast_Imp();
+        try {
+            assertTrue("The object can't unexport", UnicastRemoteObject
+                    .unexportObject(e, true));
+        } catch (Throwable ex) {
+            fail("Failed with:" + ex);
+        }
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+    }
+
+    // /**
+    // * Unexports an Echo extends Activatable with force.
+    // * This method finishes normally,
+    // * and the object has not been exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean015() throws IOException {
+    // Echo e = new EchoActivatable_Imp();
+    // try {
+    // assertTrue("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(e,true));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // try {
+    // RemoteObject.toStub(e);
+    // fail("The object is not exported any more");
+    // } catch (NoSuchObjectException ex) {
+    // }
+    // }
+
+    // /**
+    // * Unexports an Echo extends Activatable with stub with force.
+    // * This method finishes normally,
+    // * and the object has not been exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean016() throws IOException {
+    // Echo e = new EchoWithStubActivatable_Imp();
+    // try {
+    // assertTrue("The object can't unexport",
+    // UnicastRemoteObject.unexportObject(e,true));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // try {
+    // RemoteObject.toStub(e);
+    // fail("The object is not exported any more");
+    // } catch (NoSuchObjectException ex) {
+    // }
+    // }
+
+    /**
+     * Unexport a Echo extends UnicastRemoteObject without force in the middle
+     * of a call. This method finishes normally, and the object has not been
+     * exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean017() throws RemoteException {
+        Echo e = new EchoUnicast_Imp() {
+            private static final long serialVersionUID = 1L;
+
+            public String echo(String msg) throws RemoteException {
+
+                msgCount += 1;
+                try {
+                    assertTrue("The object unexport", UnicastRemoteObject
+                            .unexportObject(this, true));
+                } catch (Throwable ex) {
+                    fail("Failed with:" + ex);
+                }
+                return EchoUnicast_Imp.class + " - Have said: " + msg;
+            }
+        };
+
+        ((Echo) RemoteObject.toStub(e)).echo("hello");
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+
+    }
+
+    /**
+     * Unexport an Echo extends UnicastRemoteObject with stub with force in the
+     * middle of a call. This method finishes normally, and the object has not
+     * been exported yet.
+     * 
+     */
+    public void testUnexportObjectRemoteBoolean018() throws RemoteException {
+        Echo e = new EchoWithStubUnicast_Imp() {
+            private static final long serialVersionUID = 1L;
+
+            public String echo(String msg) throws RemoteException {
+
+                msgCount += 1;
+                try {
+                    assertTrue("The object unexport", UnicastRemoteObject
+                            .unexportObject(this, true));
+                } catch (Throwable ex) {
+                    fail("Failed with:" + ex);
+                }
+                return EchoUnicast_Imp.class + " - Have said: " + msg;
+            }
+        };
+
+        ((Echo) RemoteObject.toStub(e)).echo("hello");
+        try {
+            RemoteObject.toStub(e);
+            fail("The object is not exported any more");
+        } catch (NoSuchObjectException ex) {
+        }
+
+    }
+
+    // /**
+    // * Unexports an Echo extends Activatable with force in the middle of a
+    // call.
+    // * This method finishes normally,
+    // * and the object has not exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean019() throws IOException {
+    // Echo e = new EchoActivatable_Imp() {
+    // private static final long serialVersionUID = 1L;
+    // public String echo(String msg) throws RemoteException {
+    //  
+    // msgCount += 1;
+    // try {
+    // assertTrue("The object unexport",
+    // UnicastRemoteObject.unexportObject(this,true));
+    // } catch (Throwable ex) {
+    // fail("Failed with:" + ex);
+    // }
+    // return EchoUnicast_Imp.class + " - Have said: " + msg;
+    // }
+    // };
+    //  
+    // ((Echo)RemoteObject.toStub(e)).echo("hello");
+    // try {
+    // RemoteObject.toStub(e);
+    // fail("The object is not exported any more");
+    // } catch (NoSuchObjectException ex) {
+    // }
+    // }
+    // /**
+    // * Unexports an Echo extends Activatable with stub with force in the
+    // middle of a call.
+    // * This method finishes normally,
+    // * and the object has not exported yet.
+    // *
+    // */
+    // public void testUnexportObjectRemoteBoolean020() throws IOException {
+    // Echo e = new EchoWithStubActivatable_Imp() {
+    // private static final long serialVersionUID = 1L;
+    // public String echo(String msg) throws RemoteException {
+    //  
+    // msgCount += 1;
+    // try {
+    //  assertTrue("The object unexport", UnicastRemoteObject.unexportObject(this,true));
+    //  } catch (Throwable ex) {
+    //  fail("Failed with:" + ex);
+    //  }
+    //  return EchoUnicast_Imp.class + " - Have said: " + msg;
+    //  }
+    //  };
+    //  
+    //  ((Echo)RemoteObject.toStub(e)).echo("hello");
+    //  try {
+    //  RemoteObject.toStub(e);
+    //  fail("The object is not exported any more");
+    //  } catch (NoSuchObjectException ex) {
+    //  }
+    //  }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/TestUnicastRemoteObject.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoClient.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoClient.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoClient.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoClient.java Tue May 16 06:51:00 2006
@@ -0,0 +1,46 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.rmiclassloader;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.RMIClassLoader;
+
+public class EchoClient {
+
+    public static void main(String[] args) throws Exception {
+
+        Registry registry = LocateRegistry.getRegistry();
+        IEcho stub = (IEcho) registry.lookup("Echo2");
+        String response = stub.echo("Real Time in client: "
+                + System.currentTimeMillis());
+        System.out.println("Answer from server: " + response);
+
+        try {
+            RMIClassLoader.getClassLoader("file://home/odemo/classes");
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoClient.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoServer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoServer.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoServer.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoServer.java Tue May 16 06:51:00 2006
@@ -0,0 +1,45 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.rmiclassloader;
+
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.server.UnicastRemoteObject;
+
+public class EchoServer implements IEcho {
+
+    public String echo(String msg) throws RemoteException {
+
+        return this.getClass() + " - Have said: " + msg;
+    }
+
+    public static void main(String args[]) throws Exception {
+
+        LocateRegistry.createRegistry(1099);
+        IEcho echoServer = new EchoServer();
+        IEcho stubProxy = (IEcho) UnicastRemoteObject.exportObject(echoServer,
+                0);
+        Naming.rebind("//127.0.0.1:1099/Echo2", stubProxy);
+
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoServer.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoTest2.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoTest2.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoTest2.java Tue May 16 06:51:00 2006
@@ -0,0 +1,53 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.rmiclassloader;
+
+import java.io.File;
+import java.io.IOException;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.rmi.server.Unreferenced;
+
+public class EchoTest2 extends UnicastRemoteObject implements IEcho,
+        Unreferenced {
+
+    private static final long serialVersionUID = 1L;
+
+    public EchoTest2() throws RemoteException {
+        super();
+    }
+
+    public String echo(String msg) throws RemoteException {
+        System.out.println(msg);
+        return this.getClass() + " - Have said: " + msg;
+    }
+
+    public void unreferenced() {
+        File f = new File("done");
+        try {
+            f.createNewFile();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/EchoTest2.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/IEcho.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/IEcho.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/IEcho.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/IEcho.java Tue May 16 06:51:00 2006
@@ -0,0 +1,31 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.rmiclassloader;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface IEcho extends Remote {
+
+    public String echo(String msg) throws RemoteException;
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/rmiclassloader/IEcho.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest002.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest002.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest002.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest002.java Tue May 16 06:51:00 2006
@@ -0,0 +1,31 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+public class LoaderClassTest002 {
+
+    public LoaderClassTest002() {
+        super();
+
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest002.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest003.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest003.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest003.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest003.java Tue May 16 06:51:00 2006
@@ -0,0 +1,39 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+public class LoaderClassTest003 implements SuperProxy, OverProxy {
+
+    public LoaderClassTest003() {
+        super();
+
+    }
+
+    public void proxy1() {
+
+    }
+
+    public void proxy2() {
+
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderClassTest003.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderRemoteClassTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderRemoteClassTest.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderRemoteClassTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderRemoteClassTest.java Tue May 16 06:51:00 2006
@@ -0,0 +1,35 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+import java.rmi.Remote;
+
+public class LoaderRemoteClassTest implements Remote {
+
+    public LoaderRemoteClassTest() {
+        super();
+    }
+
+    public int getValue() {
+        return 100;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/LoaderRemoteClassTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/MyRMISocketFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/MyRMISocketFactory.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/MyRMISocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/MyRMISocketFactory.java Tue May 16 06:51:00 2006
@@ -0,0 +1,44 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.rmi.server.RMISocketFactory;
+
+public class MyRMISocketFactory extends RMISocketFactory {
+
+    public MyRMISocketFactory() {
+        super();
+
+    }
+
+    public Socket createSocket(String host, int port) throws IOException {
+        return new Socket(host, port);
+    }
+
+    public ServerSocket createServerSocket(int port) throws IOException {
+        return new ServerSocket(port);
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/MyRMISocketFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/OverProxy.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/OverProxy.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/OverProxy.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/OverProxy.java Tue May 16 06:51:00 2006
@@ -0,0 +1,27 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+public interface OverProxy {
+
+    public void proxy2();
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/OverProxy.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/ProxyTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/ProxyTest.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/ProxyTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/ProxyTest.java Tue May 16 06:51:00 2006
@@ -0,0 +1,44 @@
+package ar.org.fitc.test.rmi.server.testclasses;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.MalformedURLException;
+import java.net.Proxy;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.UnknownHostException;
+
+public class ProxyTest {
+    public static void main(String[] args) {
+        String host = "10.100.2.246";
+        String port = "1099";
+        int proxyPort = 3128;
+        InetAddress proxyHost = null;
+        URL conn = null;
+        URLConnection uconn = null;
+
+        try {
+
+            proxyHost = InetAddress.getByName("saturno.fitc.org.ar");
+            conn = new URL("http://+" + host + ":" + port);
+            Proxy p = new Proxy(Proxy.Type.valueOf("HTTP"),
+                    new InetSocketAddress(proxyHost, proxyPort));
+            
+            uconn = conn.openConnection(p);
+            uconn.connect();
+            
+            System.out.println(uconn.getHeaderField("head"));
+            System.out.println();
+            uconn.setDoOutput(true);
+                    
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/ProxyTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/SuperProxy.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/SuperProxy.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/SuperProxy.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/SuperProxy.java Tue May 16 06:51:00 2006
@@ -0,0 +1,28 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+package ar.org.fitc.test.rmi.server.testclasses;
+
+public interface SuperProxy {
+
+    public void proxy1();
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/server/testclasses/SuperProxy.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Messages.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Messages.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Messages.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Messages.java Tue May 16 06:51:00 2006
@@ -0,0 +1,46 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+
+package ar.org.fitc.test.util;
+/**
+ * This interface contains Strings for use when a test failed.
+ * 
+ *
+ */
+public interface Messages {
+    static String msgNoException = "Should not raise an Exception...";
+    static String msgNoSuchAlgorithm = "Should raise NoSuchAlgorithmException";
+    static String msgNullPointer = "Should raise NullPointerException";
+    static String msgNoSuchPadding = "Should raise NoSuchPaddingException";
+    static String msgNoSuchProvider = "Should raise NoSuchProviderException";
+    static String msgInvalidKey = "Should raise InvalidKeyException...";
+    static String msgIllegalArgument = "Should raise IllegalArgumentException";
+    static String msgNotInstance = "Not returning an instance of ";
+    static String msgRaise = "Should raise "; 
+    static String msgInvalidAlgorithmParamter = "Should raise InvalidAlgorithmParameterException...";
+    static String msgNoImp = "Method not implemented yet";
+    static String msgThrowTest = "Throwned for testing purposes...";
+    static String msgNullRet = "Should return null";
+    static String msgNotSame = "Not the same...";
+    static String msgNotNull = "Should not return null";
+    static String msgExceptionNoExpected = "Some exception don't expected: ";
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Messages.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/MyClassLoader.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/MyClassLoader.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/MyClassLoader.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/MyClassLoader.java Tue May 16 06:51:00 2006
@@ -0,0 +1,35 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Hugo Beilis
+ * @author Osvaldo Demo
+ * @author Jorge Rafael
+ * @version 1.0
+ */
+
+package ar.org.fitc.test.util;
+
+public class MyClassLoader extends ClassLoader {
+
+    public MyClassLoader(ClassLoader arg0) {
+        super(arg0);
+    }
+
+    public MyClassLoader() {
+        super();
+    }
+    
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/MyClassLoader.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Net.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Net.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Net.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Net.java Tue May 16 06:51:00 2006
@@ -0,0 +1,35 @@
+package ar.org.fitc.test.util;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class Net {
+
+	public Net() {
+		super();
+
+	}
+
+	static {
+		// seting port
+		String sport = System.getProperty("ar.org.fitc.test.port");
+		if (sport != null) {
+			port = Integer.parseInt(sport);
+		} else {
+			port = 1099;
+		}
+	}
+	private static int port;
+	public static int getRegistryPort() {
+		return port;
+	}
+    
+    public static String ip() throws UnknownHostException {
+        InetAddress address = InetAddress.getLocalHost();
+        byte[] ipAddr = address.getAddress();
+        String ip = new String(ipAddr[0] + "." + ipAddr[1] + "." + ipAddr[2]
+                + "." + ipAddr[3]);
+        return ip;
+    }
+	
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/util/Net.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/dependencies/junit.jar
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/dependencies/junit.jar?rev=406944&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/dependencies/junit.jar
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/dependencies/junit.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/doctools/RefTaglet.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/doctools/RefTaglet.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/doctools/RefTaglet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/doctools/RefTaglet.java Tue May 16 06:51:00 2006
@@ -0,0 +1,167 @@
+package doctools;
+
+import com.sun.tools.doclets.Taglet;
+import com.sun.javadoc.*;
+import java.util.Map;
+
+/**
+ * A sample Taglet representing @todo. This tag can be used in any kind of
+ * {@link com.sun.javadoc.Doc}.  It is not an inline tag. The text is displayed
+ * in yellow to remind the developer to perform a task.  For
+ * example, "@todo Fix this!" would be shown as:
+ * <DL>
+ * <DT>
+ * <B>To Do:</B>
+ * <DD><table cellpadding=2 cellspacing=0><tr><td bgcolor="yellow">Fix this!
+ * </td></tr></table></DD>
+ * </DL>
+ *
+ * @author Jamie Ho
+ * @since 1.4
+ */
+
+public class RefTaglet implements Taglet {
+    
+    private static final String NAME = "ar.org.fitc.ref";
+    private static final String HEADER = "References:";
+    private static UrlTaglet urlTaglet = new UrlTaglet();
+    
+    /**
+     * Return the name of this custom tag.
+     */
+    public String getName() {
+        return NAME;
+    }
+    
+    /**
+     * Will return false since <code>@ar.org.fitc.spec_ref</code>
+     * can not be used in field documentation.
+     * @return false since <code>@ar.org.fitc.spec_ref</code>
+     * can not be used in field documentation.
+     */
+    public boolean inField() {
+        return false;
+    }
+
+    /**
+     * Will return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in constructor documentation.
+     * @return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in constructor documentation and false
+     * otherwise.
+     */
+    public boolean inConstructor() {
+        return true;
+    }
+    
+    /**
+     * Will return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in method documentation.
+     * @return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in method documentation and false
+     * otherwise.
+     */
+    public boolean inMethod() {
+        return true;
+    }
+    
+    /**
+     * Will return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in method documentation.
+     * @return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in overview documentation and false
+     * otherwise.
+     */
+    public boolean inOverview() {
+        return true;
+    }
+
+    /**
+     * Will return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in package documentation.
+     * @return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in package documentation and false
+     * otherwise.
+     */
+    public boolean inPackage() {
+        return true;
+    }
+
+    /**
+     * Will return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in type documentation (classes or interfaces).
+     * @return true since <code>@ar.org.fitc.spec_ref</code>
+     * can be used in type documentation and false
+     * otherwise.
+     */
+    public boolean inType() {
+        return true;
+    }
+    
+    /**
+     * Will return false since <code>@ar.org.fitc.spec_ref</code>
+     * is not an inline tag.
+     * @return false since <code>@ar.org.fitc.spec_ref</code>
+     * is not an inline tag.
+     */
+    
+    public boolean isInlineTag() {
+        return false;
+    }
+    
+    /**
+     * Register this Taglet.
+     * @param tagletMap  the map to register this tag to.
+     */
+    public static void register(Map tagletMap) {
+       RefTaglet tag = new RefTaglet();
+       Taglet t = (Taglet) tagletMap.get(tag.getName());
+       if (t != null) {
+           tagletMap.remove(tag.getName());
+       }
+       tagletMap.put(tag.getName(), tag);
+    }
+
+    private String format(Tag tag){
+    	String ret = "";
+    	for (Tag inlineTag:tag.inlineTags()){
+    		if (inlineTag.name().equals("@"+urlTaglet.getName())){
+    				ret += urlTaglet.toString(inlineTag);
+    		} else
+    			ret += inlineTag.text();
+    	}
+    	return String.format("<li>%s</li>\n",ret);
+    }
+    
+    /**
+     * Given the <code>Tag</code> representation of this custom
+     * tag, return its string representation.
+     * @param tag   the <code>Tag</code> representation of this custom tag.
+     */
+    public String toString(Tag tag) {
+        String ret = "";
+        if (tag.text()!= null && tag.text().length() > 0){
+        	ret = String.format("<DT><B>%s</B><DD><ul>%s</ul>", HEADER,format(tag));
+        }
+        return ret;
+    }
+    
+    
+    /**
+     * Given an array of <code>Tag</code>s representing this custom
+     * tag, return its string representation.
+     * @param tags  the array of <code>Tag</code>s representing of this custom tag.
+     */
+    public String toString(Tag[] tags) {
+        String ret = null;
+        for (Tag tag: tags)
+        	if (tag.text()!= null && tag.text().length() > 0){
+        		if (ret == null)
+        			ret = String.format("<DT><B>%s</B><DD><ul>", HEADER);
+        		ret += format(tag);
+        	}
+        return ret == null ? "" : ret + "</ul>";
+    }
+}
+
+

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/doctools/RefTaglet.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message