提交 7ab055df 编写于 作者: K ksrini

8020552: [launcher] changes to support removal of Solaris 32-bit distribution

8023495: [infra] create 64-bit solaris bits with symlinks
Reviewed-by: ihse, tbell, dholmes, darcy, alanb, erikj, sla, martin
上级 6d0eb0c3
# #
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -190,6 +190,26 @@ $(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\ ...@@ -190,6 +190,26 @@ $(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\ $(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS))) $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
define AddIsadirLink
# Param 1 - src file
# Param 2 - variable to add targets to
$1_LINK := $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)
$$($1_LINK):
$(ECHO) $(LOG_INFO) Creating link $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
$(MKDIR) -p $$(@D)
$(LN) -s ../$$(@F) $$@
$2 += $$($1_LINK)
endef
$(foreach f,$(JRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JRE_BIN_ISADIR_LINK_TARGETS)))
$(foreach f,$(JDK_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDK_BIN_ISADIR_LINK_TARGETS)))
$(foreach f,$(JDKJRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDKJRE_BIN_ISADIR_LINK_TARGETS)))
endif
################################################################################ ################################################################################
# /lib dir # /lib dir
ifneq ($(OPENJDK_TARGET_OS), macosx) ifneq ($(OPENJDK_TARGET_OS), macosx)
...@@ -730,7 +750,8 @@ endif ...@@ -730,7 +750,8 @@ endif
jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \ jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) $(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) \
$(JRE_BIN_ISADIR_LINK_TARGETS)
jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \ $(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
...@@ -741,7 +762,8 @@ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ ...@@ -741,7 +762,8 @@ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \ $(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
$(JDK_IMAGE_DIR)/src.zip $(JDK_IMAGE_DIR)/src.zip \
$(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS)
jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
$(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST) $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
......
/* /*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -196,19 +196,7 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin ...@@ -196,19 +196,7 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin
try { try {
if (home.length() > 0) { if (home.length() > 0) {
/*
* A wrinkle in the environment:
* 64-bit executables are stored under $JAVA_HOME/bin/os_arch
* 32-bit executables are stored under $JAVA_HOME/bin
*/
String os_arch = System.getProperty("os.arch");
if ("SunOS".equals(System.getProperty("os.name")) &&
("sparcv9".equals(os_arch) || "amd64".equals(os_arch))) {
exePath = home + File.separator + "bin" + File.separator +
os_arch + File.separator + exe;
} else {
exePath = home + File.separator + "bin" + File.separator + exe; exePath = home + File.separator + "bin" + File.separator + exe;
}
} else { } else {
exePath = exe; exePath = exe;
} }
......
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
*/ */
#ifdef __solaris__ #ifdef __solaris__
# define DUAL_MODE
# ifndef LIBARCH32NAME # ifndef LIBARCH32NAME
# error "The macro LIBARCH32NAME was not defined on the compile line" # error "The macro LIBARCH32NAME was not defined on the compile line"
# endif # endif
......
/* /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -108,16 +108,7 @@ public class BadHandshakeTest { ...@@ -108,16 +108,7 @@ public class BadHandshakeTest {
*/ */
private static Process launch(String address, String class_name) throws IOException { private static Process launch(String address, String class_name) throws IOException {
String exe = System.getProperty("java.home") String exe = System.getProperty("java.home")
+ File.separator + "bin" + File.separator; + File.separator + "bin" + File.separator + "java";
String arch = System.getProperty("os.arch");
String osname = System.getProperty("os.name");
if (osname.equals("SunOS") && arch.equals("sparcv9")) {
exe += "sparcv9/java";
} else if (osname.equals("SunOS") && arch.equals("amd64")) {
exe += "amd64/java";
} else {
exe += "java";
}
String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() + String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() +
" -agentlib:jdwp=transport=dt_socket" + " -agentlib:jdwp=transport=dt_socket" +
",server=y" + ",suspend=y" + ",address=" + address + ",server=y" + ",suspend=y" + ",address=" + address +
......
/* /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -90,16 +90,7 @@ public class DoubleAgentTest { ...@@ -90,16 +90,7 @@ public class DoubleAgentTest {
*/ */
private static Process launch(String address, String class_name) throws IOException { private static Process launch(String address, String class_name) throws IOException {
String exe = System.getProperty("java.home") String exe = System.getProperty("java.home")
+ File.separator + "bin" + File.separator; + File.separator + "bin" + File.separator + "java";
String arch = System.getProperty("os.arch");
String osname = System.getProperty("os.name");
if (osname.equals("SunOS") && arch.equals("sparcv9")) {
exe += "sparcv9/java";
} else if (osname.equals("SunOS") && arch.equals("amd64")) {
exe += "amd64/java";
} else {
exe += "java";
}
String jdwpOption = "-agentlib:jdwp=transport=dt_socket" String jdwpOption = "-agentlib:jdwp=transport=dt_socket"
+ ",server=y" + ",suspend=y" + ",address=" + address; + ",server=y" + ",suspend=y" + ",address=" + address;
String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() String cmd = exe + " " + VMConnection.getDebuggeeVMOptions()
......
/* /*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -97,16 +97,7 @@ public class ExclusiveBind { ...@@ -97,16 +97,7 @@ public class ExclusiveBind {
*/ */
private static Process launch(String address, boolean suspend, String class_name) throws IOException { private static Process launch(String address, boolean suspend, String class_name) throws IOException {
String exe = System.getProperty("java.home") + File.separator + "bin" + String exe = System.getProperty("java.home") + File.separator + "bin" +
File.separator; File.separator + "java";
String arch = System.getProperty("os.arch");
String osname = System.getProperty("os.name");
if (osname.equals("SunOS") && arch.equals("sparcv9")) {
exe += "sparcv9/java";
} else if (osname.equals("SunOS") && arch.equals("amd64")) {
exe += "amd64/java";
} else {
exe += "java";
}
String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() + String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() +
" -agentlib:jdwp=transport=dt_socket,server=y,suspend="; " -agentlib:jdwp=transport=dt_socket,server=y,suspend=";
if (suspend) { if (suspend) {
......
#!/bin/ksh -p #!/bin/ksh -p
# #
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -102,28 +102,7 @@ libdir=${TESTCLASSES} ...@@ -102,28 +102,7 @@ libdir=${TESTCLASSES}
is_windows=false is_windows=false
is_cygwin=false is_cygwin=false
case `uname -s` in case `uname -s` in
SunOS) SunOS|Linux)
libarch=`uname -p`
d64=`echo "${DEBUGGEEFLAGS}" | fgrep -- -d64`
case `uname -p` in
sparc)
if [ "${d64}" != "" ] ; then
libarch=sparcv9
fi
;;
i386)
if [ "${d64}" != "" ] ; then
libarch=amd64
fi
;;
*)
echo "FAILURE: Unknown uname -p: " `uname -p`
exit 1
;;
esac
libloc=${jreloc}/lib/${libarch}
;;
Linux)
xx=`find ${jreloc}/lib -name libdt_socket.so` xx=`find ${jreloc}/lib -name libdt_socket.so`
libloc=`dirname ${xx}` libloc=`dirname ${xx}`
;; ;;
......
/* /*
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -113,16 +113,7 @@ public class RunToExit { ...@@ -113,16 +113,7 @@ public class RunToExit {
*/ */
private static Process launch(String address, String class_name) throws IOException { private static Process launch(String address, String class_name) throws IOException {
String exe = System.getProperty("java.home") String exe = System.getProperty("java.home")
+ File.separator + "bin" + File.separator; + File.separator + "bin" + File.separator + "java";
String arch = System.getProperty("os.arch");
String osname = System.getProperty("os.name");
if (osname.equals("SunOS") && arch.equals("sparcv9")) {
exe += "sparcv9/java";
} else if (osname.equals("SunOS") && arch.equals("amd64")) {
exe += "amd64/java";
} else {
exe += "java";
}
String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() + String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() +
" -agentlib:jdwp=transport=dt_socket" + " -agentlib:jdwp=transport=dt_socket" +
",server=y" + ",suspend=y" + ",address=" + address + ",server=y" + ",suspend=y" + ",address=" + address +
......
#!/bin/ksh -p
#
# Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# @test Solaris32AndSolaris64Test.sh
# @bug 4478312 4780570 4913748 6730273
# @summary Test debugging with mixed 32/64bit VMs.
# @author Tim Bell
# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
#
# @run build TestScaffold VMConnection TargetListener TargetAdapter
# @run compile -g FetchLocals.java
# @run compile -g DataModelTest.java
# @run shell/timeout=240 Solaris32AndSolaris64Test.sh DataModelTest
# @run shell/timeout=240 Solaris32AndSolaris64Test.sh FetchLocals
# Beginning of subroutines:
status=1
#Call this from anywhere to fail the test with an error message
# usage: fail "reason why the test failed"
fail()
{ echo "The test failed :-("
echo "$*" 1>&2
echo "exit status was $status"
exit $status
} #end of fail()
#Call this from anywhere to pass the test with a message
# usage: pass "reason why the test passed if applicable"
pass()
{ echo "The test passed!!!"
echo "$*" 1>&2
exit 0
} #end of pass()
# end of subroutines
if [ $# = 0 ] ; then
echo "Error: no testname specified on cmd line"
exit 1
fi
testName=$1
shift
#Set appropriate jdk
if [ -z "${TESTJAVA}" ] ; then
# TESTJAVA is not set, so the test is running stand-alone.
# TESTJAVA holds the path to the root directory of the build of the JDK
# to be tested. That is, any java files run explicitly in this shell
# should use TESTJAVA in the path to the java interpreter.
# So, we'll set this to the JDK spec'd on the command line. If none
# is given on the command line, tell the user that and use a default.
# THIS IS THE JDK BEING TESTED.
if [ -n "$1" ] ; then
TESTJAVA=$1
else
echo "no JDK specified on command line so using JAVA_HOME=$JAVA_HOME"
TESTJAVA=$JAVA_HOME
fi
TESTSRC=.
TESTCLASSES=.
STANDALONE=1;
fi
echo "JDK under test is: $TESTJAVA"
# The beginning of the script proper
# Checking for proper OS and processor type.
#
# This test is only interested in SunOS SPARC sparcv9 and SunOS AMD64
# (supporting both 32 and 64 bit Solaris binaries).
#
# All other platforms will instantly complete with passing
# status.
#
OS=`uname -s`
case "$OS" in
SunOS )
PATHSEP=":"
PTYPE=`uname -p`
if [ -x /usr/bin/isainfo ]; then
# Instruction set being used by the OS
ISET=`isainfo -k`
else
#SunOS 5.6 didn't have "isainfo"
pass "This test always passes on $OS/$PTYPE (32-bit ${ISET})"
fi
;;
Linux | Darwin )
pass "This test always passes on $OS"
;;
Windows* | CYGWIN*)
pass "This test always passes on $OS"
;;
# catch all other OSs
* )
echo "Unrecognized system! $OS"
fail "Unrecognized system! $OS"
;;
esac
# Is the OS running in sparcv9 or amd64 mode?
case "${ISET}" in
sparc )
pass "This test always passes on $OS/$PTYPE (32-bit ${ISET})"
;;
i386 )
pass "This test always passes on $OS/$PTYPE (32-bit ${ISET})"
;;
amd64 )
echo "OS is running in ${ISET} mode"
;;
sparcv9 )
echo "OS is running in ${ISET} mode"
;;
# catch all others
* )
echo "Unrecognized instruction set! $OS/$PTYPE/${ISET}"
fail "Unrecognized instruction set! $OS/$PTYPE/${ISET}"
;;
esac
# SunOS 32 and 64 bit binaries must be available
# to test in the remainder of the script below.
$TESTJAVA/bin/java -d64 -version > /dev/null 2<&1
if [ $? = 1 ]; then
# The 64 bit version is not installed. Make the test pass.
pass "This test always passes on $OS/$PTYPE if 64 bit jdk is not installed"
fi
# Want this test to run standalone as well as in the harness, so do the
# following to copy the test's directory into the harness's scratch directory
# and set all appropriate variables:
#Deal with .class files:
if [ -n "${STANDALONE}" ] ; then
#if running standalone, compile the support files
${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" \
TestScaffold.java VMConnection.java TargetListener.java TargetAdapter.java
${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" -g \
FetchLocals.java DataModelTest.java
fi
# Get DEBUGGEE flags
DEBUGGEEFLAGS=
filename=$TESTCLASSES/@debuggeeVMOptions
if [ ! -r ${filename} ] ; then
filename=$TESTCLASSES/../@debuggeeVMOptions
fi
# Remove -d32, -d64 if present, and remove -XX:[+-]UseCompressedOops
# if present since it is illegal in 32 bit mode.
if [ -r ${filename} ] ; then
DEBUGGEEFLAGS=`cat ${filename} | sed \
-e 's/-d32//g' \
-e 's/-d64//g' \
-e 's/-XX:.UseCompressedOops//g' \
`
fi
#
CLASSPATH="$TESTJAVA/lib/tools.jar${PATHSEP}${TESTCLASSES}"
export CLASSPATH
CP="-classpath \"${CLASSPATH}\""
for DEBUGGERMODEL in \
32 \
64 \
; do
for TARGETMODEL in \
32 \
64 \
; do
DEBUGGERFLAGS="-d${DEBUGGERMODEL} -showversion -DEXPECTED=${TARGETMODEL}"
CONNECTSTRING="-connect 'com.sun.jdi.CommandLineLaunch:options=-d${TARGETMODEL} $DEBUGGEEFLAGS -showversion'"
for TARGETCLASS in $testName ; do
echo "--------------------------------------------"
echo "debugger=${DEBUGGERMODEL} debugee=${TARGETMODEL} class=${TARGETCLASS}"
echo "--------------------------------------------"
echo ${TESTJAVA}/bin/java -DHANGINGJAVA_DEB ${DEBUGGERFLAGS} ${CP} ${TARGETCLASS} ${CONNECTSTRING}
eval ${TESTJAVA}/bin/java -DHANGINGJAVA_DEB ${DEBUGGERFLAGS} ${CP} ${TARGETCLASS} ${CONNECTSTRING}
status=$?
if [ $status -ne "0" ];
then fail "$DEBUGGERMODEL to $TARGETMODEL test failed for class=$TARGETCLASS!"
fi
done
done
done
#
# pass or fail the test based on status of the command
if [ $status -eq "0" ];
then pass ""
else fail "unspecified test failure"
fi
/* /*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -143,16 +143,7 @@ public class SimpleLaunchingConnector implements LaunchingConnector { ...@@ -143,16 +143,7 @@ public class SimpleLaunchingConnector implements LaunchingConnector {
TransportService.ListenKey key = ts.startListening(); TransportService.ListenKey key = ts.startListening();
String exe = System.getProperty("java.home") + File.separator + "bin" + String exe = System.getProperty("java.home") + File.separator + "bin" +
File.separator; File.separator + "java";
String arch = System.getProperty("os.arch");
String osname = System.getProperty("os.name");
if (osname.equals("SunOS") && arch.equals("sparcv9")) {
exe += "sparcv9/java";
} else if (osname.equals("SunOS") && arch.equals("amd64")) {
exe += "amd64/java";
} else {
exe += "java";
}
String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" + String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
key.address() + key.address() +
" -classpath " + System.getProperty("test.classes") + " -classpath " + System.getProperty("test.classes") +
......
/* /*
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -125,28 +125,22 @@ public class DemoRun { ...@@ -125,28 +125,22 @@ public class DemoRun {
String libprefix = os_name.contains("Windows")?"":"lib"; String libprefix = os_name.contains("Windows")?"":"lib";
String libsuffix = os_name.contains("Windows")?".dll": String libsuffix = os_name.contains("Windows")?".dll":
os_name.contains("OS X")?".dylib":".so"; os_name.contains("OS X")?".dylib":".so";
boolean d64 = ( os_name.contains("Solaris") ||
os_name.contains("SunOS") )
&& ( os_arch.equals("sparcv9") ||
os_arch.equals("amd64"));
boolean hprof = demo_name.equals("hprof"); boolean hprof = demo_name.equals("hprof");
String isa_dir = d64?(File.separator+os_arch):"";
String java = jre_home String java = jre_home
+ File.separator + "bin" + isa_dir + File.separator + "bin"
+ File.separator + "java"; + File.separator + "java";
/* Array of strings to be passed in for exec: /* Array of strings to be passed in for exec:
* 1. java * 1. java
* 2. -Dtest.classes=. * 2. -Dtest.classes=.
* 3. -d64 (optional) * 3. -Xcheck:jni (Just because it finds bugs)
* 4. -Xcheck:jni (Just because it finds bugs) * 4. -Xverify:all (Make sure verification is on full blast)
* 5. -Xverify:all (Make sure verification is on full blast) * 5. -agent
* 6. -agent
* vm_options * vm_options
* 7+i. classname * 6+i. classname
*/ */
int nvm_options = 0; int nvm_options = 0;
if ( vm_options != null ) nvm_options = vm_options.length; if ( vm_options != null ) nvm_options = vm_options.length;
String cmd[] = new String[1 + (d64?1:0) + 7 + nvm_options]; String cmd[] = new String[1 + 7 + nvm_options];
String cmdLine; String cmdLine;
int exitStatus; int exitStatus;
int i,j; int i,j;
...@@ -160,10 +154,6 @@ public class DemoRun { ...@@ -160,10 +154,6 @@ public class DemoRun {
cmdLine += (cmd[i++] = cdir); cmdLine += (cmd[i++] = cdir);
cmdLine += " "; cmdLine += " ";
cmdLine += (cmd[i++] = "-Dtest.classes=" + cdir); cmdLine += (cmd[i++] = "-Dtest.classes=" + cdir);
if ( d64 ) {
cmdLine += " ";
cmdLine += (cmd[i++] = "-d64");
}
cmdLine += " "; cmdLine += " ";
cmdLine += (cmd[i++] = "-Xcheck:jni"); cmdLine += (cmd[i++] = "-Xcheck:jni");
cmdLine += " "; cmdLine += " ";
...@@ -178,7 +168,7 @@ public class DemoRun { ...@@ -178,7 +168,7 @@ public class DemoRun {
+ File.separator + "demo" + File.separator + "demo"
+ File.separator + "jvmti" + File.separator + "jvmti"
+ File.separator + demo_name + File.separator + demo_name
+ File.separator + "lib" + isa_dir + File.separator + "lib"
+ File.separator + libprefix + demo_name + libsuffix; + File.separator + libprefix + demo_name + libsuffix;
cmdLine += " "; cmdLine += " ";
cmdLine += (cmd[i++] = "-agentpath:" + libname cmdLine += (cmd[i++] = "-agentpath:" + libname
......
...@@ -21,33 +21,14 @@ uname := $(shell uname) ...@@ -21,33 +21,14 @@ uname := $(shell uname)
ifeq ($(uname), SunOS) ifeq ($(uname), SunOS)
PLATFORM = solaris PLATFORM = solaris
ISAINFO = isainfo ISAINFO = isainfo
ifndef ARCH_DATA_MODEL ARCH_DATA_MODEL=64
ARCH_DATA_MODEL=32
endif
ifeq ($(ARCH_DATA_MODEL), 32)
archExpr = case "`$(UNAME) -p`" in \
i386) \
$(ECHO) i586 \
;; \
sparc*) \
$(ECHO) sparc \
;; \
*) \
$(UNAME) -p \
;; \
esac
ARCH := $(shell $(archExpr) )
else
ARCH := $(shell $(ISAINFO) -n) ARCH := $(shell $(ISAINFO) -n)
endif
CC = cc CC = cc
LD = ld LD = ld
CFLAGS = -D_REENTRANT -D__solaris__ CFLAGS = -D_REENTRANT -D__solaris__
LDFLAGS_COMMON = -G LDFLAGS_COMMON = -G
EXTRA_LIBS = -lc EXTRA_LIBS = -lc
ifeq ($(ARCH_DATA_MODEL), 64) CC += -m64 -Kpic
CC += -xarch=v9
endif
endif endif
ifeq ($(uname), Linux) ifeq ($(uname), Linux)
......
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
# questions. # questions.
# #
# @test # @test
# @bug 4673940 # @bug 4673940
# @bug 4930794 # @bug 4930794
...@@ -39,7 +38,6 @@ if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then ...@@ -39,7 +38,6 @@ if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then
exit 0 exit 0
fi fi
# if TESTJAVA isn't set then we assume an interactive run. So that it's # if TESTJAVA isn't set then we assume an interactive run. So that it's
# clear which version of 'java' is running we do a 'which java' and # clear which version of 'java' is running we do a 'which java' and
# a 'java -version'. # a 'java -version'.
...@@ -64,24 +62,17 @@ export CLASSPATH ...@@ -64,24 +62,17 @@ export CLASSPATH
# Check that we have libLauncher.so for the right platform. # Check that we have libLauncher.so for the right platform.
# On Solaris we assume 64-bit if java -d64 works. # On Solaris we assume 64-bit
DFLAG= DFLAG=
if [ "$os" = "SunOS" ]; then if [ "$os" = "SunOS" ]; then
PLATFORM=solaris PLATFORM=solaris
case "`uname -p`" in case "`uname -p`" in
i[3-9]86) i[3-9]86)
ARCH=i586 ARCH=amd64
;; ;;
sparc) sparc)
ARCH=sparc
${JAVA} -d64 -version > /dev/null 2<&1
if [ $? = 1 ]; then
ARCH=sparc
else
ARCH=sparcv9 ARCH=sparcv9
DFLAG=-d64
fi
;; ;;
esac esac
fi fi
......
# #
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -58,7 +58,7 @@ OS=`uname -s` ...@@ -58,7 +58,7 @@ OS=`uname -s`
case "$OS" in case "$OS" in
SunOS ) SunOS )
FS="/" FS="/"
LIBNAME="/usr/lib/mps/libsoftokn3.so" LIBNAME="/usr/lib/mps/`isainfo -n`/libsoftokn3.so"
;; ;;
Linux ) Linux )
FS="/" FS="/"
......
/* /*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -167,28 +167,23 @@ public class HatRun { ...@@ -167,28 +167,23 @@ public class HatRun {
String cdir = System.getProperty("test.classes", "."); String cdir = System.getProperty("test.classes", ".");
String os_arch = System.getProperty("os.arch"); String os_arch = System.getProperty("os.arch");
String os_name = System.getProperty("os.name"); String os_name = System.getProperty("os.name");
boolean d64 = os_name.equals("SunOS") && (
os_arch.equals("sparcv9") ||
os_arch.equals("amd64"));
String isa_dir = d64?(File.separator+os_arch):"";
String java = jre_home String java = jre_home
+ File.separator + "bin" + isa_dir + File.separator + "bin"
+ File.separator + "java"; + File.separator + "java";
String jhat = sdk_home + File.separator + "bin" String jhat = sdk_home + File.separator + "bin"
+ File.separator + "jhat"; + File.separator + "jhat";
/* Array of strings to be passed in for exec: /* Array of strings to be passed in for exec:
* 1. java * 1. java
* 2. -Dtest.classes=. * 2. -Dtest.classes=.
* 3. -d64 (optional) * 3. -Xcheck:jni (Just because it finds bugs)
* 4. -Xcheck:jni (Just because it finds bugs) * 4. -Xverify:all (Make sure verification is on full blast)
* 5. -Xverify:all (Make sure verification is on full blast) * 5. -agent
* 6. -agent
* vm_options * vm_options
* 7+i. classname * 6+i. classname
*/ */
int nvm_options = 0; int nvm_options = 0;
if ( vm_options != null ) nvm_options = vm_options.length; if ( vm_options != null ) nvm_options = vm_options.length;
String cmd[] = new String[1 + (d64?1:0) + 7 + nvm_options]; String cmd[] = new String[1 + 7 + nvm_options];
int i,j; int i,j;
i = 0; i = 0;
...@@ -196,9 +191,6 @@ public class HatRun { ...@@ -196,9 +191,6 @@ public class HatRun {
cmd[i++] = "-cp"; cmd[i++] = "-cp";
cmd[i++] = cdir; cmd[i++] = cdir;
cmd[i++] = "-Dtest.classes=" + cdir; cmd[i++] = "-Dtest.classes=" + cdir;
if ( d64 ) {
cmd[i++] = "-d64";
}
cmd[i++] = "-Xcheck:jni"; cmd[i++] = "-Xcheck:jni";
cmd[i++] = "-Xverify:all"; cmd[i++] = "-Xverify:all";
dumpfile= cdir + File.separator + class_name + ".hdump"; dumpfile= cdir + File.separator + class_name + ".hdump";
......
# #
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -48,16 +48,16 @@ case "$OS" in ...@@ -48,16 +48,16 @@ case "$OS" in
NULL=/dev/null NULL=/dev/null
PS=":" PS=":"
FS="/" FS="/"
JAVA_EXE=${TESTJAVA}${FS}bin${FS}sparcv9${FS}java JAVA_EXE=${TESTJAVA}${FS}bin${FS}java
;; ;;
* ) * )
printf "Only testing on sparcv9 (use libumem to reliably catch buffer overrun)\n" printf "Only testing on solaris 64-bit (use libumem to reliably catch buffer overrun)\n"
exit 0; exit 0;
;; ;;
esac esac
if [ ! -x ${JAVA_EXE} ]; then if [ ! -x ${JAVA_EXE} ]; then
printf "Warning: sparcv9 components not installed - skipping test.\n" printf "Warning: 64-bit components not installed - skipping test.\n"
exit 0 exit 0
fi fi
......
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
* @author Joseph D. Darcy, ksrini * @author Joseph D. Darcy, ksrini
*/ */
import java.io.File; import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class ChangeDataModel extends TestHelper { public class ChangeDataModel extends TestHelper {
private static final File TestJar = new File("test" + JAR_FILE_EXT); private static final File TestJar = new File("test" + JAR_FILE_EXT);
...@@ -54,22 +52,6 @@ public class ChangeDataModel extends TestHelper { ...@@ -54,22 +52,6 @@ public class ChangeDataModel extends TestHelper {
throw new Error("unsupported data model"); throw new Error("unsupported data model");
} }
// test dual mode systems
if (isDualMode) {
// albeit dual mode we may not have the 64 bit components present
if (dualModePresent()) {
// 32-bit -> 64-bit
checkExecCount(javaCmd, "-d64");
// 64-bit -> 32-bit
checkExecCount(java64Cmd, "-d32");
checkAcceptance(javaCmd, "-d64");
checkAcceptance(java64Cmd, "-d32");
} else {
System.out.println("Warning: no 64-bit components found;" +
" only one data model tested.");
}
} else {
// Negative tests: ensure that non-dual mode systems reject the // Negative tests: ensure that non-dual mode systems reject the
// complementary (other) data model // complementary (other) data model
if (is32Bit) { if (is32Bit) {
...@@ -80,24 +62,6 @@ public class ChangeDataModel extends TestHelper { ...@@ -80,24 +62,6 @@ public class ChangeDataModel extends TestHelper {
throw new Error("unsupported data model"); throw new Error("unsupported data model");
} }
} }
}
static void checkExecCount(String cmd, String dmodel) {
Map<String, String> envMap = new HashMap<>();
envMap.put(JLDEBUG_KEY, "true");
TestResult tr = doExec(envMap, javaCmd, "-d64",
"-jar", TestJar.getAbsolutePath());
int count = 0;
for (String x : tr.testOutput) {
if (x.contains(EXPECTED_MARKER)) {
count++;
if (count > 1) {
System.out.println(tr);
throw new RuntimeException("Maximum exec count of 1 execeeded");
}
}
}
}
static void checkAcceptance(String cmd, String dmodel) { static void checkAcceptance(String cmd, String dmodel) {
TestResult tr = doExec(cmd, dmodel, "-jar", TestJar.getAbsolutePath()); TestResult tr = doExec(cmd, dmodel, "-jar", TestJar.getAbsolutePath());
......
/* /*
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @bug 4780570 4731671 6354700 6367077 6670965 4882974 * @bug 4780570 4731671 6354700 6367077 6670965 4882974
* @summary Checks for LD_LIBRARY_PATH and execution on *nixes * @summary Checks for LD_LIBRARY_PATH and execution on *nixes
* @compile -XDignore.symbol.file ExecutionEnvironment.java * @compile -XDignore.symbol.file ExecutionEnvironment.java
* @run main ExecutionEnvironment * @run main/othervm ExecutionEnvironment
*/ */
/* /*
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
* b. LD_LIBRARY_PATH32 is ignored if set * b. LD_LIBRARY_PATH32 is ignored if set
* 5. no extra symlink exists on Solaris ie. * 5. no extra symlink exists on Solaris ie.
* jre/lib/$arch/libjvm.so -> client/libjvm.so * jre/lib/$arch/libjvm.so -> client/libjvm.so
* 6. Since 32-bit Solaris is no longer supported we continue to ensure that
* the appropriate paths are ignored or used, additionally we also test to
* ensure the 64-bit isadir exists and contains appropriate links.
* TODO: * TODO:
* a. perhaps we need to add a test to audit all environment variables are * a. perhaps we need to add a test to audit all environment variables are
* in pristine condition after the launch, there may be a few that the * in pristine condition after the launch, there may be a few that the
...@@ -54,10 +57,16 @@ ...@@ -54,10 +57,16 @@
*/ */
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static java.nio.file.LinkOption.*;
import java.util.regex.Pattern;
public class ExecutionEnvironment extends TestHelper { public class ExecutionEnvironment extends TestHelper {
...@@ -80,13 +89,14 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -80,13 +89,14 @@ public class ExecutionEnvironment extends TestHelper {
static final File testJarFile = new File("EcoFriendly.jar"); static final File testJarFile = new File("EcoFriendly.jar");
static int errors = 0;
static int passes = 0;
static final String LIBJVM = TestHelper.isWindows static final String LIBJVM = TestHelper.isWindows
? "jvm.dll" ? "jvm.dll"
: "libjvm" + (TestHelper.isMacOSX ? ".dylib" : ".so"); : "libjvm" + (TestHelper.isMacOSX ? ".dylib" : ".so");
public ExecutionEnvironment() {
createTestJar();
}
static void createTestJar() { static void createTestJar() {
try { try {
List<String> codeList = new ArrayList<>(); List<String> codeList = new ArrayList<>();
...@@ -111,13 +121,17 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -111,13 +121,17 @@ public class ExecutionEnvironment extends TestHelper {
throw new RuntimeException(fnfe); throw new RuntimeException(fnfe);
} }
} }
private void flagError(TestResult tr, String message) {
System.err.println(tr);
throw new RuntimeException(message);
}
/* /*
* tests if the launcher pollutes the LD_LIBRARY_PATH variables ie. there * tests if the launcher pollutes the LD_LIBRARY_PATH variables ie. there
* should not be any new variables or pollution/mutations of any kind, the * should not be any new variables or pollution/mutations of any kind, the
* environment should be pristine. * environment should be pristine.
*/ */
private static void ensureEcoFriendly() { @Test
void testEcoFriendly() {
TestResult tr = null; TestResult tr = null;
Map<String, String> env = new HashMap<>(); Map<String, String> env = new HashMap<>();
...@@ -129,17 +143,12 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -129,17 +143,12 @@ public class ExecutionEnvironment extends TestHelper {
tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath());
if (!tr.isNotZeroOutput()) { if (!tr.isNotZeroOutput()) {
System.out.println(tr); flagError(tr, "Error: No output at all. Did the test execute ?");
throw new RuntimeException("Error: No output at all. Did the test execute ?");
} }
for (String x : LD_PATH_STRINGS) { for (String x : LD_PATH_STRINGS) {
if (!tr.contains(x)) { if (!tr.contains(x)) {
System.out.println("FAIL: did not get <" + x + ">"); flagError(tr, "FAIL: did not get <" + x + ">");
System.out.println(tr);
errors++;
} else {
passes++;
} }
} }
} }
...@@ -148,19 +157,15 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -148,19 +157,15 @@ public class ExecutionEnvironment extends TestHelper {
* ensures that there are no execs as long as we are in the same * ensures that there are no execs as long as we are in the same
* data model * data model
*/ */
static void ensureNoExec() { @Test
void testNoExec() {
Map<String, String> env = new HashMap<>(); Map<String, String> env = new HashMap<>();
env.put(JLDEBUG_KEY, "true"); env.put(JLDEBUG_KEY, "true");
TestResult tr = doExec(env, javaCmd, "-version"); TestResult tr = doExec(env, javaCmd, "-version");
if (tr.testOutput.contains(EXPECTED_MARKER)) { if (tr.testOutput.contains(EXPECTED_MARKER)) {
System.out.println("FAIL: EnsureNoExecs: found expected warning <" + flagError(tr, "testNoExec: found warning <" + EXPECTED_MARKER +
EXPECTED_MARKER +
"> the process execing ?"); "> the process execing ?");
errors++;
} else {
passes++;
} }
return;
} }
/* /*
...@@ -173,8 +178,8 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -173,8 +178,8 @@ public class ExecutionEnvironment extends TestHelper {
* For Solaris 64-bit * For Solaris 64-bit
* * The LD_LIBRARY_PATH_64 should override LD_LIBRARY_PATH if specified * * The LD_LIBRARY_PATH_64 should override LD_LIBRARY_PATH if specified
*/ */
@Test
static void verifyJavaLibraryPath() { void testJavaLibraryPath() {
TestResult tr = null; TestResult tr = null;
Map<String, String> env = new HashMap<>(); Map<String, String> env = new HashMap<>();
...@@ -200,88 +205,33 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -200,88 +205,33 @@ public class ExecutionEnvironment extends TestHelper {
env.put(pairs[0], pairs[1]); env.put(pairs[0], pairs[1]);
} }
// verify the override occurs, since we know the invocation always // verify the override occurs for 64-bit system
// uses by default is 32-bit, therefore we also set the test
// expectation to be the same.
tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath());
verifyJavaLibraryPathOverride(tr, true);
// try changing the model from 32 to 64 bit
if (dualModePresent() && is32Bit) {
// verify the override occurs
env.clear();
for (String x : LD_PATH_STRINGS) {
String pairs[] = x.split("=");
env.put(pairs[0], pairs[1]);
}
tr = doExec(env, javaCmd, "-d64", "-jar",
testJarFile.getAbsolutePath());
verifyJavaLibraryPathOverride(tr, false); verifyJavaLibraryPathOverride(tr, false);
// no override
env.clear();
env.put(LD_LIBRARY_PATH, LD_LIBRARY_PATH_VALUE);
tr = doExec(env, javaCmd, "-jar",
testJarFile.getAbsolutePath());
verifyJavaLibraryPathGeneric(tr);
}
// try changing the model from 64 to 32 bit
if (java64Cmd != null && is64Bit) {
// verify the override occurs
env.clear();
for (String x : LD_PATH_STRINGS) {
String pairs[] = x.split("=");
env.put(pairs[0], pairs[1]);
}
tr = doExec(env, java64Cmd, "-d32", "-jar",
testJarFile.getAbsolutePath());
verifyJavaLibraryPathOverride(tr, true);
// no override
env.clear();
env.put(LD_LIBRARY_PATH, LD_LIBRARY_PATH_VALUE);
tr = doExec(env, java64Cmd, "-d32", "-jar",
testJarFile.getAbsolutePath());
verifyJavaLibraryPathGeneric(tr);
}
} }
} }
private static void verifyJavaLibraryPathGeneric(TestResult tr) { private void verifyJavaLibraryPathGeneric(TestResult tr) {
if (!tr.matches("java.library.path=.*" + LD_LIBRARY_PATH_VALUE + ".*")) { if (!tr.matches("java.library.path=.*" + LD_LIBRARY_PATH_VALUE + ".*")) {
System.out.print("FAIL: verifyJavaLibraryPath: "); flagError(tr, "testJavaLibraryPath: java.library.path does not contain " +
System.out.println(" java.library.path does not contain " +
LD_LIBRARY_PATH_VALUE); LD_LIBRARY_PATH_VALUE);
System.out.println(tr);
errors++;
} else {
passes++;
} }
} }
private static void verifyJavaLibraryPathOverride(TestResult tr, private void verifyJavaLibraryPathOverride(TestResult tr,
boolean is32Bit) { boolean is32Bit) {
// make sure the 32/64 bit value exists // make sure the 32/64 bit value exists
if (!tr.matches("java.library.path=.*" + if (!tr.matches("java.library.path=.*" +
(is32Bit ? LD_LIBRARY_PATH_32_VALUE : LD_LIBRARY_PATH_64_VALUE) + ".*")) { (is32Bit ? LD_LIBRARY_PATH_32_VALUE : LD_LIBRARY_PATH_64_VALUE) + ".*")) {
System.out.print("FAIL: verifyJavaLibraryPathOverride: "); flagError(tr, "verifyJavaLibraryPathOverride: " +
System.out.println(" java.library.path does not contain " + " java.library.path does not contain " +
(is32Bit ? LD_LIBRARY_PATH_32_VALUE : LD_LIBRARY_PATH_64_VALUE)); (is32Bit ? LD_LIBRARY_PATH_32_VALUE : LD_LIBRARY_PATH_64_VALUE));
System.out.println(tr);
errors++;
} else {
passes++;
} }
// make sure the generic value is absent // make sure the generic value is absent
if (tr.matches("java.library.path=.*" + LD_LIBRARY_PATH_VALUE + ".*")) { if (!tr.notMatches("java.library.path=.*" + LD_LIBRARY_PATH_VALUE + ".*")) {
System.out.print("FAIL: verifyJavaLibraryPathOverride: "); flagError(tr, "verifyJavaLibraryPathOverride: " +
System.out.println(" java.library.path contains " + " java.library.path contains " + LD_LIBRARY_PATH_VALUE);
LD_LIBRARY_PATH_VALUE);
System.out.println(tr);
errors++;
} else {
passes++;
} }
} }
...@@ -289,34 +239,28 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -289,34 +239,28 @@ public class ExecutionEnvironment extends TestHelper {
* ensures we have indeed exec'ed the correct vm of choice, all VMs support * ensures we have indeed exec'ed the correct vm of choice, all VMs support
* -server, however 32-bit VMs support -client and -server. * -server, however 32-bit VMs support -client and -server.
*/ */
static void verifyVmSelection() { @Test
void testVmSelection() {
TestResult tr = null; TestResult tr = null;
if (is32Bit) { if (is32Bit) {
tr = doExec(javaCmd, "-client", "-version"); tr = doExec(javaCmd, "-client", "-version");
if (!tr.matches(".*Client VM.*")) { if (!tr.matches(".*Client VM.*")) {
System.out.println("FAIL: the expected vm -client did not launch"); flagError(tr, "the expected vm -client did not launch");
System.out.println(tr);
errors++;
} else {
passes++;
} }
} }
tr = doExec(javaCmd, "-server", "-version"); tr = doExec(javaCmd, "-server", "-version");
if (!tr.matches(".*Server VM.*")) { if (!tr.matches(".*Server VM.*")) {
System.out.println("FAIL: the expected vm -server did not launch"); flagError(tr, "the expected vm -server did not launch");
System.out.println(tr);
errors++;
} else {
passes++;
} }
} }
/* /*
* checks to see there is no extra libjvm.so than needed * checks to see there is no extra libjvm.so than needed
*/ */
static void verifyNoSymLink() { @Test
void testNoSymLink() {
if (is64Bit) { if (is64Bit) {
return; return;
} }
...@@ -326,31 +270,65 @@ public class ExecutionEnvironment extends TestHelper { ...@@ -326,31 +270,65 @@ public class ExecutionEnvironment extends TestHelper {
symLink = new File(JAVAHOME, libPathPrefix + symLink = new File(JAVAHOME, libPathPrefix +
getJreArch() + "/" + LIBJVM); getJreArch() + "/" + LIBJVM);
if (symLink.exists()) { if (symLink.exists()) {
System.out.println("FAIL: The symlink exists " + throw new RuntimeException("symlink exists " + symLink.getAbsolutePath());
symLink.getAbsolutePath());
errors++;
} else {
passes++;
} }
} }
/*
* verify if all the symlinks in the images are created correctly,
* only on solaris, this test works only on images.
*/
@Test
void testSymLinks() throws Exception {
if (!isSolaris)
return;
verifySymLinks(JAVA_BIN);
verifySymLinks(JAVA_JRE_BIN);
}
// exclude non-consequential binaries or scripts co-packaged in other
// build phases
private final String excludeRE =
".*jvisualvm.*" +
"|.*javaws.*" +
"|.*ControlPanel.*" +
"|.*java-rmi.cgi" +
"|.*jcontrol.*";
private final Pattern symlinkExcludes = Pattern.compile(excludeRE);
private void verifySymLinks(String bindir) throws IOException {
File binDir = new File(bindir);
System.err.println("verifying links in: " + bindir);
File isaDir = new File(binDir, getArch()).getAbsoluteFile();
if (!isaDir.exists()) {
throw new RuntimeException("dir: " + isaDir + " does not exist");
}
try (DirectoryStream<Path> ds = Files.newDirectoryStream(binDir.toPath())) {
for (Path p : ds) {
if (symlinkExcludes.matcher(p.toString()).matches() ||
Files.isDirectory(p, NOFOLLOW_LINKS)) {
continue;
}
Path link = new File(isaDir, p.getFileName().toString()).toPath();
if (Files.isSymbolicLink(link)) {
Path target = Files.readSymbolicLink(link);
if (target.startsWith("..") && p.endsWith(target.getFileName())) {
// System.out.println(target + " OK");
continue;
}
System.err.println("target:" + target);
System.err.println("file:" + p);
}
throw new RuntimeException("could not find link to " + p);
}
}
}
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
if (isWindows) { if (isWindows) {
System.out.println("Warning: noop on windows"); System.err.println("Warning: test not applicable to windows");
return; return;
} }
// create our test jar first ExecutionEnvironment ee = new ExecutionEnvironment();
createTestJar(); ee.run(args);
ensureNoExec();
verifyVmSelection();
ensureEcoFriendly();
verifyJavaLibraryPath();
verifyNoSymLink();
if (errors > 0) {
throw new Exception("ExecutionEnvironment: FAIL: with " +
errors + " errors and passes " + passes );
} else {
System.out.println("ExecutionEnvironment: PASS " + passes);
}
} }
} }
...@@ -405,7 +405,7 @@ public class FXLauncherTest extends TestHelper { ...@@ -405,7 +405,7 @@ public class FXLauncherTest extends TestHelper {
} }
} else { } else {
System.err.println("Warning: JavaFX components missing or not supported"); System.err.println("Warning: JavaFX components missing or not supported");
System.err.println(" test passes vacuosly."); System.err.println(" test passes vacuously.");
} }
} }
} }
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -64,16 +64,10 @@ public class RunpathTest extends TestHelper { ...@@ -64,16 +64,10 @@ public class RunpathTest extends TestHelper {
} }
void testRpath() { void testRpath() {
if (isDualMode && is64Bit) {
String expectedRpath = ".*RPATH.*\\$ORIGIN/../../lib/" + getJreArch()
+ ":\\$ORIGIN/../../jre/lib/" + getJreArch() + ".*";
elfCheck(java64Cmd, expectedRpath);
} else {
String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch() String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch()
+ ":\\$ORIGIN/../jre/lib/" + getJreArch() + ".*"; + ":\\$ORIGIN/../jre/lib/" + getJreArch() + ".*";
elfCheck(javaCmd, expectedRpath); elfCheck(javaCmd, expectedRpath);
} }
}
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
if (isSolaris || isLinux) { if (isSolaris || isLinux) {
......
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
*/ */
/* /*
* 7029048: test for LD_LIBRARY_PATH set to different paths pointing which may * 7029048: test for LD_LIBRARY_PATH set to different paths which may or
* contain a libjvm.so and may not, but we test to ensure that the launcher * may not contain a libjvm.so, but we test to ensure that the launcher
* behaves correctly in all cases. * behaves correctly in all cases.
*/ */
import java.io.File; import java.io.File;
...@@ -50,8 +50,6 @@ public class Test7029048 extends TestHelper { ...@@ -50,8 +50,6 @@ public class Test7029048 extends TestHelper {
private static final String LIBJVM = ExecutionEnvironment.LIBJVM; private static final String LIBJVM = ExecutionEnvironment.LIBJVM;
private static final String LD_LIBRARY_PATH = private static final String LD_LIBRARY_PATH =
ExecutionEnvironment.LD_LIBRARY_PATH; ExecutionEnvironment.LD_LIBRARY_PATH;
private static final String LD_LIBRARY_PATH_32 =
ExecutionEnvironment.LD_LIBRARY_PATH_32;
private static final String LD_LIBRARY_PATH_64 = private static final String LD_LIBRARY_PATH_64 =
ExecutionEnvironment.LD_LIBRARY_PATH_64; ExecutionEnvironment.LD_LIBRARY_PATH_64;
...@@ -70,24 +68,8 @@ public class Test7029048 extends TestHelper { ...@@ -70,24 +68,8 @@ public class Test7029048 extends TestHelper {
private static final File dstClientDir = new File(dstLibArchDir, "client"); private static final File dstClientDir = new File(dstLibArchDir, "client");
private static final File dstClientLibjvm = new File(dstClientDir, LIBJVM); private static final File dstClientLibjvm = new File(dstClientDir, LIBJVM);
// used primarily to test the solaris variants in dual mode
private static final File dstOtherArchDir;
private static final File dstOtherServerDir;
private static final File dstOtherServerLibjvm;
private static final Map<String, String> env = new HashMap<>(); private static final Map<String, String> env = new HashMap<>();
static {
if (isDualMode) {
dstOtherArchDir = new File(dstLibDir, getComplementaryJreArch());
dstOtherServerDir = new File(dstOtherArchDir, "server");
dstOtherServerLibjvm = new File(dstOtherServerDir, LIBJVM);
} else {
dstOtherArchDir = null;
dstOtherServerDir = null;
dstOtherServerLibjvm = null;
}
}
static String getValue(String name, List<String> in) { static String getValue(String name, List<String> in) {
for (String x : in) { for (String x : in) {
...@@ -99,45 +81,20 @@ public class Test7029048 extends TestHelper { ...@@ -99,45 +81,20 @@ public class Test7029048 extends TestHelper {
return null; return null;
} }
static void run(boolean want32, String dflag, Map<String, String> env, static void run(Map<String, String> env,
int nLLPComponents, String caseID) { int nLLPComponents, String caseID) {
final boolean want64 = want32 == false;
env.put(ExecutionEnvironment.JLDEBUG_KEY, "true"); env.put(ExecutionEnvironment.JLDEBUG_KEY, "true");
List<String> cmdsList = new ArrayList<>(); List<String> cmdsList = new ArrayList<>();
cmdsList.add(javaCmd);
// only for a dual-mode system
if (want64 && isDualMode) {
cmdsList.add(java64Cmd);
} else {
cmdsList.add(javaCmd); // a 32-bit java command for all
}
/*
* empty or null strings can confuse the ProcessBuilder. A null flag
* indicates that the appropriate data model is enforced on the chosen
* launcher variant.
*/
if (dflag != null) {
cmdsList.add(dflag);
} else {
cmdsList.add(want32 ? "-d32" : "-d64");
}
cmdsList.add("-server"); cmdsList.add("-server");
cmdsList.add("-jar"); cmdsList.add("-jar");
cmdsList.add(ExecutionEnvironment.testJarFile.getAbsolutePath()); cmdsList.add(ExecutionEnvironment.testJarFile.getAbsolutePath());
String[] cmds = new String[cmdsList.size()]; String[] cmds = new String[cmdsList.size()];
TestResult tr = doExec(env, cmdsList.toArray(cmds)); TestResult tr = doExec(env, cmdsList.toArray(cmds));
System.out.println(tr);
analyze(tr, nLLPComponents, caseID); analyze(tr, nLLPComponents, caseID);
} }
// no cross launch, ie. no change to the data model.
static void run(Map<String, String> env, int nLLPComponents, String caseID)
throws IOException {
boolean want32 = is32Bit;
run(want32, null, env, nLLPComponents, caseID);
}
static void analyze(TestResult tr, int nLLPComponents, String caseID) { static void analyze(TestResult tr, int nLLPComponents, String caseID) {
String envValue = getValue(LD_LIBRARY_PATH, tr.testOutput); String envValue = getValue(LD_LIBRARY_PATH, tr.testOutput);
/* /*
...@@ -192,10 +149,6 @@ public class Test7029048 extends TestHelper { ...@@ -192,10 +149,6 @@ public class Test7029048 extends TestHelper {
copyFile(srcLibjvmSo, dstServerLibjvm); copyFile(srcLibjvmSo, dstServerLibjvm);
// does not matter if it is client or a server // does not matter if it is client or a server
copyFile(srcLibjvmSo, dstClientLibjvm); copyFile(srcLibjvmSo, dstClientLibjvm);
// does not matter if the arch do not match either
if (isDualMode) {
copyFile(srcLibjvmSo, dstOtherServerLibjvm);
}
desc = "LD_LIBRARY_PATH should be set"; desc = "LD_LIBRARY_PATH should be set";
break; break;
case LLP_SET_EMPTY_PATH: case LLP_SET_EMPTY_PATH:
...@@ -211,14 +164,6 @@ public class Test7029048 extends TestHelper { ...@@ -211,14 +164,6 @@ public class Test7029048 extends TestHelper {
Files.deleteIfExists(dstServerLibjvm.toPath()); Files.deleteIfExists(dstServerLibjvm.toPath());
} }
if (isDualMode) {
if (!dstOtherServerDir.exists()) {
Files.createDirectories(dstOtherServerDir.toPath());
} else {
Files.deleteIfExists(dstOtherServerLibjvm.toPath());
}
}
desc = "LD_LIBRARY_PATH should not be set"; desc = "LD_LIBRARY_PATH should not be set";
break; break;
case LLP_SET_NON_EXISTENT_PATH: case LLP_SET_NON_EXISTENT_PATH:
...@@ -245,40 +190,14 @@ public class Test7029048 extends TestHelper { ...@@ -245,40 +190,14 @@ public class Test7029048 extends TestHelper {
env.put(LD_LIBRARY_PATH, dstClientDir.getAbsolutePath()); env.put(LD_LIBRARY_PATH, dstClientDir.getAbsolutePath());
run(env, v.value + 1, "Case 2: " + desc); run(env, v.value + 1, "Case 2: " + desc);
if (!isDualMode) { if (isSolaris) {
continue; // nothing more to do for Linux
}
// Tests applicable only to solaris.
// initialize test variables for dual mode operations
final File dst32ServerDir = is32Bit
? dstServerDir
: dstOtherServerDir;
final File dst64ServerDir = is64Bit
? dstServerDir
: dstOtherServerDir;
/* /*
* Case 3: set the appropriate LLP_XX flag, * Case 3: set the appropriate LLP_XX flag,
* java32 -d32, LLP_32 is relevant, LLP_64 is ignored
* java64 -d64, LLP_64 is relevant, LLP_32 is ignored * java64 -d64, LLP_64 is relevant, LLP_32 is ignored
*/ */
env.clear(); env.clear();
env.put(LD_LIBRARY_PATH_32, dst32ServerDir.getAbsolutePath()); env.put(LD_LIBRARY_PATH_64, dstServerDir.getAbsolutePath());
env.put(LD_LIBRARY_PATH_64, dst64ServerDir.getAbsolutePath()); run(env, v.value + 1, "Case 3: " + desc);
run(is32Bit, null, env, v.value + 1, "Case 3: " + desc);
/*
* Case 4: we are in dual mode environment, running 64-bit then
* we have the following scenarios:
* java32 -d64, LLP_64 is relevant, LLP_32 is ignored
* java64 -d32, LLP_32 is relevant, LLP_64 is ignored
*/
if (dualModePresent()) {
run(true, "-d64", env, v.value + 1, "Case 4A: " + desc);
run(false,"-d32", env, v.value + 1, "Case 4B: " + desc);
} }
} }
return; return;
...@@ -297,9 +216,6 @@ public class Test7029048 extends TestHelper { ...@@ -297,9 +216,6 @@ public class Test7029048 extends TestHelper {
if (errors > 0) { if (errors > 0) {
throw new Exception("Test7029048: FAIL: with " throw new Exception("Test7029048: FAIL: with "
+ errors + " errors and passes " + passes); + errors + " errors and passes " + passes);
} else if (dualModePresent() && passes < 15) {
throw new Exception("Test7029048: FAIL: " +
"all tests did not run, expected " + 15 + " got " + passes);
} else if (isSolaris && passes < 9) { } else if (isSolaris && passes < 9) {
throw new Exception("Test7029048: FAIL: " + throw new Exception("Test7029048: FAIL: " +
"all tests did not run, expected " + 9 + " got " + passes); "all tests did not run, expected " + 9 + " got " + passes);
......
/* /*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -66,10 +66,10 @@ public class TestHelper { ...@@ -66,10 +66,10 @@ public class TestHelper {
static final String JAVAHOME = System.getProperty("java.home"); static final String JAVAHOME = System.getProperty("java.home");
static final String JAVA_BIN; static final String JAVA_BIN;
static final String JAVA_JRE_BIN;
static final boolean isSDK = JAVAHOME.endsWith("jre"); static final boolean isSDK = JAVAHOME.endsWith("jre");
static final String javaCmd; static final String javaCmd;
static final String javawCmd; static final String javawCmd;
static final String java64Cmd;
static final String javacCmd; static final String javacCmd;
static final String jarCmd; static final String jarCmd;
...@@ -88,7 +88,7 @@ public class TestHelper { ...@@ -88,7 +88,7 @@ public class TestHelper {
System.getProperty("os.name", "unknown").startsWith("SunOS"); System.getProperty("os.name", "unknown").startsWith("SunOS");
static final boolean isLinux = static final boolean isLinux =
System.getProperty("os.name", "unknown").startsWith("Linux"); System.getProperty("os.name", "unknown").startsWith("Linux");
static final boolean isDualMode = isSolaris;
static final boolean isSparc = System.getProperty("os.arch").startsWith("sparc"); static final boolean isSparc = System.getProperty("os.arch").startsWith("sparc");
// make a note of the golden default locale // make a note of the golden default locale
...@@ -124,9 +124,12 @@ public class TestHelper { ...@@ -124,9 +124,12 @@ public class TestHelper {
throw new RuntimeException("arch model is not 32 or 64 bit ?"); throw new RuntimeException("arch model is not 32 or 64 bit ?");
} }
compiler = ToolProvider.getSystemJavaCompiler(); compiler = ToolProvider.getSystemJavaCompiler();
File binDir = (isSDK) ? new File((new File(JAVAHOME)).getParentFile(), "bin") File binDir = (isSDK)
? new File((new File(JAVAHOME)).getParentFile(), "bin")
: new File(JAVAHOME, "bin"); : new File(JAVAHOME, "bin");
JAVA_BIN = binDir.getAbsolutePath(); JAVA_BIN = binDir.getAbsolutePath();
JAVA_JRE_BIN = new File((new File(JAVAHOME)).getParentFile(),
(isSDK) ? "jre/bin" : "bin").getAbsolutePath();
File javaCmdFile = (isWindows) File javaCmdFile = (isWindows)
? new File(binDir, "java.exe") ? new File(binDir, "java.exe")
: new File(binDir, "java"); : new File(binDir, "java");
...@@ -165,17 +168,6 @@ public class TestHelper { ...@@ -165,17 +168,6 @@ public class TestHelper {
throw new RuntimeException("java <" + javacCmd + throw new RuntimeException("java <" + javacCmd +
"> must exist and should be executable"); "> must exist and should be executable");
} }
if (isSolaris) {
File sparc64BinDir = new File(binDir,isSparc ? "sparcv9" : "amd64");
File java64CmdFile= new File(sparc64BinDir, "java");
if (java64CmdFile.exists() && java64CmdFile.canExecute()) {
java64Cmd = java64CmdFile.getAbsolutePath();
} else {
java64Cmd = null;
}
} else {
java64Cmd = null;
}
} }
void run(String[] args) throws Exception { void run(String[] args) throws Exception {
int passed = 0, failed = 0; int passed = 0, failed = 0;
...@@ -194,7 +186,13 @@ public class TestHelper { ...@@ -194,7 +186,13 @@ public class TestHelper {
System.out.printf("Passed: %d, Failed: %d, ExitValue: %d%n", System.out.printf("Passed: %d, Failed: %d, ExitValue: %d%n",
passed, failed, testExitValue); passed, failed, testExitValue);
} catch (Throwable ex) { } catch (Throwable ex) {
System.out.printf("Test %s failed: %s %n", m, ex.getCause()); System.out.printf("Test %s failed: %s %n", m, ex);
System.out.println("----begin detailed exceptions----");
ex.printStackTrace(System.out);
for (Throwable t : ex.getSuppressed()) {
t.printStackTrace(System.out);
}
System.out.println("----end detailed exceptions----");
failed++; failed++;
} }
} }
...@@ -209,13 +207,6 @@ public class TestHelper { ...@@ -209,13 +207,6 @@ public class TestHelper {
} }
} }
/*
* is a dual mode available in the test jdk
*/
static boolean dualModePresent() {
return isDualMode && java64Cmd != null;
}
/* /*
* usually the jre/lib/arch-name is the same as os.arch, except for x86. * usually the jre/lib/arch-name is the same as os.arch, except for x86.
*/ */
...@@ -223,28 +214,9 @@ public class TestHelper { ...@@ -223,28 +214,9 @@ public class TestHelper {
String arch = System.getProperty("os.arch"); String arch = System.getProperty("os.arch");
return arch.equals("x86") ? "i386" : arch; return arch.equals("x86") ? "i386" : arch;
} }
static String getArch() {
/* return System.getProperty("os.arch");
* get the complementary jre arch ie. if sparc then return sparcv9 and
* vice-versa.
*/
static String getComplementaryJreArch() {
String arch = System.getProperty("os.arch");
if (arch != null) {
switch (arch) {
case "sparc":
return "sparcv9";
case "sparcv9":
return "sparc";
case "x86":
return "amd64";
case "amd64":
return "i386";
}
} }
return null;
}
static File getClassFile(File javaFile) { static File getClassFile(File javaFile) {
String s = javaFile.getAbsolutePath().replace(JAVA_FILE_EXT, CLASS_FILE_EXT); String s = javaFile.getAbsolutePath().replace(JAVA_FILE_EXT, CLASS_FILE_EXT);
return new File(s); return new File(s);
...@@ -623,6 +595,16 @@ public class TestHelper { ...@@ -623,6 +595,16 @@ public class TestHelper {
appendError("string <" + stringToMatch + "> not found"); appendError("string <" + stringToMatch + "> not found");
return false; return false;
} }
boolean notMatches(String stringToMatch) {
for (String x : testOutput) {
if (!x.matches(stringToMatch)) {
return true;
}
}
appendError("string <" + stringToMatch + "> found");
return false;
}
} }
/** /**
* Indicates that the annotated method is a test method. * Indicates that the annotated method is a test method.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册