run.sh revision 0
942N/A# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 942N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 942N/A# This code is free software; you can redistribute it and/or modify it 942N/A# under the terms of the GNU General Public License version 2 only, as 942N/A# published by the Free Software Foundation. 942N/A# This code is distributed in the hope that it will be useful, but WITHOUT 942N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 942N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 942N/A# version 2 for more details (a copy is included in the LICENSE file that 942N/A# accompanied this code). 942N/A# You should have received a copy of the GNU General Public License version 942N/A# 2 along with this work; if not, write to the Free Software Foundation, 942N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 942N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 942N/A# @summary Test handling of the Class-Path attribute in jar file manifests # To run this test manually, simply do ./run.sh #---------------------------------------------------------------- # Create mutually referential jar files #---------------------------------------------------------------- public class A implements java.io.Serializable { public int f(B b) { return b.g(); } public int g() { return 0; } public class B implements java.io.Serializable { public int f(A a) { return a.g(); } public int g() { return 0; } # NOTE: Certain lines below are commented out in order to work around # bug 6485027, with alternative lines added as part of the workaround # as indicated. In particular, the mutally referential JAR files are # placed in the same directory instead of different directories, and # javac is not expected to handle the extensions directories cases. #MkManifestWithClassPath "../A.jar" public interface MainI extends java.rmi.Remote { public int doIt(A a, B b) throws java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class Main implements MainI { public int doIt(A a, B b) { public static void main(String args[]) throws Exception { MainI stub = (MainI) UnicastRemoteObject.exportObject(impl); int result = stub.doIt(new A(), new B()); UnicastRemoteObject.unexportObject(impl, true); } catch (Exception e) { } #Success "$rmic" -extdirs "jars/sub" -classpath . Main