run.sh revision 2414
0N/A# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A# This code is free software; you can redistribute it and/or modify it 0N/A# under the terms of the GNU General Public License version 2 only, as 0N/A# published by the Free Software Foundation. 0N/A# This code is distributed in the hope that it will be useful, but WITHOUT 0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A# version 2 for more details (a copy is included in the LICENSE file that 0N/A# accompanied this code). 0N/A# You should have received a copy of the GNU General Public License version 0N/A# 2 along with this work; if not, write to the Free Software Foundation, 0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A# CA 95054 USA or visit www.sun.com if you need additional information or 0N/A# have any questions. 2414N/A# @bug 6473331 6485027 6934615 0N/A# @summary Test handling of the Class-Path attribute in jar file manifests 0N/A# @author Andrey Ozerov 0N/A# To run this test manually, simply do ./run.sh 0N/A#---------------------------------------------------------------- 0N/A# Create mutually referential jar files 0N/A#---------------------------------------------------------------- 0N/Apublic class A implements java.io.Serializable { 0N/A public int f(B b) { return b.g(); } 0N/A public int g() { return 0; } 0N/Apublic class B implements java.io.Serializable { 0N/A public int f(A a) { return a.g(); } 0N/A public int g() { return 0; } 2414N/A# NOTE: Previously, some lines were commented out and alternative lines 2414N/A# provided, to work around javac bug 6485027. That bug, and related rmic 2414N/A# bug 6934615 have now been fixed, so most of the workarounds have been 2414N/A# removed. However, javac still does not evaluate jar class paths on 2414N/A# the bootclasspath, including -extdirs. 0N/Apublic interface MainI extends java.rmi.Remote { 0N/A public int doIt(A a, B b) throws java.rmi.RemoteException; 0N/Aimport java.rmi.server.UnicastRemoteObject; 0N/Apublic class Main implements MainI { 0N/A public int doIt(A a, B b) { 0N/A return a.f(b) + b.f(a); 0N/A public static void main(String args[]) throws Exception { 0N/A Main impl = new Main(); 0N/A MainI stub = (MainI) UnicastRemoteObject.exportObject(impl); 0N/A int result = stub.doIt(new A(), new B()); 0N/A System.exit(result); 0N/A UnicastRemoteObject.unexportObject(impl, true); 0N/A } catch (Exception e) { }