test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 4289544
  26  * @summary ActivationGroupImpl.newInstance does not set context classloader for impl
  27  * @author Laird Dornin; code borrowed from Ann Wollrath
  28  *
  29  * @library ../../../testlibrary
  30  * @modules java.rmi/sun.rmi.registry
  31  *          java.rmi/sun.rmi.server
  32  *          java.rmi/sun.rmi.transport
  33  *          java.rmi/sun.rmi.transport.tcp

  34  * @build TestLibrary RMID
  35  *     MyRMI ActivatableImpl ActivatableImpl ActivatableImpl_Stub
  36  * @run main/othervm/policy=security.policy/timeout=150 CheckImplClassLoader
  37  */
  38 
  39 import java.io.*;
  40 import java.rmi.*;
  41 import java.rmi.server.*;
  42 import java.rmi.activation.*;
  43 import java.net.URL;
  44 
  45 /**
  46  * sun.rmi.server.ActivationGroupImpl.newInstance() needs to set the
  47  * context class loader when it constructs the implementation class of
  48  * an Activatable object.  It needs to set the ccl to be the class
  49  * loader of the implementation class.
  50  *
  51  * Test creates an Activatable object whose impl is loaded outside of
  52  * CLASSPATH.  The impls constructor checks to make sure that the
  53  * correct context class loader has been set when the constructor is




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 4289544
  26  * @summary ActivationGroupImpl.newInstance does not set context classloader for impl
  27  * @author Laird Dornin; code borrowed from Ann Wollrath
  28  *
  29  * @library ../../../testlibrary
  30  * @modules java.rmi/sun.rmi.registry
  31  *          java.rmi/sun.rmi.server
  32  *          java.rmi/sun.rmi.transport
  33  *          java.rmi/sun.rmi.transport.tcp
  34  *          java.base/sun.nio.ch
  35  * @build TestLibrary RMID
  36  *     MyRMI ActivatableImpl ActivatableImpl ActivatableImpl_Stub
  37  * @run main/othervm/policy=security.policy/timeout=150 CheckImplClassLoader
  38  */
  39 
  40 import java.io.*;
  41 import java.rmi.*;
  42 import java.rmi.server.*;
  43 import java.rmi.activation.*;
  44 import java.net.URL;
  45 
  46 /**
  47  * sun.rmi.server.ActivationGroupImpl.newInstance() needs to set the
  48  * context class loader when it constructs the implementation class of
  49  * an Activatable object.  It needs to set the ccl to be the class
  50  * loader of the implementation class.
  51  *
  52  * Test creates an Activatable object whose impl is loaded outside of
  53  * CLASSPATH.  The impls constructor checks to make sure that the
  54  * correct context class loader has been set when the constructor is