Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
443f7cf4
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
443f7cf4
编写于
1月 11, 2013
作者:
S
sherman
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
f49b3587
159985af
变更
107
展开全部
隐藏空白更改
内联
并排
Showing
107 changed file
with
1151 addition
and
288 deletion
+1151
-288
make/docs/Makefile
make/docs/Makefile
+1
-0
src/share/classes/java/text/DigitList.java
src/share/classes/java/text/DigitList.java
+128
-15
src/share/classes/sun/misc/FloatingDecimal.java
src/share/classes/sun/misc/FloatingDecimal.java
+29
-2
src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
...laris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
+11
-16
test/ProblemList.txt
test/ProblemList.txt
+3
-0
test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh
test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh
+6
-6
test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
...nt/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
+6
-6
test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
...t/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
+6
-7
test/java/io/FileOutputStream/FileOpen.sh
test/java/io/FileOutputStream/FileOpen.sh
+4
-2
test/java/io/Serializable/class/run.sh
test/java/io/Serializable/class/run.sh
+20
-16
test/java/io/Serializable/evolution/RenamePackage/run.sh
test/java/io/Serializable/evolution/RenamePackage/run.sh
+11
-4
test/java/io/Serializable/maskSyntheticModifier/run.sh
test/java/io/Serializable/maskSyntheticModifier/run.sh
+7
-3
test/java/io/Serializable/packageAccess/run.sh
test/java/io/Serializable/packageAccess/run.sh
+10
-5
test/java/io/Serializable/resolveClass/consTest/run.sh
test/java/io/Serializable/resolveClass/consTest/run.sh
+10
-5
test/java/io/Serializable/resolveClass/deserializeButton/run.sh
...ava/io/Serializable/resolveClass/deserializeButton/run.sh
+9
-5
test/java/io/Serializable/superclassDataLoss/run.sh
test/java/io/Serializable/superclassDataLoss/run.sh
+11
-5
test/java/io/Serializable/unnamedPackageSwitch/run.sh
test/java/io/Serializable/unnamedPackageSwitch/run.sh
+8
-3
test/java/lang/Class/getEnclosingClass/build.sh
test/java/lang/Class/getEnclosingClass/build.sh
+3
-2
test/java/lang/ClassLoader/Assert.sh
test/java/lang/ClassLoader/Assert.sh
+5
-1
test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
+6
-2
test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
+7
-2
test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh
test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh
+7
-2
test/java/lang/Thread/UncaughtExceptions.sh
test/java/lang/Thread/UncaughtExceptions.sh
+2
-2
test/java/lang/annotation/loaderLeak/LoaderLeak.sh
test/java/lang/annotation/loaderLeak/LoaderLeak.sh
+6
-2
test/java/lang/annotation/repeatingAnnotations/subpackage/Containee.java
...annotation/repeatingAnnotations/subpackage/Containee.java
+1
-0
test/java/lang/annotation/repeatingAnnotations/subpackage/InheritedContainee.java
...n/repeatingAnnotations/subpackage/InheritedContainee.java
+1
-0
test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh
test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh
+7
-1
test/java/lang/instrument/AppendToClassPathSetUp.sh
test/java/lang/instrument/AppendToClassPathSetUp.sh
+8
-2
test/java/lang/instrument/BootClassPath/BootClassPathTest.sh
test/java/lang/instrument/BootClassPath/BootClassPathTest.sh
+18
-9
test/java/lang/instrument/MakeJAR.sh
test/java/lang/instrument/MakeJAR.sh
+10
-5
test/java/lang/instrument/MakeJAR2.sh
test/java/lang/instrument/MakeJAR2.sh
+12
-6
test/java/lang/instrument/MakeJAR3.sh
test/java/lang/instrument/MakeJAR3.sh
+10
-4
test/java/lang/instrument/MakeJAR4.sh
test/java/lang/instrument/MakeJAR4.sh
+10
-4
test/java/lang/instrument/ManifestTest.sh
test/java/lang/instrument/ManifestTest.sh
+11
-5
test/java/lang/instrument/ParallelTransformerLoader.sh
test/java/lang/instrument/ParallelTransformerLoader.sh
+10
-4
test/java/lang/instrument/PremainClass/NoPremainAgent.sh
test/java/lang/instrument/PremainClass/NoPremainAgent.sh
+7
-1
test/java/lang/instrument/PremainClass/PremainClassTest.sh
test/java/lang/instrument/PremainClass/PremainClassTest.sh
+8
-2
test/java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh
.../java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh
+7
-1
test/java/lang/instrument/RedefineBigClass.sh
test/java/lang/instrument/RedefineBigClass.sh
+7
-1
test/java/lang/instrument/RedefineClassWithNativeMethod.sh
test/java/lang/instrument/RedefineClassWithNativeMethod.sh
+7
-1
test/java/lang/instrument/RedefineMethodAddInvoke.sh
test/java/lang/instrument/RedefineMethodAddInvoke.sh
+9
-3
test/java/lang/instrument/RedefineSetUp.sh
test/java/lang/instrument/RedefineSetUp.sh
+9
-3
test/java/lang/instrument/RetransformBigClass.sh
test/java/lang/instrument/RetransformBigClass.sh
+7
-1
test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh
...trument/appendToClassLoaderSearch/CircularityErrorTest.sh
+10
-5
test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
...g/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
+3
-2
test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
.../lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
+8
-2
test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh
...va/lang/instrument/appendToClassLoaderSearch/run_tests.sh
+8
-8
test/java/net/Authenticator/B4933582.sh
test/java/net/Authenticator/B4933582.sh
+2
-1
test/java/net/URL/B5086147.sh
test/java/net/URL/B5086147.sh
+1
-1
test/java/net/URL/runconstructor.sh
test/java/net/URL/runconstructor.sh
+2
-1
test/java/net/URLClassLoader/B5077773.sh
test/java/net/URLClassLoader/B5077773.sh
+2
-1
test/java/net/URLClassLoader/closetest/build.sh
test/java/net/URLClassLoader/closetest/build.sh
+12
-7
test/java/net/URLClassLoader/getresourceasstream/test.sh
test/java/net/URLClassLoader/getresourceasstream/test.sh
+1
-1
test/java/net/URLClassLoader/sealing/checksealed.sh
test/java/net/URLClassLoader/sealing/checksealed.sh
+3
-1
test/java/net/URLConnection/6212146/test.sh
test/java/net/URLConnection/6212146/test.sh
+1
-1
test/java/net/URLConnection/UNCTest.sh
test/java/net/URLConnection/UNCTest.sh
+1
-1
test/java/nio/charset/spi/basic.sh
test/java/nio/charset/spi/basic.sh
+3
-2
test/java/nio/file/Files/Misc.java
test/java/nio/file/Files/Misc.java
+1
-1
test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
+1
-1
test/java/rmi/registry/readTest/readTest.sh
test/java/rmi/registry/readTest/readTest.sh
+3
-3
test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
...urity/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
+6
-2
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
+6
-2
test/java/security/Security/signedfirst/Dyn.sh
test/java/security/Security/signedfirst/Dyn.sh
+5
-1
test/java/security/Security/signedfirst/Static.sh
test/java/security/Security/signedfirst/Static.sh
+5
-1
test/java/security/cert/CertificateFactory/slowstream.sh
test/java/security/cert/CertificateFactory/slowstream.sh
+5
-1
test/java/text/Format/DecimalFormat/TieRoundingTest.java
test/java/text/Format/DecimalFormat/TieRoundingTest.java
+411
-0
test/java/util/Formatter/Basic.sh
test/java/util/Formatter/Basic.sh
+3
-2
test/java/util/Locale/LocaleProviders.sh
test/java/util/Locale/LocaleProviders.sh
+7
-2
test/java/util/PluggableLocale/ExecTest.sh
test/java/util/PluggableLocale/ExecTest.sh
+6
-1
test/java/util/ServiceLoader/basic.sh
test/java/util/ServiceLoader/basic.sh
+3
-2
test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
+8
-4
test/java/util/prefs/PrefsSpi.sh
test/java/util/prefs/PrefsSpi.sh
+7
-4
test/javax/crypto/SecretKeyFactory/FailOverTest.sh
test/javax/crypto/SecretKeyFactory/FailOverTest.sh
+6
-1
test/javax/script/CommonSetup.sh
test/javax/script/CommonSetup.sh
+7
-2
test/javax/script/ProviderTest.sh
test/javax/script/ProviderTest.sh
+1
-1
test/javax/security/auth/Subject/doAs/Test.sh
test/javax/security/auth/Subject/doAs/Test.sh
+2
-1
test/lib/security/java.policy/Ext_AllPolicy.sh
test/lib/security/java.policy/Ext_AllPolicy.sh
+4
-1
test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
...agement/jmxremote/bootstrap/PasswordFilePermissionTest.sh
+1
-1
test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
...gement/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
+1
-1
test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
+6
-4
test/sun/net/www/MarkResetTest.sh
test/sun/net/www/MarkResetTest.sh
+1
-1
test/sun/net/www/http/HttpClient/RetryPost.sh
test/sun/net/www/http/HttpClient/RetryPost.sh
+1
-1
test/sun/net/www/protocol/jar/B5105410.sh
test/sun/net/www/protocol/jar/B5105410.sh
+1
-1
test/sun/net/www/protocol/jar/jarbug/run.sh
test/sun/net/www/protocol/jar/jarbug/run.sh
+4
-4
test/sun/security/krb5/config/dns.sh
test/sun/security/krb5/config/dns.sh
+5
-2
test/sun/security/krb5/runNameEquals.sh
test/sun/security/krb5/runNameEquals.sh
+5
-1
test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
+1
-1
test/sun/security/pkcs11/KeyStore/Basic.sh
test/sun/security/pkcs11/KeyStore/Basic.sh
+5
-1
test/sun/security/pkcs11/KeyStore/ClientAuth.sh
test/sun/security/pkcs11/KeyStore/ClientAuth.sh
+5
-1
test/sun/security/pkcs11/KeyStore/Solaris.sh
test/sun/security/pkcs11/KeyStore/Solaris.sh
+5
-1
test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
+5
-1
test/sun/security/pkcs11/Provider/Login.sh
test/sun/security/pkcs11/Provider/Login.sh
+5
-1
test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
...rity/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
+9
-3
test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
...n/security/provider/PolicyFile/getinstance/getinstance.sh
+9
-5
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
...t/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
+2
-1
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
...net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
+7
-3
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
...et/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
+4
-2
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
...rotocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
+1
-1
test/sun/security/tools/keytool/autotest.sh
test/sun/security/tools/keytool/autotest.sh
+4
-1
test/sun/security/tools/keytool/printssl.sh
test/sun/security/tools/keytool/printssl.sh
+4
-1
test/sun/security/tools/keytool/readjar.sh
test/sun/security/tools/keytool/readjar.sh
+6
-5
test/sun/security/tools/keytool/standard.sh
test/sun/security/tools/keytool/standard.sh
+2
-1
test/sun/security/util/Oid/S11N.sh
test/sun/security/util/Oid/S11N.sh
+4
-1
test/sun/security/validator/certreplace.sh
test/sun/security/validator/certreplace.sh
+3
-2
test/sun/security/validator/samedn.sh
test/sun/security/validator/samedn.sh
+3
-2
test/tools/launcher/ClassPathWildCard.sh
test/tools/launcher/ClassPathWildCard.sh
+8
-4
test/tools/launcher/MultipleJRE.sh
test/tools/launcher/MultipleJRE.sh
+5
-1
未找到文件。
make/docs/Makefile
浏览文件 @
443f7cf4
...
...
@@ -207,6 +207,7 @@ COMMON_JAVADOCFLAGS = \
-quiet
\
-use
\
-keywords
\
-Xdoclint
:none
\
$(ADDITIONAL_JAVADOCFLAGS)
ifdef
OPENJDK
...
...
src/share/classes/java/text/DigitList.java
浏览文件 @
443f7cf4
/*
* Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, 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
...
...
@@ -41,6 +41,7 @@ package java.text;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.math.RoundingMode
;
import
sun.misc.FloatingDecimal
;
/**
* Digit List. Private to DecimalFormat.
...
...
@@ -62,7 +63,7 @@ import java.math.RoundingMode;
* derived by placing all the digits of the list to the right of the
* decimal point, by 10^exponent.
*
* @see
java.util.
Locale
* @see Locale
* @see Format
* @see NumberFormat
* @see DecimalFormat
...
...
@@ -286,14 +287,27 @@ final class DigitList implements Cloneable {
* fractional digits to be converted. If false, total digits.
*/
final
void
set
(
boolean
isNegative
,
double
source
,
int
maximumDigits
,
boolean
fixedPoint
)
{
set
(
isNegative
,
Double
.
toString
(
source
),
maximumDigits
,
fixedPoint
);
FloatingDecimal
fd
=
new
FloatingDecimal
(
source
);
boolean
hasBeenRoundedUp
=
fd
.
digitsRoundedUp
();
boolean
allDecimalDigits
=
fd
.
decimalDigitsExact
();
String
digitsString
=
fd
.
toJavaFormatString
();
set
(
isNegative
,
digitsString
,
hasBeenRoundedUp
,
allDecimalDigits
,
maximumDigits
,
fixedPoint
);
}
/**
* Generate a representation of the form DDDDD, DDDDD.DDDDD, or
* DDDDDE+/-DDDDD.
* @param roundedUp Boolean value indicating if the s digits were rounded-up.
* @param allDecimalDigits Boolean value indicating if the digits in s are
* an exact decimal representation of the double that was passed.
*/
final
void
set
(
boolean
isNegative
,
String
s
,
int
maximumDigits
,
boolean
fixedPoint
)
{
final
void
set
(
boolean
isNegative
,
String
s
,
boolean
roundedUp
,
boolean
allDecimalDigits
,
int
maximumDigits
,
boolean
fixedPoint
)
{
this
.
isNegative
=
isNegative
;
int
len
=
s
.
length
();
char
[]
source
=
getDataChars
(
len
);
...
...
@@ -346,7 +360,7 @@ final class DigitList implements Cloneable {
}
else
if
(-
decimalAt
==
maximumDigits
)
{
// If we round 0.0009 to 3 fractional digits, then we have to
// create a new one digit in the least significant location.
if
(
shouldRoundUp
(
0
))
{
if
(
shouldRoundUp
(
0
,
roundedUp
,
allDecimalDigits
))
{
count
=
1
;
++
decimalAt
;
digits
[
0
]
=
'1'
;
...
...
@@ -365,19 +379,26 @@ final class DigitList implements Cloneable {
// Eliminate digits beyond maximum digits to be displayed.
// Round up if appropriate.
round
(
fixedPoint
?
(
maximumDigits
+
decimalAt
)
:
maximumDigits
);
round
(
fixedPoint
?
(
maximumDigits
+
decimalAt
)
:
maximumDigits
,
roundedUp
,
allDecimalDigits
);
}
/**
* Round the representation to the given number of digits.
* @param maximumDigits The maximum number of digits to be shown.
* @param alreadyRounded Boolean indicating if rounding up already happened.
* @param allDecimalDigits Boolean indicating if the digits provide an exact
* representation of the value.
*
* Upon return, count will be less than or equal to maximumDigits.
*/
private
final
void
round
(
int
maximumDigits
)
{
private
final
void
round
(
int
maximumDigits
,
boolean
alreadyRounded
,
boolean
allDecimalDigits
)
{
// Eliminate digits beyond maximum digits to be displayed.
// Round up if appropriate.
if
(
maximumDigits
>=
0
&&
maximumDigits
<
count
)
{
if
(
shouldRoundUp
(
maximumDigits
))
{
if
(
shouldRoundUp
(
maximumDigits
,
alreadyRounded
,
allDecimalDigits
))
{
// Rounding up involved incrementing digits from LSD to MSD.
// In most cases this is simple, but in a worst case situation
// (9999..99) we have to adjust the decimalAt value.
...
...
@@ -423,8 +444,56 @@ final class DigitList implements Cloneable {
* @return true if digit <code>maximumDigits-1</code> should be
* incremented
*/
private
boolean
shouldRoundUp
(
int
maximumDigits
)
{
private
boolean
shouldRoundUp
(
int
maximumDigits
,
boolean
alreadyRounded
,
boolean
allDecimalDigits
)
{
if
(
maximumDigits
<
count
)
{
/*
* To avoid erroneous double-rounding or truncation when converting
* a binary double value to text, information about the exactness
* of the conversion result in FloatingDecimal, as well as any
* rounding done, is needed in this class.
*
* - For the HALF_DOWN, HALF_EVEN, HALF_UP rounding rules below:
* In the case of formating float or double, We must take into
* account what FloatingDecimal has done in the binary to decimal
* conversion.
*
* Considering the tie cases, FloatingDecimal may round-up the
* value (returning decimal digits equal to tie when it is below),
* or "truncate" the value to the tie while value is above it,
* or provide the exact decimal digits when the binary value can be
* converted exactly to its decimal representation given formating
* rules of FloatingDecimal ( we have thus an exact decimal
* representation of the binary value).
*
* - If the double binary value was converted exactly as a decimal
* value, then DigitList code must apply the expected rounding
* rule.
*
* - If FloatingDecimal already rounded up the decimal value,
* DigitList should neither round up the value again in any of
* the three rounding modes above.
*
* - If FloatingDecimal has truncated the decimal value to
* an ending '5' digit, DigitList should round up the value in
* all of the three rounding modes above.
*
*
* This has to be considered only if digit at maximumDigits index
* is exactly the last one in the set of digits, otherwise there are
* remaining digits after that position and we dont have to consider
* what FloatingDecimal did.
*
* - Other rounding modes are not impacted by these tie cases.
*
* - For other numbers that are always converted to exact digits
* (like BigInteger, Long, ...), the passed alreadyRounded boolean
* have to be set to false, and allDecimalDigits has to be set to
* true in the upper DigitList call stack, providing the right state
* for those situations..
*/
switch
(
roundingMode
)
{
case
UP:
for
(
int
i
=
maximumDigits
;
i
<
count
;
++
i
)
{
...
...
@@ -451,6 +520,13 @@ final class DigitList implements Cloneable {
break
;
case
HALF_UP:
if
(
digits
[
maximumDigits
]
>=
'5'
)
{
// We should not round up if the rounding digits position is
// exactly the last index and if digits were already rounded.
if
((
maximumDigits
==
(
count
-
1
))
&&
(
alreadyRounded
))
return
false
;
// Value was exactly at or was above tie. We must round up.
return
true
;
}
break
;
...
...
@@ -458,6 +534,21 @@ final class DigitList implements Cloneable {
if
(
digits
[
maximumDigits
]
>
'5'
)
{
return
true
;
}
else
if
(
digits
[
maximumDigits
]
==
'5'
)
{
if
(
maximumDigits
==
(
count
-
1
))
{
// The rounding position is exactly the last index.
if
(
allDecimalDigits
||
alreadyRounded
)
/* FloatingDecimal rounded up (value was below tie),
* or provided the exact list of digits (value was
* an exact tie). We should not round up, following
* the HALF_DOWN rounding rule.
*/
return
false
;
else
// Value was above the tie, we must round up.
return
true
;
}
// We must round up if it gives a non null digit after '5'.
for
(
int
i
=
maximumDigits
+
1
;
i
<
count
;
++
i
)
{
if
(
digits
[
i
]
!=
'0'
)
{
return
true
;
...
...
@@ -470,12 +561,32 @@ final class DigitList implements Cloneable {
if
(
digits
[
maximumDigits
]
>
'5'
)
{
return
true
;
}
else
if
(
digits
[
maximumDigits
]
==
'5'
)
{
for
(
int
i
=
maximumDigits
+
1
;
i
<
count
;
++
i
)
{
if
(
digits
[
i
]
!=
'0'
)
{
if
(
maximumDigits
==
(
count
-
1
))
{
// the rounding position is exactly the last index :
if
(
alreadyRounded
)
// If FloatingDecimal rounded up (value was below tie),
// then we should not round up again.
return
false
;
if
(!
allDecimalDigits
)
// Otherwise if the digits dont represent exact value,
// value was above tie and FloatingDecimal truncated
// digits to tie. We must round up.
return
true
;
else
{
// This is an exact tie value, and FloatingDecimal
// provided all of the exact digits. We thus apply
// HALF_EVEN rounding rule.
return
((
maximumDigits
>
0
)
&&
(
digits
[
maximumDigits
-
1
]
%
2
!=
0
));
}
}
else
{
// Rounds up if it gives a non null digit after '5'
for
(
int
i
=
maximumDigits
+
1
;
i
<
count
;
++
i
)
{
if
(
digits
[
i
]
!=
'0'
)
return
true
;
}
}
return
maximumDigits
>
0
&&
(
digits
[
maximumDigits
-
1
]
%
2
!=
0
);
}
break
;
case
UNNECESSARY:
...
...
@@ -542,7 +653,7 @@ final class DigitList implements Cloneable {
count
=
right
-
left
+
1
;
System
.
arraycopy
(
digits
,
left
,
digits
,
0
,
count
);
}
if
(
maximumDigits
>
0
)
round
(
maximumDigits
);
if
(
maximumDigits
>
0
)
round
(
maximumDigits
,
false
,
true
);
}
/**
...
...
@@ -559,7 +670,9 @@ final class DigitList implements Cloneable {
String
s
=
source
.
toString
();
extendDigits
(
s
.
length
());
set
(
isNegative
,
s
,
maximumDigits
,
fixedPoint
);
set
(
isNegative
,
s
,
false
,
true
,
maximumDigits
,
fixedPoint
);
}
/**
...
...
@@ -584,7 +697,7 @@ final class DigitList implements Cloneable {
count
=
right
+
1
;
if
(
maximumDigits
>
0
)
{
round
(
maximumDigits
);
round
(
maximumDigits
,
false
,
true
);
}
}
...
...
src/share/classes/sun/misc/FloatingDecimal.java
浏览文件 @
443f7cf4
/*
* Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, 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
...
...
@@ -41,6 +41,19 @@ public class FloatingDecimal{
boolean
fromHex
=
false
;
int
roundDir
=
0
;
// set by doubleValue
/*
* The fields below provides additional information about the result of
* the binary to decimal digits conversion done in dtoa() and roundup()
* methods. They are changed if needed by those two methods.
*/
// True if the dtoa() binary to decimal conversion was exact.
boolean
exactDecimalConversion
=
false
;
// True if the result of the binary to decimal conversion was rounded-up
// at the end of the conversion process, i.e. roundUp() method was called.
boolean
decimalDigitsRoundedUp
=
false
;
private
FloatingDecimal
(
boolean
negSign
,
int
decExponent
,
char
[]
digits
,
int
n
,
boolean
e
)
{
isNegative
=
negSign
;
...
...
@@ -396,6 +409,11 @@ public class FloatingDecimal{
// else fall through.
}
digits
[
i
]
=
(
char
)(
q
+
1
);
decimalDigitsRoundedUp
=
true
;
}
public
boolean
digitsRoundedUp
()
{
return
decimalDigitsRoundedUp
;
}
/*
...
...
@@ -751,6 +769,7 @@ public class FloatingDecimal{
digits
[
ndigit
++]
=
(
char
)(
'0'
+
q
);
}
lowDigitDifference
=
(
b
<<
1
)
-
tens
;
exactDecimalConversion
=
(
b
==
0
);
}
else
{
// still good! they're all longs!
long
b
=
(
fractBits
*
long5pow
[
B5
]
)
<<
B2
;
...
...
@@ -804,8 +823,10 @@ public class FloatingDecimal{
digits
[
ndigit
++]
=
(
char
)(
'0'
+
q
);
}
lowDigitDifference
=
(
b
<<
1
)
-
tens
;
exactDecimalConversion
=
(
b
==
0
);
}
}
else
{
FDBigInt
ZeroVal
=
new
FDBigInt
(
0
);
FDBigInt
tenSval
;
int
shiftBias
;
...
...
@@ -859,8 +880,10 @@ public class FloatingDecimal{
if
(
high
&&
low
){
Bval
.
lshiftMe
(
1
);
lowDigitDifference
=
Bval
.
cmp
(
tenSval
);
}
else
}
else
{
lowDigitDifference
=
0L
;
// this here only for flow analysis!
}
exactDecimalConversion
=
(
Bval
.
cmp
(
ZeroVal
)
==
0
);
}
this
.
decExponent
=
decExp
+
1
;
this
.
digits
=
digits
;
...
...
@@ -883,6 +906,10 @@ public class FloatingDecimal{
}
}
public
boolean
decimalDigitsExact
()
{
return
exactDecimalConversion
;
}
public
String
toString
(){
// most brain-dead version
...
...
src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
浏览文件 @
443f7cf4
...
...
@@ -52,10 +52,10 @@ class SolarisAclFileAttributeView
/**
* typedef struct ace {
* uid_t a_who;
* ui
tn32_t a_access_mar
k;
* ui
nt32_t a_access_mas
k;
* uint16_t a_flags;
* uint16_t a_type;
* } ac
t
_t;
* } ac
e
_t;
*/
private
static
final
short
SIZEOF_ACE_T
=
12
;
private
static
final
short
OFFSETOF_UID
=
0
;
...
...
@@ -209,21 +209,16 @@ class SolarisAclFileAttributeView
// map uid and flags to UserPrincipal
UnixUserPrincipals
.
User
who
=
null
;
if
(
uid
==
-
1
)
{
if
((
flags
&
ACE_OWNER
)
>
0
)
who
=
UnixUserPrincipals
.
SPECIAL_OWNER
;
if
((
flags
&
ACE_GROUP
)
>
0
)
who
=
UnixUserPrincipals
.
SPECIAL_GROUP
;
if
((
flags
&
ACE_EVERYONE
)
>
0
)
who
=
UnixUserPrincipals
.
SPECIAL_EVERYONE
;
if
(
who
==
null
)
throw
new
AssertionError
(
"ACE who not handled"
);
if
((
flags
&
ACE_OWNER
)
>
0
)
{
who
=
UnixUserPrincipals
.
SPECIAL_OWNER
;
}
else
if
((
flags
&
ACE_GROUP
)
>
0
)
{
who
=
UnixUserPrincipals
.
SPECIAL_GROUP
;
}
else
if
((
flags
&
ACE_EVERYONE
)
>
0
)
{
who
=
UnixUserPrincipals
.
SPECIAL_EVERYONE
;
}
else
if
((
flags
&
ACE_IDENTIFIER_GROUP
)
>
0
)
{
who
=
UnixUserPrincipals
.
fromGid
(
uid
);
}
else
{
// can be gid
if
((
flags
&
ACE_IDENTIFIER_GROUP
)
>
0
)
who
=
UnixUserPrincipals
.
fromGid
(
uid
);
else
who
=
UnixUserPrincipals
.
fromUid
(
uid
);
who
=
UnixUserPrincipals
.
fromUid
(
uid
);
}
AclEntryType
aceType
=
null
;
...
...
test/ProblemList.txt
浏览文件 @
443f7cf4
...
...
@@ -347,6 +347,9 @@ com/sun/jdi/ProcessAttachTest.sh generic-all
# jdk_util
# 8006090
java/util/Formatter/Basic.java generic-all
# Filed 6933803
java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all
...
...
test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh
浏览文件 @
443f7cf4
...
...
@@ -32,15 +32,15 @@
# @build DumpHeap
# @run shell DumpHeap.sh
#Set appropriate jdk
if
[
!
-z
"
${
TESTJAVA
}
"
]
;
then
jdk
=
"
$TESTJAVA
"
else
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
echo
"--Error: TESTJAVA must be defined as the pathname of a jdk to test."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
failed
=
0
# we use the pid of this shell process to name the heap dump output file.
...
...
@@ -50,7 +50,7 @@ ${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES \
DumpHeap
${
DUMPFILE
}
||
exit
2
# check that heap dump is parsable
${
TESTJAVA
}
/bin/jhat
-parseonly
true
${
DUMPFILE
}
${
COMPILEJAVA
}
/bin/jhat
${
TESTTOOLVMOPTS
}
-parseonly
true
${
DUMPFILE
}
if
[
$?
!=
0
]
;
then
failed
=
1
;
fi
# dump file is large so remove it
...
...
test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
浏览文件 @
443f7cf4
...
...
@@ -30,19 +30,19 @@
# @run shell GetMaxFileDescriptorCount.sh
#
#Set appropriate jdk
if
[
!
-z
"
${
TESTJAVA
}
"
]
;
then
jdk
=
"
$TESTJAVA
"
else
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
echo
"--Error: TESTJAVA must be defined as the pathname of a jdk to test."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
runOne
()
{
echo
"runOne
$@
"
$TESTJAVA
/bin/javac
-d
$TESTCLASSES
$TESTSRC
/
$@
.java
||
exit
2
$COMPILEJAVA
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
$TESTCLASSES
\
$TESTSRC
/
$@
.java
||
exit
2
$TESTJAVA
/bin/java
${
TESTVMOPTS
}
-classpath
$TESTCLASSES
$@
||
exit
3
}
...
...
test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
浏览文件 @
443f7cf4
...
...
@@ -30,19 +30,18 @@
# @run shell GetOpenFileDescriptorCount.sh
#
#Set appropriate jdk
if
[
!
-z
"
${
TESTJAVA
}
"
]
;
then
jdk
=
"
$TESTJAVA
"
else
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
echo
"--Error: TESTJAVA must be defined as the pathname of a jdk to test."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
runOne
()
{
echo
"runOne
$@
"
$TESTJAVA
/bin/javac
-d
$TESTCLASSES
$TESTSRC
/
$@
.java
||
exit
2
$COMPILEJAVA
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
$TESTCLASSES
\
$TESTSRC
/
$@
.java
||
exit
2
$TESTJAVA
/bin/java
${
TESTVMOPTS
}
-classpath
$TESTCLASSES
$@
||
exit
3
}
...
...
test/java/io/FileOutputStream/FileOpen.sh
浏览文件 @
443f7cf4
...
...
@@ -46,8 +46,10 @@ case "$OS" in
echo
"Could not find the directory-"
${
TMP
}
"- passing test"
exit
0
;
fi
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
\\
FileOpenPos.java
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
\\
FileOpenNeg.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
\\
FileOpenPos.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
\\
FileOpenNeg.java
echo
"Opening Writable Normal File.."
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
FileOpenPos
${
hfile
}
...
...
test/java/io/Serializable/class/run.sh
浏览文件 @
443f7cf4
...
...
@@ -34,17 +34,21 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
fi
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Test.java
echo
Write NonSerial1, Read NonSerial1
rm
-f
A.java
cp
${
TESTSRC
}
/NonSerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-d
echo
...
...
@@ -52,77 +56,77 @@ echo
echo
Write NonSerial1, Read NonSerial2
rm
-f
A.java
cp
${
TESTSRC
}
/NonSerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/NonSerialA_2.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-d
echo
echo
Write NonSerial1, Read Serial1
rm
-f
A.java
cp
${
TESTSRC
}
/NonSerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-d
echo
echo
Write Serial1, Read NonSerial1
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/NonSerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-doe
echo
echo
Write Serial1, Read Serial2
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_2.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-d
echo
echo
Write Serial2, Read Serial1
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_2.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-d
echo
echo
Write Serial1, Read Serial3
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_3.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-de
echo
echo
Write Serial3, Read Serial1
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_3.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-s
A
rm
-f
A.java
cp
${
TESTSRC
}
/SerialA_1.java A.java
${
TESTJAVA
}
/bin/javac
A.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
-de
echo
...
...
test/java/io/Serializable/evolution/RenamePackage/run.sh
浏览文件 @
443f7cf4
...
...
@@ -36,6 +36,10 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
OS
=
`
uname
-s
`
# Need to determine the classpath separator and filepath separator based on the
...
...
@@ -51,7 +55,7 @@ Windows* | CYGWIN* )
esac
JAVA
=
${
TESTJAVA
}
/bin/java
JAVAC
=
${
TEST
JAVA
}
/bin/javac
JAVAC
=
${
COMPILE
JAVA
}
/bin/javac
MKDIR
=
mkdir
RDEL
=
"rm -r"
...
...
@@ -78,11 +82,14 @@ mkdir ${TESTCLASSES}/nclasses
# Build sources
set
-e
${
JAVAC
}
-d
${
TESTCLASSES
}
/share
${
TESTSRC
}
/extension/ExtendedObjectInputStream.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
/share
\
${
TESTSRC
}
/extension/ExtendedObjectInputStream.java
CLASSPATH
=
${
TESTCLASSES
}
/share
;
export
CLASSPATH
;
${
JAVAC
}
-d
${
TESTCLASSES
}
/oclasses
${
TESTSRC
}
/test/SerialDriver.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
/oclasses
\
${
TESTSRC
}
/test/SerialDriver.java
CLASSPATH
=
${
TESTCLASSES
}
/share
;
export
CLASSPATH
;
${
JAVAC
}
-d
${
TESTCLASSES
}
/nclasses
${
TESTSRC
}
/install/SerialDriver.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
/nclasses
\
${
TESTSRC
}
/install/SerialDriver.java
# Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
CLASSPATH
=
"
${
TESTCLASSES
}
/oclasses
${
PS
}${
TESTCLASSES
}
/share"
;
export
CLASSPATH
;
...
...
test/java/io/Serializable/maskSyntheticModifier/run.sh
浏览文件 @
443f7cf4
...
...
@@ -29,17 +29,21 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
cp
${
TESTSRC
}
/Foo.class
.
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
rm
-f
*
.class
test/java/io/Serializable/packageAccess/run.sh
浏览文件 @
443f7cf4
...
...
@@ -29,20 +29,25 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/A.java
${
TESTSRC
}
/B.java
\
${
TESTSRC
}
/C.java
${
TESTSRC
}
/D.java
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/jar cf foo.jar B.class D.class
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
/A.java
${
TESTSRC
}
/B.java
${
TESTSRC
}
/C.java
${
TESTSRC
}
/D.java
\
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/jar
${
TESTTOOLVMOPTS
}
cf foo.jar B.class D.class
rm
-f
B.class D.class
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
...
...
test/java/io/Serializable/resolveClass/consTest/run.sh
浏览文件 @
443f7cf4
...
...
@@ -28,21 +28,26 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
rm
-f
*
.class
*
.jar
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Boot.java
${
TESTJAVA
}
/bin/jar
cf boot.jar
*
.class
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Boot.java
${
COMPILEJAVA
}
/bin/jar
${
TESTTOOLVMOPTS
}
cf boot.jar
*
.class
rm
-f
*
.class
${
TESTJAVA
}
/bin/javac
-classpath
boot.jar
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-classpath
boot.jar
-d
.
\
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
-Xbootclasspath
/a:boot.jar Test
rm
-f
*
.class
*
.jar
test/java/io/Serializable/resolveClass/deserializeButton/run.sh
浏览文件 @
443f7cf4
...
...
@@ -30,21 +30,25 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
rm
-f
*
.class
*
.jar
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Foo.java
${
TESTJAVA
}
/bin/jar
cf cb.jar
*
.class
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Foo.java
${
COMPILEJAVA
}
/bin/jar
${
TESTTOOLVMOPTS
}
cf cb.jar
*
.class
rm
-f
*
.class
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
rm
-f
*
.class
*
.jar
test/java/io/Serializable/superclassDataLoss/run.sh
浏览文件 @
443f7cf4
...
...
@@ -29,22 +29,28 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/A.java
${
TESTSRC
}
/B.java
${
TESTJAVA
}
/bin/jar cf cb1.jar A.class B.class
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
/A.java
${
TESTSRC
}
/B.java
${
COMPILEJAVA
}
/bin/jar
${
TESTTOOLVMOPTS
}
cf cb1.jar A.class B.class
cp
cb1.jar cb2.jar
rm
-f
A.class B.class
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
rm
-f
*
.class
*
.jar
test/java/io/Serializable/unnamedPackageSwitch/run.sh
浏览文件 @
443f7cf4
...
...
@@ -29,16 +29,21 @@
if
[
"
${
TESTJAVA
}
"
=
""
]
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
TESTSRC
=
"."
fi
set
-ex
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/A.java
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
/A.java
${
TESTSRC
}
/Test.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
test/java/lang/Class/getEnclosingClass/build.sh
浏览文件 @
443f7cf4
...
...
@@ -37,5 +37,6 @@ case "${OS}" in
;;
esac
JAVAC
=
${
TESTJAVA
}
/bin/javac
${
JAVAC
}
-d
${
TESTCLASSES
}
-sourcepath
${
TESTSRC
}${
SEP
}
.
${
TESTSRC
}
/EnclosingClassTest.java
JAVAC
=
${
COMPILEJAVA
}
/bin/javac
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
-sourcepath
${
TESTSRC
}${
SEP
}
.
\
${
TESTSRC
}
/EnclosingClassTest.java
test/java/lang/ClassLoader/Assert.sh
浏览文件 @
443f7cf4
...
...
@@ -35,6 +35,10 @@ then
exit
1
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -47,7 +51,7 @@ cp ${TESTSRC}/Assert.java .
cp
-R
${
TESTSRC
}
/package1
.
cp
-R
${
TESTSRC
}
/package2
.
${
TESTJAVA
}
/bin/javac
Assert.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
Assert.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Assert
...
...
test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
浏览文件 @
443f7cf4
...
...
@@ -42,6 +42,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-specific variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -69,7 +73,7 @@ echo TESTJAVA=${TESTJAVA}
echo
""
# compile test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
Starter.java
${
TESTSRC
}${
FS
}
DelegatingLoader.java
...
...
@@ -80,7 +84,7 @@ then
fi
# set up test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}${
FS
}
\
${
TESTSRC
}${
FS
}
Alice.java
${
TESTSRC
}${
FS
}
SupBob.java
\
${
TESTSRC
}${
FS
}
Bob.java
${
TESTSRC
}${
FS
}
SupAlice.java
...
...
test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
浏览文件 @
443f7cf4
...
...
@@ -41,9 +41,14 @@ if [ "${TESTJAVA}" = "" ] ; then
echo
"FAILED!!!"
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
# set platform-specific variables
...
...
@@ -64,7 +69,7 @@ case "$OS" in
esac
# compile test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
Starter.java
${
TESTSRC
}${
FS
}
DelegatingLoader.java
...
...
@@ -75,7 +80,7 @@ then
fi
# set up test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}${
FS
}
\
${
TESTSRC
}${
FS
}
Alice.java
${
TESTSRC
}${
FS
}
SupBob.java
\
${
TESTSRC
}${
FS
}
Bob.java
${
TESTSRC
}${
FS
}
SupAlice.java
...
...
test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh
浏览文件 @
443f7cf4
...
...
@@ -44,6 +44,11 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -56,11 +61,11 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
echo
"Building test classes..."
"
$JAVAC
"
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/ExpectedEncoding.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/ExpectedEncoding.java
echo
""
echo
"Running test for C locale"
...
...
test/java/lang/Thread/UncaughtExceptions.sh
浏览文件 @
443f7cf4
...
...
@@ -34,7 +34,7 @@
# To run this test manually, simply do ./UncaughtExceptions.sh
java
=
"
${
TESTJAVA
+
${
TESTJAVA
}
/bin/
}
java"
javac
=
"
${
TESTJAVA
+
${
TEST
JAVA
}
/bin/
}
javac"
javac
=
"
${
COMPILEJAVA
+
${
COMPILE
JAVA
}
/bin/
}
javac"
failed
=
""
Fail
()
{
echo
"FAIL:
$1
"
;
failed
=
"
${
failed
}
."
;
}
...
...
@@ -121,7 +121,7 @@ public class Seppuku extends Thread implements Runnable {
}
EOJAVA
Sys
"
$javac
"
"Seppuku.java"
Sys
"
$javac
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
"Seppuku.java"
CheckCommandResults
"
$expectedRC
"
"
$expectedOut
"
"
$expectedErr
"
\
"
$java
"
"Seppuku"
Cleanup
...
...
test/java/lang/annotation/loaderLeak/LoaderLeak.sh
浏览文件 @
443f7cf4
...
...
@@ -33,6 +33,10 @@ then
exit
1
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -67,8 +71,8 @@ esac
mkdir
-p
classes
cp
${
TESTSRC
}${
FS
}*
.java
.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
classes A.java B.java C.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
Main.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
classes A.java B.java C.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
Main.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
Main
result
=
$?
if
[
$result
-eq
0
]
...
...
test/java/lang/annotation/repeatingAnnotations/subpackage/Containee.java
浏览文件 @
443f7cf4
...
...
@@ -27,6 +27,7 @@ import java.lang.annotation.*;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@ContainedBy
(
Container
.
class
)
@Repeatable
(
Container
.
class
)
public
@interface
Containee
{
int
value
();
}
test/java/lang/annotation/repeatingAnnotations/subpackage/InheritedContainee.java
浏览文件 @
443f7cf4
...
...
@@ -28,6 +28,7 @@ import java.lang.annotation.*;
@Inherited
@Retention
(
RetentionPolicy
.
RUNTIME
)
@ContainedBy
(
InheritedContainer
.
class
)
@Repeatable
(
InheritedContainer
.
class
)
public
@interface
InheritedContainee
{
int
value
();
}
test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh
浏览文件 @
443f7cf4
...
...
@@ -42,6 +42,12 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -51,7 +57,7 @@ fi
echo
"TESTCLASSES=
${
TESTCLASSES
}
"
echo
"CLASSPATH=
${
CLASSPATH
}
"
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
mkdir
-p
hidden
mv
${
TESTCLASSES
}
/ExampleForBootClassPath.class hidden
test/java/lang/instrument/AppendToClassPathSetUp.sh
浏览文件 @
443f7cf4
...
...
@@ -42,6 +42,12 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -51,10 +57,10 @@ fi
echo
"TESTCLASSES=
${
TESTCLASSES
}
"
echo
"CLASSPATH=
${
CLASSPATH
}
"
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
cp
${
TESTSRC
}
/ExampleForClassPath.java ExampleForClassPath.java
${
JAVAC
}
ExampleForClassPath.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
ExampleForClassPath.java
mkdir
-p
hidden
mv
ExampleForClassPath.class hidden
rm
-f
ExampleForClassPath.java
test/java/lang/instrument/BootClassPath/BootClassPathTest.sh
浏览文件 @
443f7cf4
...
...
@@ -34,6 +34,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -46,30 +52,32 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
JAR
=
"
${
TEST
JAVA
}
"
/bin/jar
JAR
=
"
${
COMPILE
JAVA
}
"
/bin/jar
echo
"Creating manifest file..."
"
$JAVAC
"
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/Setup.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/Setup.java
# java Setup <workdir> <premain-class>
# - outputs boot class path to boot.dir
"
$JAVA
"
-classpath
"
${
TESTCLASSES
}
"
Setup
"
${
TESTCLASSES
}
"
Agent
"
$JAVA
"
${
TESTVMOPTS
}
-classpath
"
${
TESTCLASSES
}
"
Setup
"
${
TESTCLASSES
}
"
Agent
BOOTDIR
=
`
cat
${
TESTCLASSES
}
/boot.dir
`
echo
"Created
${
BOOTDIR
}
"
echo
"Building test classes..."
"
$JAVAC
"
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/Agent.java
"
${
TESTSRC
}
"
/DummyMain.java
"
$JAVAC
"
-d
"
${
BOOTDIR
}
"
"
${
TESTSRC
}
"
/AgentSupport.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
TESTCLASSES
}
"
\
"
${
TESTSRC
}
"
/Agent.java
"
${
TESTSRC
}
"
/DummyMain.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
BOOTDIR
}
"
\
"
${
TESTSRC
}
"
/AgentSupport.java
echo
"Creating agent jar file..."
"
$JAR
"
-cvfm
"
${
TESTCLASSES
}
"
/Agent.jar
"
${
TESTCLASSES
}
"
/MANIFEST.MF
\
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cvfm
"
${
TESTCLASSES
}
"
/Agent.jar
"
${
TESTCLASSES
}
"
/MANIFEST.MF
\
-C
"
${
TESTCLASSES
}
"
Agent.class
||
exit
1
echo
"Running test..."
...
...
@@ -79,7 +87,8 @@ result=$?
echo
"Cleanup..."
"
$JAVAC
"
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/Cleanup.java
"
$JAVA
"
-classpath
"
${
TESTCLASSES
}
"
Cleanup
"
${
BOOTDIR
}
"
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
TESTCLASSES
}
"
\
"
${
TESTSRC
}
"
/Cleanup.java
"
$JAVA
"
${
TESTTOOLVMOPTS
}
-classpath
"
${
TESTCLASSES
}
"
Cleanup
"
${
BOOTDIR
}
"
exit
$result
test/java/lang/instrument/MakeJAR.sh
浏览文件 @
443f7cf4
...
...
@@ -23,7 +23,6 @@
# questions.
#
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -38,16 +37,22 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
cp
${
TESTSRC
}
/InstrumentationHandoff.java InstrumentationHandoff.java
${
JAVAC
}
InstrumentationHandoff.java
${
JAR
}
cvfm
$1
.jar
${
TESTSRC
}
/
$1
.mf InstrumentationHandoff.class
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
InstrumentationHandoff.java
${
JAR
}
${
TESTTOOLVMOPTS
}
cvfm
$1
.jar
${
TESTSRC
}
/
$1
.mf InstrumentationHandoff.class
rm
-f
InstrumentationHandoff.class InstrumentationHandoff.java
test/java/lang/instrument/MakeJAR2.sh
浏览文件 @
443f7cf4
...
...
@@ -41,6 +41,12 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -64,8 +70,8 @@ case "$OS" in
;;
esac
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
cp
${
TESTSRC
}
/
${
AGENT
}
.java
.
cp
${
TESTSRC
}
/
${
APP
}
.java
.
...
...
@@ -77,11 +83,11 @@ mkdir -p bootpath/bootreporter
cp
${
TESTSRC
}
/bootreporter/
*
.java bootpath/bootreporter
cd
bootpath
${
JAVAC
}
bootreporter/
*
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
bootreporter/
*
.java
cd
..
${
JAVAC
}
${
AGENT
}
.java ilib/
*
.java
${
JAVAC
}
-classpath
.
${
PATHSEP
}
bootpath
${
APP
}
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
${
AGENT
}
.java ilib/
*
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-classpath
.
${
PATHSEP
}
bootpath
${
APP
}
.java
echo
"Manifest-Version: 1.0"
>
${
AGENT
}
.mf
echo
Premain-Class:
${
AGENT
}
>>
${
AGENT
}
.mf
...
...
@@ -92,6 +98,6 @@ while [ $# != 0 ] ; do
shift
done
${
JAR
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class ilib/
*
.class
${
JAR
}
${
TESTTOOLVMOPTS
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class ilib/
*
.class
# rm -rf ${AGENT}.java ilib ${AGENT}.mf ${AGENT}*.class
test/java/lang/instrument/MakeJAR3.sh
浏览文件 @
443f7cf4
...
...
@@ -39,17 +39,23 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
cp
${
TESTSRC
}
/
${
AGENT
}
.java
.
${
JAVAC
}
${
AGENT
}
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
${
AGENT
}
.java
echo
"Manifest-Version: 1.0"
>
${
AGENT
}
.mf
echo
Premain-Class:
${
AGENT
}
>>
${
AGENT
}
.mf
...
...
@@ -60,4 +66,4 @@ while [ $# != 0 ] ; do
done
${
JAR
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class
${
JAR
}
${
TESTTOOLVMOPTS
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class
test/java/lang/instrument/MakeJAR4.sh
浏览文件 @
443f7cf4
...
...
@@ -17,17 +17,23 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
cp
${
TESTSRC
}
/
${
AGENT
}
.java
${
TESTSRC
}
/
${
OTHER
}
.java
.
${
JAVAC
}
${
AGENT
}
.java
${
OTHER
}
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
${
AGENT
}
.java
${
OTHER
}
.java
echo
"Manifest-Version: 1.0"
>
${
AGENT
}
.mf
echo
Premain-Class:
${
AGENT
}
>>
${
AGENT
}
.mf
...
...
@@ -37,4 +43,4 @@ while [ $# != 0 ] ; do
done
${
JAR
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class
${
OTHER
}*
.java
${
JAR
}
"{TESTTOOLVMOPTS}"
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}*
.class
${
OTHER
}*
.java
test/java/lang/instrument/ManifestTest.sh
浏览文件 @
443f7cf4
...
...
@@ -312,7 +312,7 @@ make_a_JAR() {
fi
rm
-f
${
AGENT
}
.jar
${
JAR
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}
.class
${
JAR
}
${
TESTTOOLVMOPTS
}
cvfm
${
AGENT
}
.jar
${
AGENT
}
.mf
${
AGENT
}
.class
echo
"
$expect_boot_cp_line
"
>
expect_boot_cp_line
echo
"
$expect_redef_line
"
>
expect_redef_line
...
...
@@ -326,6 +326,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -338,8 +344,8 @@ then
exit
1
fi
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
# Now that ManifestTestApp.class is built, we move
...
...
@@ -353,7 +359,7 @@ mv "${TESTCLASSES}/ExampleForBootClassPath.class" $OUT_OF_THE_WAY
# so we can tell when the wrong version is run
sed
's/return 15/return 42/'
"
${
TESTSRC
}
"
/ExampleForBootClassPath.java
\
>
ExampleForBootClassPath.java
"
$JAVAC
"
ExampleForBootClassPath.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
ExampleForBootClassPath.java
mv
ExampleForBootClassPath.class
\
$OUT_OF_THE_WAY
/ExampleForBootClassPath.class.bad
mv
ExampleForBootClassPath.java
\
...
...
@@ -363,7 +369,7 @@ AGENT=ManifestTestAgent
# We compile the agent in the working directory instead of with
# a build task because we construct a different agent JAR file
# for each test case.
${
JAVAC
}
-d
.
${
TESTSRC
}
/
${
AGENT
}
.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/
${
AGENT
}
.java
FAIL_MARKER
=
fail_marker
rm
-f
$FAIL_MARKER
...
...
test/java/lang/instrument/ParallelTransformerLoader.sh
浏览文件 @
443f7cf4
...
...
@@ -38,6 +38,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -50,16 +56,16 @@ then
exit
1
fi
JAR
=
"
${
TEST
JAVA
}
"
/bin/jar
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAR
=
"
${
COMPILE
JAVA
}
"
/bin/jar
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVAC
}
"
-d
.
\
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
"
${
TESTSRC
}
"
/TestClass1.java
\
"
${
TESTSRC
}
"
/TestClass2.java
\
"
${
TESTSRC
}
"
/TestClass3.java
"
${
JAR
}
"
cvf Test.jar Test
*
.class
"
${
JAR
}
"
${
TESTTOOLVMOPTS
}
cvf Test.jar Test
*
.class
# Removing the test class files is important. If these
# .class files are available on the classpath other
# than via Test.jar, then the deadlock will not reproduce.
...
...
test/java/lang/instrument/PremainClass/NoPremainAgent.sh
浏览文件 @
443f7cf4
...
...
@@ -37,6 +37,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -49,7 +55,7 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVA
}
"
${
TESTVMOPTS
}
-javaagent
:NoPremainAgent.jar
\
...
...
test/java/lang/instrument/PremainClass/PremainClassTest.sh
浏览文件 @
443f7cf4
...
...
@@ -32,6 +32,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -44,10 +50,10 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
$JAVAC
"
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/DummyMain.java
"
$JAVAC
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
"
${
TESTCLASSES
}
"
"
${
TESTSRC
}
"
/DummyMain.java
"
${
JAVA
}
"
${
TESTVMOPTS
}
-javaagent
:
"
${
TESTSRC
}
"
/Agent.jar
-classpath
"
${
TESTCLASSES
}
"
DummyMain
result
=
$?
...
...
test/java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh
浏览文件 @
443f7cf4
...
...
@@ -37,6 +37,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -49,7 +55,7 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVA
}
"
${
TESTVMOPTS
}
-javaagent
:ZeroArgPremainAgent.jar
\
...
...
test/java/lang/instrument/RedefineBigClass.sh
浏览文件 @
443f7cf4
...
...
@@ -37,6 +37,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -49,7 +55,7 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVA
}
"
${
TESTVMOPTS
}
\
...
...
test/java/lang/instrument/RedefineClassWithNativeMethod.sh
浏览文件 @
443f7cf4
...
...
@@ -37,6 +37,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -49,7 +55,7 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVA
}
"
${
TESTVMOPTS
}
\
...
...
test/java/lang/instrument/RedefineMethodAddInvoke.sh
浏览文件 @
443f7cf4
...
...
@@ -37,6 +37,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -49,18 +55,18 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
cp
"
${
TESTSRC
}
"
/RedefineMethodAddInvokeTarget_1.java
\
RedefineMethodAddInvokeTarget.java
"
${
JAVAC
}
"
-d
.
RedefineMethodAddInvokeTarget.java
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
RedefineMethodAddInvokeTarget.java
mv
RedefineMethodAddInvokeTarget.java RedefineMethodAddInvokeTarget_1.java
mv
RedefineMethodAddInvokeTarget.class RedefineMethodAddInvokeTarget_1.class
cp
"
${
TESTSRC
}
"
/RedefineMethodAddInvokeTarget_2.java
\
RedefineMethodAddInvokeTarget.java
"
${
JAVAC
}
"
-d
.
RedefineMethodAddInvokeTarget.java
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
RedefineMethodAddInvokeTarget.java
mv
RedefineMethodAddInvokeTarget.java RedefineMethodAddInvokeTarget_2.java
mv
RedefineMethodAddInvokeTarget.class RedefineMethodAddInvokeTarget_2.class
...
...
test/java/lang/instrument/RedefineSetUp.sh
浏览文件 @
443f7cf4
...
...
@@ -41,6 +41,12 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
...
...
@@ -50,15 +56,15 @@ fi
echo
"TESTCLASSES=
${
TESTCLASSES
}
"
echo
"CLASSPATH=
${
CLASSPATH
}
"
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac -g"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac -g"
cp
${
TESTSRC
}
/Different_ExampleRedefine.java ExampleRedefine.java
cp
${
TESTSRC
}
/Counter.java
.
${
JAVAC
}
ExampleRedefine.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
ExampleRedefine.java
mv
ExampleRedefine.class Different_ExampleRedefine.class
rm
-f
ExampleRedefine.java Counter.java
cp
${
TESTSRC
}
/ExampleRedefine.java ExampleRedefine.java
cp
${
TESTSRC
}
/Counter.java
.
${
JAVAC
}
ExampleRedefine.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
ExampleRedefine.java
rm
-f
ExampleRedefine.java Counter.java
test/java/lang/instrument/RetransformBigClass.sh
浏览文件 @
443f7cf4
...
...
@@ -38,6 +38,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -50,7 +56,7 @@ then
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
"
/bin/javac
JAVAC
=
"
${
COMPILE
JAVA
}
"
/bin/javac
JAVA
=
"
${
TESTJAVA
}
"
/bin/java
"
${
JAVA
}
"
${
TESTVMOPTS
}
\
...
...
test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh
浏览文件 @
443f7cf4
...
...
@@ -34,6 +34,11 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
.
${
TESTSRC
}
/CommonSetup.sh
# Setup to create circularity condition
...
...
@@ -44,9 +49,9 @@ rm -f "${TESTCLASSES}"/A.java "${TESTCLASSES}"/B.java
cp
"
${
TESTSRC
}
"
/A.1
"
${
TESTCLASSES
}
"
/A.java
cp
"
${
TESTSRC
}
"
/B.1
"
${
TESTCLASSES
}
"
/B.java
(
cd
"
${
TESTCLASSES
}
"
;
\
$JAVAC
A.java B.java
;
\
$JAVAC
-d
.
"
${
TESTSRC
}
"
/CircularityErrorTest.java
;
\
$JAR
cf A.jar A.class
;
\
$JAVAC
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java B.java
;
\
$JAVAC
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
"
${
TESTSRC
}
"
/CircularityErrorTest.java
;
\
$JAR
${
TESTTOOLVMOPTS
}
cf A.jar A.class
;
\
rm
-f
A.class
;
mv
B.class B.keep
)
# A extends B
...
...
@@ -55,7 +60,7 @@ rm -f "${TESTCLASSES}"/A.java "${TESTCLASSES}"/B.java
cp
"
${
TESTSRC
}
"
/A.2
"
${
TESTCLASSES
}
"
/A.java
cp
"
${
TESTSRC
}
"
/B.2
"
${
TESTCLASSES
}
"
/B.java
(
cd
"
${
TESTCLASSES
}
"
;
\
$JAVAC
A.java B.java
;
rm
-f
B.class A.java B.java
)
$JAVAC
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
A.java B.java
;
rm
-f
B.class A.java B.java
)
# Move B.keep to B.class creates the A extends B and
# B extends A condition.
...
...
@@ -67,7 +72,7 @@ rm -f "${MANIFEST}"
echo
"Premain-Class: CircularityErrorTest"
>
"
${
MANIFEST
}
"
# Setup test case as an agent
$JAR
-cfm
"
${
TESTCLASSES
}
"
/CircularityErrorTest.jar
"
${
MANIFEST
}
"
\
$JAR
${
TESTTOOLVMOPTS
}
-cfm
"
${
TESTCLASSES
}
"
/CircularityErrorTest.jar
"
${
MANIFEST
}
"
\
-C
"
${
TESTCLASSES
}
"
CircularityErrorTest.class
# Finally we run the test
...
...
test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
浏览文件 @
443f7cf4
...
...
@@ -65,7 +65,8 @@ EOF
echo
"public class Bar { }"
>
"
${
BAR
}
"
(
cd
"
${
OTHERDIR
}
"
;
\
$JAVAC
Foo.java Bar.java
;
$JAR
cf
"
${
OTHERDIR
}
"
/Bar.jar Bar.class
;
\
$JAVAC
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
Foo.java Bar.java
;
\
$JAR
${
TESTTOOLVMOPTS
}
cf
"
${
OTHERDIR
}
"
/Bar.jar Bar.class
;
\
rm
-f
Bar.class
)
# Create the manifest
...
...
@@ -74,7 +75,7 @@ rm -f "${MANIFEST}"
echo
"Premain-Class: ClassUnloadTest"
>
"
${
MANIFEST
}
"
# Setup test case as an agent
$JAR
-cfm
"
${
TESTCLASSES
}
"
/ClassUnloadTest.jar
"
${
MANIFEST
}
"
\
$JAR
${
TESTTOOLVMOPTS
}
-cfm
"
${
TESTCLASSES
}
"
/ClassUnloadTest.jar
"
${
MANIFEST
}
"
\
-C
"
${
TESTCLASSES
}
"
ClassUnloadTest.class
# Finally we run the test
...
...
test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
浏览文件 @
443f7cf4
...
...
@@ -70,6 +70,12 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -83,6 +89,6 @@ then
fi
JAVA
=
"
${
TESTJAVA
}
/bin/java"
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh
浏览文件 @
443f7cf4
...
...
@@ -47,10 +47,10 @@ echo "Creating jar files for simple tests..."
cd
${
TESTCLASSES
}
"
$JAR
"
-cfm
Agent.jar
"
${
TESTSRC
}
"
/manifest.mf Agent.class
"
$JAR
"
-cf
AgentSupport.jar AgentSupport.class
"
$JAR
"
-cf
BootSupport.jar BootSupport.class
"
$JAR
"
-cf
SimpleTests.jar BasicTest.class PrematureLoadTest.class
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cfm
Agent.jar
"
${
TESTSRC
}
"
/manifest.mf Agent.class
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cf
AgentSupport.jar AgentSupport.class
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cf
BootSupport.jar BootSupport.class
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cf
SimpleTests.jar BasicTest.class PrematureLoadTest.class
failures
=
0
...
...
@@ -72,18 +72,18 @@ echo "Setup for functional tests..."
# system class path
mkdir
tmp
"
${
JAVAC
}
"
-d
tmp
"
${
TESTSRC
}
"
/Tracer.java
(
cd
tmp
;
"
${
JAR
}
"
cf ../Tracer.jar org/tools/Tracer.class
)
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
tmp
"
${
TESTSRC
}
"
/Tracer.java
(
cd
tmp
;
"
${
JAR
}
"
${
TESTTOOLVMOPTS
}
cf ../Tracer.jar org/tools/Tracer.class
)
# InstrumentedApplication is Application+instrmentation - don't copy as
# we don't want the original file permission
cat
"
${
TESTSRC
}
"
/InstrumentedApplication.java
>
./Application.java
"
${
JAVAC
}
"
-classpath
Tracer.jar
-d
.
Application.java
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-classpath
Tracer.jar
-d
.
Application.java
mv
Application.class InstrumentedApplication.bytes
cp
"
${
TESTSRC
}
"
/Application.java
.
"
${
JAVAC
}
"
-d
.
Application.java
"
${
JAVAC
}
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
Application.java
sh
-xc
"
$JAVA
${
TESTVMOPTS
}
-classpath . -javaagent:Agent.jar DynamicTest"
2>&1
if
[
$?
!=
0
]
;
then
failures
=
`
expr
$failures
+ 1
`
;
fi
...
...
test/java/net/Authenticator/B4933582.sh
浏览文件 @
443f7cf4
...
...
@@ -43,7 +43,8 @@ case "$OS" in
exit
1
;
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
-classpath
"
${
TESTSRC
}${
FS
}
..
${
FS
}
..
${
FS
}
..
${
FS
}
sun
${
FS
}
net
${
FS
}
www
${
FS
}
httptest"
${
TESTSRC
}${
FS
}
B4933582.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
-classpath
"
${
TESTSRC
}${
FS
}
..
${
FS
}
..
${
FS
}
..
${
FS
}
sun
${
FS
}
net
${
FS
}
www
${
FS
}
httptest"
${
TESTSRC
}${
FS
}
B4933582.java
rm
-f
cache.ser auth.save
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-classpath
"
${
TESTSRC
}${
FS
}
..
${
FS
}
..
${
FS
}
..
${
FS
}
sun
${
FS
}
net
${
FS
}
www
${
FS
}
httptest
${
PS
}
."
B4933582 first
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-classpath
"
${
TESTSRC
}${
FS
}
..
${
FS
}
..
${
FS
}
..
${
FS
}
sun
${
FS
}
net
${
FS
}
www
${
FS
}
httptest
${
PS
}
."
B4933582 second
test/java/net/URL/B5086147.sh
浏览文件 @
443f7cf4
...
...
@@ -42,7 +42,7 @@ case "$OS" in
exit
1
;
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
B5086147.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
B5086147.java
failures
=
0
...
...
test/java/net/URL/runconstructor.sh
浏览文件 @
443f7cf4
...
...
@@ -44,7 +44,8 @@ case "$OS" in
exit
1
;
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
Constructor.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FS
}
Constructor.java
failures
=
0
...
...
test/java/net/URLClassLoader/B5077773.sh
浏览文件 @
443f7cf4
...
...
@@ -58,7 +58,8 @@ esac
cp
${
TESTSRC
}${
FS
}
foo.jar
.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
B5077773.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FS
}
B5077773.java
WD
=
`
pwd
`
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
B5077773
...
...
test/java/net/URLClassLoader/closetest/build.sh
浏览文件 @
443f7cf4
...
...
@@ -40,14 +40,19 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
echo
"TESTCLASSES not set. Test cannot execute. Failed."
exit
1
fi
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
rm
-rf
${
TESTCLASSES
}
/test1
rm
-rf
${
TESTCLASSES
}
/test2
...
...
@@ -59,15 +64,15 @@ mkdir -p ${TESTCLASSES}/serverRoot
cd
${
TESTSRC
}
/test1/com/foo
cp
*
${
TESTCLASSES
}
/test1/com/foo
cd
${
TESTCLASSES
}
/test1
${
JAVAC
}
com/foo/
*
.java
${
JAR
}
cvf ../test1.jar com/foo/
*
.class com/foo/Resource
*
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
com/foo/
*
.java
${
JAR
}
${
TESTTOOLVMOPTS
}
cvf ../test1.jar com/foo/
*
.class com/foo/Resource
*
cd
${
TESTSRC
}
/test2/com/foo
cp
*
${
TESTCLASSES
}
/test2/com/foo
cd
${
TESTCLASSES
}
/test2
${
JAVAC
}
com/foo/
*
.java
${
JAR
}
cvf ../test2.jar com/foo/
*
.class com/foo/Resource
*
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
com/foo/
*
.java
${
JAR
}
${
TESTTOOLVMOPTS
}
cvf ../test2.jar com/foo/
*
.class com/foo/Resource
*
cp
${
TESTSRC
}
/serverRoot/Test.java
${
TESTCLASSES
}
/serverRoot
cd
${
TESTCLASSES
}
/serverRoot
${
JAVAC
}
Test.java
${
JAVAC
}
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
Test.java
test/java/net/URLClassLoader/getresourceasstream/test.sh
浏览文件 @
443f7cf4
...
...
@@ -43,7 +43,7 @@ checkExit () {
fi
}
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
/Test.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
/Test.java
cp
${
TESTSRC
}
/test.jar
.
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Test
...
...
test/java/net/URLClassLoader/sealing/checksealed.sh
浏览文件 @
443f7cf4
...
...
@@ -51,11 +51,13 @@ esac
if
[
x
"
$TESTJAVA
"
=
x
]
;
then
TESTJAVA
=
$1
;
fi
if
[
x
"
$COMPILEJAVA
"
=
x
]
;
then
COMPILEJAVA
=
$1
;
fi
if
[
x
"
$TESTSRC
"
=
x
]
;
then
TESTSRC
=
.
;
fi
CLASSPATH
=
".
${
PS
}${
TESTSRC
}${
FS
}
a
${
PS
}${
TESTSRC
}${
FS
}
b.jar"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-classpath
"
${
CLASSPATH
}
"
-d
.
${
TESTSRC
}${
FS
}
CheckSealed.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-classpath
"
${
CLASSPATH
}
"
-d
.
\
${
TESTSRC
}${
FS
}
CheckSealed.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-cp
"
${
CLASSPATH
}
"
CheckSealed 1
if
[
$?
!=
0
]
;
then
exit
1
;
fi
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-cp
"
${
CLASSPATH
}
"
CheckSealed 2
...
...
test/java/net/URLConnection/6212146/test.sh
浏览文件 @
443f7cf4
...
...
@@ -63,7 +63,7 @@ mkdir jars
cp
${
TESTSRC
}${
FS
}
test.jar jars
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
Test.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
Test.java
WD
=
`
pwd
`
ulimit
-H
-n
300
...
...
test/java/net/URLConnection/UNCTest.sh
浏览文件 @
443f7cf4
...
...
@@ -35,7 +35,7 @@ UNC="file://jdk/LOCAL-JAVA/jdk1.4/win/README.txt"
OS
=
`
uname
-s
`
case
"
$OS
"
in
Windows_95
|
Windows_98
|
Windows_NT
)
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
\\
UNCTest.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
\\
UNCTest.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
UNCTest
${
UNC
}
exit
;;
...
...
test/java/nio/charset/spi/basic.sh
浏览文件 @
443f7cf4
...
...
@@ -38,12 +38,13 @@
if
[
-z
"
$TESTJAVA
"
]
;
then
if
[
$#
-lt
1
]
;
then
exit
1
;
fi
TESTJAVA
=
$1
;
shift
COMPILEJDK
=
"
${
TESTJAVA
}
"
TESTSRC
=
`
pwd
`
TESTCLASSES
=
`
pwd
`
fi
JAVA
=
$TESTJAVA
/bin/java
JAR
=
$
TEST
JAVA
/bin/jar
JAR
=
$
COMPILE
JAVA
/bin/jar
DIR
=
`
pwd
`
case
`
uname
`
in
...
...
@@ -72,7 +73,7 @@ if [ \! -d $EXTD ]; then
cp
$TESTCLASSES
/FooProvider.class
$TESTCLASSES
/FooCharset.class
$JARD
mkdir
$TESTD
cp
$TESTCLASSES
/Test.class
$TESTD
(
cd
$JARD
;
$JAR
-cf
$EXTD
/test.jar
*
)
(
cd
$JARD
;
$JAR
${
TESTTOOLVMOPTS
}
-cf
$EXTD
/test.jar
*
)
fi
if
[
$#
-gt
0
]
;
then
...
...
test/java/nio/file/Files/Misc.java
浏览文件 @
443f7cf4
...
...
@@ -22,7 +22,7 @@
*/
/* @test
* @bug 4313887 6838333
* @bug 4313887 6838333
8005566
* @summary Unit test for miscellenous methods in java.nio.file.Files
* @library ..
*/
...
...
test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
浏览文件 @
443f7cf4
...
...
@@ -49,7 +49,7 @@ mkdir -p classes
for
dir
in
`
echo
${
TESTCLASSPATH
:-
$TESTCLASSES
}
|
sed
-e
"s/
$PS
/ /"
`
;
do
cp
$dir
/
*
.class classes
;
done
rm
classes/ExtLoadedImpl.class classes/ExtLoadedImpl_Stub.class classes/CheckLoader.class
mkdir
-p
ext
$
TESTJAVA
/bin/jar
cf ext/ext.jar
-C
$TESTCLASSES
ExtLoadedImpl.class
-C
$TESTCLASSES
ExtLoadedImpl_Stub.class
-C
$TESTCLASSES
CheckLoader.class
$
COMPILEJAVA
/bin/jar
${
TESTTOOLVMOPTS
}
cf ext/ext.jar
-C
$TESTCLASSES
ExtLoadedImpl.class
-C
$TESTCLASSES
ExtLoadedImpl_Stub.class
-C
$TESTCLASSES
CheckLoader.class
$TESTJAVA
/bin/java
${
TESTVMOPTS
}
-cp
classes
-Dtest
.src
=
$TESTSRC
-Dtest
.classes
=
$TESTCLASSES
-Djava
.security.policy
=
$TESTSRC
/security.policy
-Djava
.ext.dirs
=
ext ExtLoadedImplTest
test/java/rmi/registry/readTest/readTest.sh
浏览文件 @
443f7cf4
...
...
@@ -53,15 +53,15 @@ esac
TEST_CLASSPATH
=
.
$PS
${
TESTCLASSPATH
:-
$TESTCLASSES
}
cp
-r
${
TESTSRC
}${
FS
}*
.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
testPkg
${
FS
}*
java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-cp
$TEST_CLASSPATH
readTest.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
testPkg
${
FS
}*
java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-cp
$TEST_CLASSPATH
readTest.java
mkdir
rmi_tmp
RMIREG_OUT
=
rmi.out
#start rmiregistry without any local classes on classpath
cd
rmi_tmp
# NOTE: This RMI Registry port must match TestLibrary.READTEST_REGISTRY_PORT
${
TESTJAVA
}${
FS
}
bin
${
FS
}
rmiregistry 64005
>
..
${
FS
}${
RMIREG_OUT
}
2>&1 &
${
TESTJAVA
}${
FS
}
bin
${
FS
}
rmiregistry
${
TESTTOOLVMOPTS
}
64005
>
..
${
FS
}${
RMIREG_OUT
}
2>&1 &
RMIREG_PID
=
$!
# allow some time to start
sleep
3
...
...
test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
浏览文件 @
443f7cf4
...
...
@@ -43,6 +43,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -78,11 +82,11 @@ if [ ! -d provider ] ; then
fi
# compile the test program
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}${
FILESEP
}
\
${
TESTSRC
}${
FILESEP
}
ClassLoaderDeadlock.java
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}${
FILESEP
}
provider
${
FILESEP
}
\
${
TESTSRC
}${
FILESEP
}
provider
${
FILESEP
}
HashProvider.java
...
...
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
浏览文件 @
443f7cf4
...
...
@@ -47,6 +47,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -88,12 +92,12 @@ else
fi
# compile and package the test program
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FILESEP
}
CreateSerialized.java
\
${
TESTSRC
}${
FILESEP
}
Deadlock2.java
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
${
TESTTOOLVMOPTS
}
\
-cvf
testlib
${
FILESEP
}
Deadlock2.jar
\
Deadlock2
*
.class
...
...
test/java/security/Security/signedfirst/Dyn.sh
浏览文件 @
443f7cf4
...
...
@@ -43,6 +43,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -77,7 +81,7 @@ cd ${TESTCLASSES}${FILESEP}
rm
DynSignedProvFirst.class
# compile the test program
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FILESEP
}
exp.jar
\
-d
${
TESTCLASSES
}${
FILESEP
}
\
${
TESTSRC
}${
FILESEP
}
DynSignedProvFirst.java
...
...
test/java/security/Security/signedfirst/Static.sh
浏览文件 @
443f7cf4
...
...
@@ -43,6 +43,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -77,7 +81,7 @@ cd ${TESTCLASSES}${FILESEP}
rm
StaticSignedProvFirst.class
# compile the test program
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
"
${
TESTCLASSES
}${
PATHSEP
}${
TESTSRC
}${
FILESEP
}
exp.jar"
\
-d
${
TESTCLASSES
}${
FILESEP
}
\
${
TESTSRC
}${
FILESEP
}
StaticSignedProvFirst.java
...
...
test/java/security/cert/CertificateFactory/slowstream.sh
浏览文件 @
443f7cf4
...
...
@@ -33,6 +33,9 @@ if [ "${TESTJAVA}" = "" ] ; then
echo
"FAILED!!!"
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
...
...
@@ -45,6 +48,7 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
SlowStream.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FS
}
SlowStream.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-Dtest
.src
=
${
TESTSRC
}
SlowStreamWriter |
\
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
SlowStreamReader
test/java/text/Format/DecimalFormat/TieRoundingTest.java
0 → 100644
浏览文件 @
443f7cf4
/*
* Copyright (c) 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
*
* @bug 7131459
* @summary test various situations of NumberFormat rounding when close to tie
* @author Olivier Lagneau
* @run main TieRoundingTest
*
*/
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.text.NumberFormat
;
import
java.text.DecimalFormat
;
import
java.math.RoundingMode
;
import
java.util.Locale
;
public
class
TieRoundingTest
{
static
int
testCounter
=
0
;
static
int
errorCounter
=
0
;
static
boolean
allPassed
=
true
;
static
void
formatOutputTestDouble
(
NumberFormat
nf
,
double
doubleToTest
,
String
tiePosition
,
String
inputDigits
,
String
expectedOutput
)
{
int
mfd
=
nf
.
getMaximumFractionDigits
();
RoundingMode
rm
=
nf
.
getRoundingMode
();
String
result
=
nf
.
format
(
doubleToTest
);
if
(!
result
.
equals
(
expectedOutput
))
{
System
.
out
.
println
();
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
(
"***Error formatting double value from string : "
+
inputDigits
);
System
.
out
.
println
(
"NumberFormat pattern is : "
+
((
DecimalFormat
)
nf
).
toPattern
());
System
.
out
.
println
(
"Maximum number of fractional digits : "
+
mfd
);
System
.
out
.
println
(
"Fractional rounding digit : "
+
(
mfd
+
1
));
System
.
out
.
println
(
"Position of value relative to tie : "
+
tiePosition
);
System
.
out
.
println
(
"Rounding Mode : "
+
rm
);
System
.
out
.
println
(
"BigDecimal output : "
+
new
BigDecimal
(
doubleToTest
).
toString
());
System
.
out
.
println
(
"FloatingDecimal output : "
+
doubleToTest
);
System
.
out
.
println
(
"Error. Formatted result different from expected."
+
"\nExpected output is : \""
+
expectedOutput
+
"\""
+
"\nFormated output is : \""
+
result
+
"\""
);
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
();
errorCounter
++;
allPassed
=
false
;
}
else
{
testCounter
++;
System
.
out
.
println
(
"\nSuccess for double value : "
+
doubleToTest
+
" :"
);
System
.
out
.
println
(
" Input digits :"
+
inputDigits
+
", BigDecimal value : "
+
new
BigDecimal
(
doubleToTest
).
toString
());
System
.
out
.
print
(
" Rounding mode: "
+
rm
);
System
.
out
.
print
(
", fract digits : "
+
mfd
);
System
.
out
.
print
(
", position : "
+
tiePosition
+
" tie"
);
System
.
out
.
print
(
", result : "
+
result
);
System
.
out
.
println
(
", expected : "
+
expectedOutput
);
}
}
static
void
formatOutputTestLong
(
NumberFormat
nf
,
long
longToTest
,
String
tiePosition
,
String
inputDigits
,
String
expectedOutput
)
{
int
mfd
=
nf
.
getMaximumFractionDigits
();
RoundingMode
rm
=
nf
.
getRoundingMode
();
String
result
=
nf
.
format
(
longToTest
);
if
(!
result
.
equals
(
expectedOutput
))
{
System
.
out
.
println
();
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
(
"***Error formatting double value from string : "
+
inputDigits
);
System
.
out
.
println
(
"NumberFormat pattern is : "
+
((
DecimalFormat
)
nf
).
toPattern
());
System
.
out
.
println
(
"Maximum number of fractional digits : "
+
mfd
);
System
.
out
.
println
(
"Fractional rounding digit : "
+
(
mfd
+
1
));
System
.
out
.
println
(
"Position of value relative to tie : "
+
tiePosition
);
System
.
out
.
println
(
"Rounding Mode : "
+
rm
);
System
.
out
.
println
(
"Error. Formatted result different from expected."
+
"\nExpected output is : \""
+
expectedOutput
+
"\""
+
"\nFormated output is : \""
+
result
+
"\""
);
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
();
errorCounter
++;
allPassed
=
false
;
}
else
{
testCounter
++;
System
.
out
.
print
(
"Success. Long input :"
+
inputDigits
);
System
.
out
.
print
(
", rounding : "
+
rm
);
System
.
out
.
print
(
", fract digits : "
+
mfd
);
System
.
out
.
print
(
", tie position : "
+
tiePosition
);
System
.
out
.
println
(
", expected : "
+
expectedOutput
);
}
}
static
void
formatOutputTestObject
(
NumberFormat
nf
,
Object
someNumber
,
String
tiePosition
,
String
inputDigits
,
String
expectedOutput
)
{
int
mfd
=
nf
.
getMaximumFractionDigits
();
RoundingMode
rm
=
nf
.
getRoundingMode
();
String
result
=
nf
.
format
(
someNumber
);
if
(!
result
.
equals
(
expectedOutput
))
{
System
.
out
.
println
();
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
(
"***Error formatting number value from string : "
+
inputDigits
);
System
.
out
.
println
(
"NumberFormat pattern is : "
+
((
DecimalFormat
)
nf
).
toPattern
());
System
.
out
.
println
(
"Maximum number of fractional digits : "
+
mfd
);
System
.
out
.
println
(
"Fractional rounding digit : "
+
(
mfd
+
1
));
System
.
out
.
println
(
"Position of value relative to tie : "
+
tiePosition
);
System
.
out
.
println
(
"Rounding Mode : "
+
rm
);
System
.
out
.
println
(
"Number self output representation: "
+
someNumber
);
System
.
out
.
println
(
"Error. Formatted result different from expected."
+
"\nExpected output is : \""
+
expectedOutput
+
"\""
+
"\nFormated output is : \""
+
result
+
"\""
);
System
.
out
.
println
(
"========================================"
);
System
.
out
.
println
();
errorCounter
++;
allPassed
=
false
;
}
else
{
testCounter
++;
System
.
out
.
print
(
"Success. Number input :"
+
inputDigits
);
System
.
out
.
print
(
", rounding : "
+
rm
);
System
.
out
.
print
(
", fract digits : "
+
mfd
);
System
.
out
.
print
(
", tie position : "
+
tiePosition
);
System
.
out
.
println
(
", expected : "
+
expectedOutput
);
}
}
public
static
void
main
(
String
[]
args
)
{
// Only the 3 rounding modes below may be impacted by bug 7131459.
// So we do not test the other rounding modes.
RoundingMode
[]
roundingModes
=
{
RoundingMode
.
HALF_DOWN
,
RoundingMode
.
HALF_EVEN
,
RoundingMode
.
HALF_UP
};
// Precise the relative position of input value against its closest tie.
String
[]
tieRelativePositions
=
{
"below"
,
"exact"
,
"above"
,
"below"
,
"exact"
,
"above"
,
"below"
,
"exact"
,
"above"
,
"below"
,
"exact"
,
"above"
};
// =============== Testing double (and thus float) value cases =========
System
.
out
.
println
(
"\n===== testing 3 digits rounding position ====="
);
double
[]
values3FractDigits
=
{
// unimpacting values close to tie, with less than 3 input fract digits
1.115d
,
1.125d
,
1.135d
,
// impacting close to tie values covering all 6 cases
0.3115d
,
0.3125d
,
0.3135d
,
0.6865d
,
0.6875d
,
0.6885d
,
// unimpacting values close to tie, with more than 3 input fract digits
1.46885d
,
2.46875d
,
1.46865d
};
String
[]
inputs3FractDigits
=
{
"1.115d"
,
"1.125d"
,
"1.135d"
,
"0.3115d"
,
"0.3125d"
,
"0.3135d"
,
"0.6865d"
,
"0.6875d"
,
"0.6885d"
,
"1.46885d"
,
"2.46875d"
,
"1.46865d"
};
String
[][]
expected3FractDigits
=
{
{
"1.115"
,
"1.125"
,
"1.135"
,
"0.311"
,
"0.312"
,
"0.314"
,
"0.686"
,
"0.687"
,
"0.689"
,
"1.469"
,
"2.469"
,
"1.469"
},
{
"1.115"
,
"1.125"
,
"1.135"
,
"0.311"
,
"0.312"
,
"0.314"
,
"0.686"
,
"0.688"
,
"0.689"
,
"1.469"
,
"2.469"
,
"1.469"
},
{
"1.115"
,
"1.125"
,
"1.135"
,
"0.311"
,
"0.313"
,
"0.314"
,
"0.686"
,
"0.688"
,
"0.689"
,
"1.469"
,
"2.469"
,
"1.469"
},
};
for
(
int
r
=
0
;
r
<
roundingModes
.
length
;
r
++)
{
NumberFormat
dfDefault
=
NumberFormat
.
getInstance
(
Locale
.
US
);
RoundingMode
rmode
=
roundingModes
[
r
];
dfDefault
.
setRoundingMode
(
rmode
);
System
.
out
.
println
(
"\n----- Now checking "
+
rmode
+
" rounding mode -----"
);
for
(
int
i
=
0
;
i
<
values3FractDigits
.
length
;
i
++)
{
double
d
=
values3FractDigits
[
i
];
String
tiePosition
=
tieRelativePositions
[
i
];
String
input
=
inputs3FractDigits
[
i
];
String
expected
=
expected3FractDigits
[
r
][
i
];
formatOutputTestDouble
(
dfDefault
,
d
,
tiePosition
,
input
,
expected
);
}
}
System
.
out
.
println
(
"\n===== testing 5 digits rounding position ====="
);
double
[]
values5FractDigits
=
{
// unimpacting values close to tie, with less than 5 input fract digits
1.3135d
,
1.3125d
,
1.3115d
,
// impacting values close to tie, covering all 6 cases
1.328115d
,
1.328125d
,
1.328135d
,
1.796865d
,
1.796875d
,
1.796885d
,
// unimpacting values close to tie, with more than 5 input fract digits
1.3281149999999d
,
1.75390625d
,
1.7968750000001d
};
String
[]
inputs5FractDigits
=
{
"1.3135d"
,
"1.3125d"
,
"1.3115d"
,
"1.328115d"
,
"1.328125d"
,
"1.328135d"
,
"1.796865d"
,
"1.796875d"
,
"1.796885d"
,
"1.3281149999999d"
,
"1.75390625d"
,
"1.7968750000001d"
};
String
[][]
expected5FractDigits
=
{
{
"1.3135"
,
"1.3125"
,
"1.3115"
,
"1.32811"
,
"1.32812"
,
"1.32814"
,
"1.79686"
,
"1.79687"
,
"1.79689"
,
"1.32811"
,
"1.75391"
,
"1.79688"
},
{
"1.3135"
,
"1.3125"
,
"1.3115"
,
"1.32811"
,
"1.32812"
,
"1.32814"
,
"1.79686"
,
"1.79688"
,
"1.79689"
,
"1.32811"
,
"1.75391"
,
"1.79688"
},
{
"1.3135"
,
"1.3125"
,
"1.3115"
,
"1.32811"
,
"1.32813"
,
"1.32814"
,
"1.79686"
,
"1.79688"
,
"1.79689"
,
"1.32811"
,
"1.75391"
,
"1.79688"
}
};
for
(
int
r
=
0
;
r
<
roundingModes
.
length
;
r
++)
{
DecimalFormat
df5
=
(
DecimalFormat
)
NumberFormat
.
getInstance
(
Locale
.
US
);
RoundingMode
rmode
=
roundingModes
[
r
];
df5
.
setRoundingMode
(
rmode
);
System
.
out
.
println
(
"\n----- Now checking "
+
rmode
+
" rounding mode -----"
);
df5
.
applyPattern
(
"#,###.#####"
);
for
(
int
i
=
0
;
i
<
values5FractDigits
.
length
;
i
++)
{
double
d
=
values5FractDigits
[
i
];
String
tiePosition
=
tieRelativePositions
[
i
];
String
input
=
inputs5FractDigits
[
i
];
String
expected
=
expected5FractDigits
[
r
][
i
];
formatOutputTestDouble
(
df5
,
d
,
tiePosition
,
input
,
expected
);
}
}
// ==================== Testing long value cases ====================
System
.
out
.
println
(
"\n===== testing long values ====="
);
long
l
=
123456789012345L
;
DecimalFormat
dfLong
=
(
DecimalFormat
)
NumberFormat
.
getInstance
(
Locale
.
US
);
String
tiePosition
=
"exact"
;
String
input
=
"123456789012345L"
;
String
expected
=
"123,456,789,012,345"
;
String
result
=
dfLong
.
format
(
l
);
formatOutputTestLong
(
dfLong
,
l
,
tiePosition
,
input
,
expected
);
dfLong
.
applyPattern
(
"0.###E0"
);
expected
=
"1.235E14"
;
formatOutputTestLong
(
dfLong
,
l
,
tiePosition
,
input
,
expected
);
l
=
123450000000000L
;
input
=
"123450000000000L"
;
expected
=
"1.234E14"
;
formatOutputTestLong
(
dfLong
,
l
,
tiePosition
,
input
,
expected
);
l
=
987750000000000L
;
input
=
"987750000000000L"
;
expected
=
"9.878E14"
;
formatOutputTestLong
(
dfLong
,
l
,
tiePosition
,
input
,
expected
);
dfLong
.
applyPattern
(
"#,###.0E0"
);
l
=
987755000000000L
;
input
=
"987755000000000L"
;
expected
=
"987.76E12"
;
formatOutputTestLong
(
dfLong
,
l
,
tiePosition
,
input
,
expected
);
// ================= Testing BigInteger value cases =================
System
.
out
.
println
(
"\n===== testing BigInteger values ====="
);
String
stringValue
=
"12345678901234567890123456789012345"
;
BigInteger
bi
=
new
BigInteger
(
stringValue
);
DecimalFormat
dfBig
=
(
DecimalFormat
)
NumberFormat
.
getInstance
(
Locale
.
US
);
tiePosition
=
"exact"
;
input
=
stringValue
;
expected
=
"12,345,678,901,234,567,890,123,456,789,012,345"
;
formatOutputTestObject
(
dfBig
,
bi
,
tiePosition
,
input
,
expected
);
dfBig
.
applyPattern
(
"0.###E0"
);
expected
=
"1.235E34"
;
formatOutputTestObject
(
dfBig
,
bi
,
tiePosition
,
input
,
expected
);
stringValue
=
"12345000000000000000000000000000000"
;
input
=
stringValue
;
bi
=
new
BigInteger
(
stringValue
);
expected
=
"1.234E34"
;
formatOutputTestObject
(
dfBig
,
bi
,
tiePosition
,
input
,
expected
);
stringValue
=
"12345000000000000000000000000000001"
;
input
=
stringValue
;
bi
=
new
BigInteger
(
stringValue
);
expected
=
"1.235E34"
;
formatOutputTestObject
(
dfBig
,
bi
,
tiePosition
,
input
,
expected
);
stringValue
=
"98755000000000000000000000000000000"
;
input
=
stringValue
;
bi
=
new
BigInteger
(
stringValue
);
expected
=
"9.876E34"
;
formatOutputTestObject
(
dfBig
,
bi
,
tiePosition
,
input
,
expected
);
dfLong
.
applyPattern
(
"#,###.0E0"
);
stringValue
=
"98775500000000000000000000000000000"
;
input
=
stringValue
;
expected
=
"987.76E34"
;
// =============== Testing BigDecimal value cases ================
System
.
out
.
println
(
"\n===== testing BigDecimal values ====="
);
dfBig
=
(
DecimalFormat
)
NumberFormat
.
getInstance
(
Locale
.
US
);
stringValue
=
"0.68850000000000000088817841970012523233890533447265625"
;
BigDecimal
bd
=
new
BigDecimal
(
stringValue
);
tiePosition
=
"exact"
;
input
=
stringValue
;
expected
=
"0.689"
;
formatOutputTestObject
(
dfBig
,
bd
,
tiePosition
,
input
,
expected
);
stringValue
=
"0.31149999999999999911182158029987476766109466552734375"
;
bd
=
new
BigDecimal
(
stringValue
);
dfBig
.
applyPattern
(
"#,##0.####"
);
tiePosition
=
"exact"
;
input
=
stringValue
;
expected
=
"0.3115"
;
formatOutputTestObject
(
dfBig
,
bd
,
tiePosition
,
input
,
expected
);
// ==================== Printing results and exiting ===================
System
.
out
.
println
();
System
.
out
.
println
(
"==> "
+
testCounter
+
" tests passed successfully"
);
System
.
out
.
println
(
"==> "
+
errorCounter
+
" tests failed"
);
System
.
out
.
println
();
if
(
allPassed
)
{
System
.
out
.
println
(
"Success in formating all the values with the given parameters"
);
}
else
{
String
s
=
"Test failed with "
+
errorCounter
+
" formating error(s)."
;
System
.
out
.
println
(
s
);
throw
new
RuntimeException
(
s
);
}
}
}
test/java/util/Formatter/Basic.sh
浏览文件 @
443f7cf4
...
...
@@ -23,7 +23,8 @@
#
${
TESTJAVA
}
/bin/javac
-cp
${
TESTSRC
}
-d
.
${
TESTSRC
}
/Basic.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-cp
${
TESTSRC
}
-d
.
\
${
TESTSRC
}
/Basic.java
expectPass
()
{
if
[
$1
-eq
0
]
...
...
@@ -38,7 +39,7 @@ runTest() {
echo
"Testing:"
${
1
}
TZ
=
"
${
1
}
"
;
export
TZ
echo
" "
$TZ
${
TESTJAVA
}
/bin/java Basic
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
Basic
expectPass
$?
}
...
...
test/java/util/Locale/LocaleProviders.sh
浏览文件 @
443f7cf4
...
...
@@ -39,6 +39,10 @@ then
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
...
...
@@ -92,8 +96,9 @@ EOF
mk
${
SPIDIR
}${
FS
}
dest
${
FS
}
META-INF
${
FS
}
services
${
FS
}
java.util.spi.TimeZoneNameProvider
<<
EOF
tznp
EOF
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
SPIDIR
}${
FS
}
dest
${
SPIDIR
}${
FS
}
src
${
FS
}
tznp.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
jar cvf
${
SPIDIR
}${
FS
}
tznp.jar
-C
${
SPIDIR
}${
FS
}
dest
.
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
SPIDIR
}${
FS
}
dest
\
${
SPIDIR
}${
FS
}
src
${
FS
}
tznp.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
jar
${
TESTTOOLVMOPTS
}
cvf
${
SPIDIR
}${
FS
}
tznp.jar
-C
${
SPIDIR
}${
FS
}
dest
.
# get the platform default locales
PLATDEF
=
`
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-classpath
${
TESTCLASSES
}
LocaleProviders getPlatformLocale display
`
...
...
test/java/util/PluggableLocale/ExecTest.sh
浏览文件 @
443f7cf4
...
...
@@ -46,6 +46,10 @@ then
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
TESTCLASSES
}
"
=
""
]
then
...
...
@@ -99,7 +103,8 @@ esac
# compile
cp
${
TESTSRC
}${
FS
}
ProviderTest.java
.
cp
${
TESTSRC
}${
FS
}
$2
.java
.
COMPILE
=
"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac -XDignore.symbol.file -d . -classpath
${
CLASSPATHARG
}
$2
.java"
COMPILE
=
"
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-XDignore.symbol.file -d . -classpath
${
CLASSPATHARG
}
$2
.java"
echo
${
COMPILE
}
${
COMPILE
}
result
=
$?
...
...
test/java/util/ServiceLoader/basic.sh
浏览文件 @
443f7cf4
...
...
@@ -33,12 +33,13 @@
if
[
-z
"
$TESTJAVA
"
]
;
then
if
[
$#
-lt
1
]
;
then
exit
1
;
fi
TESTJAVA
=
"
$1
"
;
shift
COMPILEJAVA
=
"
${
TESTJAVA
}
"
TESTSRC
=
"
`
pwd
`
"
TESTCLASSES
=
"
`
pwd
`
"
fi
JAVA
=
"
$TESTJAVA
/bin/java"
JAR
=
"
$
TEST
JAVA
/bin/jar"
JAR
=
"
$
COMPILE
JAVA
/bin/jar"
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -68,7 +69,7 @@ if [ \! -d $EXTD ]; then
if
[
$n
=
3
]
;
then
cp
$TESTCLASSES
/FooService.class
$JARD
fi
(
cd
$JARD
;
"
$JAR
"
-cf
../p
$n
.jar
*
)
(
cd
$JARD
;
"
$JAR
"
${
TESTTOOLVMOPTS
}
-cf
../p
$n
.jar
*
)
done
mv
p3.jar
$EXTD
...
...
test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
浏览文件 @
443f7cf4
...
...
@@ -30,10 +30,14 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
/usr
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# create a test keystore and dummy cert
# create a test keystore and dummy cert. Note that we use the COMPILEJAVA
# as this test is a TimeZone test, it doesn't test keytool
rm
-f
${
TESTCLASSES
}
/timezonedatetest.store
${
TESTJAVA
}
/bin/keytool
-genkeypair
-alias
testcert
\
${
COMPILEJAVA
}
/bin/keytool
${
TESTTOOLVMOPTS
}
-genkeypair
-alias
testcert
\
-keystore
${
TESTCLASSES
}
/timezonedatetest.store
\
-storepass
testpass
-validity
360
\
-dname
"cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL"
\
...
...
@@ -41,12 +45,12 @@ ${TESTJAVA}/bin/keytool -genkeypair -alias testcert \
# create a jar file to sign with the test class in it.
rm
-f
${
TESTCLASSES
}
/timezonedatetest.jar
${
TESTJAVA
}
/bin/jar
cf
\
${
COMPILEJAVA
}
/bin/jar
${
TESTTOOLVMOPTS
}
cf
\
${
TESTCLASSES
}
/timezonedatetest.jar
\
-C
${
TESTCLASSES
}
TimeZoneDatePermissionCheck.class
# sign it
${
TESTJAVA
}
/bin/jarsigner
\
${
COMPILEJAVA
}
/bin/jarsigner
${
TESTTOOLVMOPTS
}
\
-keystore
${
TESTCLASSES
}
/timezonedatetest.store
\
-storepass
testpass
${
TESTCLASSES
}
/timezonedatetest.jar testcert
...
...
test/java/util/prefs/PrefsSpi.sh
浏览文件 @
443f7cf4
...
...
@@ -39,10 +39,13 @@ if [ -z "$TESTJAVA" ]; then
TESTSRC
=
"
`
pwd
`
"
TESTCLASSES
=
"
`
pwd
`
"
fi
if
[
-z
"
$COMPILEJAVA
"
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
java
=
"
$TESTJAVA
/bin/java"
javac
=
"
$
TEST
JAVA
/bin/javac"
jar
=
"
$
TEST
JAVA
/bin/jar"
javac
=
"
$
COMPILE
JAVA
/bin/javac"
jar
=
"
$
COMPILE
JAVA
/bin/jar"
Die
()
{
printf
"%s
\n
"
"
$*
"
;
exit
1
;
}
...
...
@@ -81,9 +84,9 @@ Sys rm -rf jarDir extDir
Sys
mkdir
-p
jarDir/META-INF/services extDir
echo
"StubPreferencesFactory"
\
>
"jarDir/META-INF/services/java.util.prefs.PreferencesFactory"
Sys
"
$javac
"
-d
jarDir StubPreferencesFactory.java StubPreferences.java
Sys
"
$javac
"
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
jarDir StubPreferencesFactory.java StubPreferences.java
(
cd
jarDir
&&
"
$jar
"
"cf"
"../extDir/PrefsSpi.jar"
"."
)
(
cd
jarDir
&&
"
$jar
"
${
TESTTOOLVMOPTS
}
"cf"
"../extDir/PrefsSpi.jar"
"."
)
case
"
`
uname
`
"
in
Windows
*
|
CYGWIN
*
)
CPS
=
';'
;;
*
)
CPS
=
':'
;;
esac
...
...
test/javax/crypto/SecretKeyFactory/FailOverTest.sh
浏览文件 @
443f7cf4
...
...
@@ -35,6 +35,11 @@ then
fi
echo
"TESTJAVA=
${
TESTJAVA
}
"
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
"COMPILEJAVA=
${
COMPILEJAVA
}
"
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
...
...
@@ -72,7 +77,7 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
.
\
-classpath
"
${
TESTSRC
}${
FS
}
P1.jar
${
PS
}${
TESTSRC
}${
FS
}
P2.jar"
\
${
TESTSRC
}${
FS
}
FailOverTest.java
...
...
test/javax/script/CommonSetup.sh
浏览文件 @
443f7cf4
...
...
@@ -63,6 +63,11 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
echo
"TESTSRC not set. Test cannot execute. Failed."
...
...
@@ -76,6 +81,6 @@ then
fi
JAVA
=
"
${
TESTJAVA
}
/bin/java"
JAVAC
=
"
${
TEST
JAVA
}
/bin/javac"
JAR
=
"
${
TEST
JAVA
}
/bin/jar"
JAVAC
=
"
${
COMPILE
JAVA
}
/bin/javac"
JAR
=
"
${
COMPILE
JAVA
}
/bin/jar"
test/javax/script/ProviderTest.sh
浏览文件 @
443f7cf4
...
...
@@ -38,7 +38,7 @@ fi
echo
"Creating JAR file ..."
$JAR
-cf
${
TESTCLASSES
}
/dummy.jar
\
$JAR
${
TESTTOOLVMOPTS
}
-cf
${
TESTCLASSES
}
/dummy.jar
\
-C
${
TESTCLASSES
}
DummyScriptEngine.class
\
-C
${
TESTCLASSES
}
DummyScriptEngineFactory.class
\
-C
"
${
TESTSRC
}
"
META-INF/services/javax.script.ScriptEngineFactory
...
...
test/javax/security/auth/Subject/doAs/Test.sh
浏览文件 @
443f7cf4
...
...
@@ -66,7 +66,8 @@ esac
# remove any leftover built class
cd
${
TESTCLASSES
}${
FS
}
${
RM
}
Test.class
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
${
TESTSRC
}${
FS
}
Test.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
\
${
TESTSRC
}${
FS
}
Test.java
WD
=
`
pwd
`
cd
${
TESTSRC
}${
FS
}
cd
$WD
...
...
test/lib/security/java.policy/Ext_AllPolicy.sh
浏览文件 @
443f7cf4
...
...
@@ -46,6 +46,9 @@ if [ "${TESTJAVA}" = "" ] ; then
echo
"FAILED!!!"
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
...
...
@@ -74,7 +77,7 @@ esac
# the test code
cd
${
TESTCLASSES
}
${
TESTJAVA
}${
FS
}
bin
${
FS
}
jar
-cvf
Ext_AllPolicy.jar Ext_AllPolicy.class
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
jar
${
TESTTOOLVMOPTS
}
-cvf
Ext_AllPolicy.jar Ext_AllPolicy.class
rm
Ext_AllPolicy.class
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
\
...
...
test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
浏览文件 @
443f7cf4
...
...
@@ -90,7 +90,7 @@ createPasswordFile ${PASSWD}
# Compile test
${
TESTJAVA
}
/bin/javac
-d
${
TESTCLASSES
}
${
TESTCLASSES
}
/Null.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
${
TESTCLASSES
}
/Null.java
JAVA
=
${
TESTJAVA
}
/bin/java
...
...
test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
浏览文件 @
443f7cf4
...
...
@@ -88,7 +88,7 @@ createSSLConfigFile ${SSL} ${TESTSRC}/ssl/keystore
# Compile test
${
TESTJAVA
}
/bin/javac
-d
${
TESTCLASSES
}
${
TESTCLASSES
}
/Dummy.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}
${
TESTCLASSES
}
/Dummy.java
JAVA
=
${
TESTJAVA
}
/bin/java
CLASSPATH
=
${
TESTCLASSES
}
...
...
test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
浏览文件 @
443f7cf4
...
...
@@ -51,7 +51,8 @@ _compile(){
rm
-f
${
_testclasses
}
/JMXStartStopTest.class
# Compile testcase
${
TESTJAVA
}
/bin/javac
-d
${
_testclasses
}
JMXStartStopDoSomething.java JMXStartStopTest.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
_testclasses
}
\
JMXStartStopDoSomething.java JMXStartStopTest.java
if
[
!
-f
${
_testclasses
}
/JMXStartStopTest.class
]
then
...
...
@@ -82,7 +83,7 @@ _app_start(){
}
_get_pid
(){
${
TESTJAVA
}
/bin/jps
|
sed
-n
"/JMXStartStopDoSomething/s/ .*//p"
${
COMPILEJAVA
}
/bin/jps
${
TESTTOOLVMOPTS
}
|
sed
-n
"/JMXStartStopDoSomething/s/ .*//p"
}
_app_stop
(){
...
...
@@ -115,7 +116,7 @@ _testme(){
_jcmd
(){
${
TESTJAVA
}
/bin/jcmd JMXStartStopDoSomething
$*
>
/dev/null 2>/dev/null
${
TESTJAVA
}
/bin/jcmd
${
TESTTOOLVMOPTS
}
JMXStartStopDoSomething
$*
>
/dev/null 2>/dev/null
}
_echo
(){
...
...
@@ -445,7 +446,7 @@ test_11(){
_jcmd ManagementAgent.stop
pid
=
`
${
TESTJAVA
}
/bin/jps
|
sed
-n
"/JMXStartStopDoSomething/s/ .*//p"
`
pid
=
`
${
COMPILEJAVA
}
/bin/jps
${
TESTTOOLVMOPTS
}
|
sed
-n
"/JMXStartStopDoSomething/s/ .*//p"
`
res2
=
`
_testme
local
${
pid
}
`
if
[
"
${
res1
}
"
=
"OK_CONN"
-a
"
${
res2
}
"
=
"OK_CONN"
]
...
...
@@ -528,6 +529,7 @@ if [ ! -x "${TESTJAVA}/bin/jcmd" ]
then
echo
"
${
TESTJAVA
}
/bin/jcmd"
echo
"Doesn't exist or not an executable"
exit
fi
...
...
test/sun/net/www/MarkResetTest.sh
浏览文件 @
443f7cf4
...
...
@@ -46,7 +46,7 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
MarkResetTest.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
MarkResetTest.java
# ftp server used by the test requires the file to be present
# in this directory
...
...
test/sun/net/www/http/HttpClient/RetryPost.sh
浏览文件 @
443f7cf4
...
...
@@ -47,7 +47,7 @@ case "$OS" in
esac
# compile
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
RetryPost.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
RetryPost.java
# run with no option specified. Should retry POST request.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
RetryPost
...
...
test/sun/net/www/protocol/jar/B5105410.sh
浏览文件 @
443f7cf4
...
...
@@ -50,6 +50,6 @@ case "$OS" in
esac
cp
${
TESTSRC
}${
FS
}
foo2.jar
.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
B5105410.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
B5105410.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
B5105410
test/sun/net/www/protocol/jar/jarbug/run.sh
浏览文件 @
443f7cf4
...
...
@@ -59,17 +59,17 @@ esac
mkdir
-p
${
DEST
}${
FS
}
jar1
cd
${
TESTSRC
}${
FS
}
etc
${
FS
}
jar1
cp
-r
.
${
DEST
}${
FS
}
jar1
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
DEST
}${
FS
}
jar1
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
DEST
}${
FS
}
jar1
\
${
TESTSRC
}${
FS
}
src
${
FS
}
jar1
${
FS
}
LoadResourceBundle.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
DEST
}${
FS
}
jar1
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
DEST
}${
FS
}
jar1
\
${
TESTSRC
}${
FS
}
src
${
FS
}
jar1
${
FS
}
GetResource.java
cd
${
DEST
}${
FS
}
jar1
${
TESTJAVA
}${
FS
}
bin
${
FS
}
jar
cfM jar1.jar jar1 res1.txt
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
jar
${
TESTTOOLVMOPTS
}
cfM jar1.jar jar1 res1.txt
mv
jar1.jar ..
#
# build the test sources and run them
#
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
DEST
}
${
TESTSRC
}${
FS
}
src
${
FS
}
test
${
FS
}*
.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
DEST
}
${
TESTSRC
}${
FS
}
src
${
FS
}
test
${
FS
}*
.java
cd
${
DEST
}
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
RunAllTests
result
=
$?
...
...
test/sun/security/krb5/config/dns.sh
浏览文件 @
443f7cf4
...
...
@@ -26,16 +26,19 @@
# @summary Krb5LoginModule config class does not return proper KDC list from DNS
#
env
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
JAVAC_CMD
=
`
which javac
`
TESTJAVA
=
`
dirname
$JAVAC_CMD
`
/..
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
;
then
TESTSRC
=
"."
fi
$
TESTJAVA
/bin/javac
-d
.
\
${
TESTSRC
}
/NamingManager.java
${
TESTSRC
}
/DNS.java
$
COMPILEJAVA
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}
/NamingManager.java
${
TESTSRC
}
/DNS.java
$TESTJAVA
/bin/java
-Xbootclasspath
/p:. DNS
test/sun/security/krb5/runNameEquals.sh
浏览文件 @
443f7cf4
...
...
@@ -43,6 +43,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
NATIVE
=
false
# set platform-dependent variables
...
...
@@ -73,7 +77,7 @@ esac
TEST
=
Krb5NameEquals
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTCLASSES
}${
FILESEP
}
\
${
TESTSRC
}${
FILESEP
}${
TEST
}
.java
...
...
test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
浏览文件 @
443f7cf4
...
...
@@ -39,7 +39,7 @@ case "$OS" in
#
# execute test program - rely on it to exit if platform unsupported
${
TESTJAVA
}
/bin/javac
-d
.
${
TESTSRC
}
\\
IsSunMSCAPIAvailable.java
${
COMPILEJAVA
}
/bin/javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}
\\
IsSunMSCAPIAvailable.java
${
TESTJAVA
}
/bin/java
${
TESTVMOPTS
}
IsSunMSCAPIAvailable
exit
;;
...
...
test/sun/security/pkcs11/KeyStore/Basic.sh
浏览文件 @
443f7cf4
...
...
@@ -54,9 +54,13 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
"/net/radiant/export1/charlie/mustang/build/solaris-sparc"
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
# get command from input args -
...
...
@@ -163,7 +167,7 @@ fi
# compile test
if
[
"
${
RECOMPILE
}
"
=
"yes"
]
;
then
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FS
}
..
${
PS
}${
TESTSRC
}${
FS
}
loader.jar
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
Basic.java
...
...
test/sun/security/pkcs11/KeyStore/ClientAuth.sh
浏览文件 @
443f7cf4
...
...
@@ -40,9 +40,13 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
"/net/radiant/export1/charlie/mustang/build/solaris-sparc"
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
OS
=
`
uname
-s
`
...
...
@@ -121,7 +125,7 @@ ${CP} ${TESTSRC}${FS}ClientAuthData${FS}key3.db ${TESTCLASSES}
${
CHMOD
}
+w
${
TESTCLASSES
}${
FS
}
key3.db
# compile test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FS
}
..
${
PS
}${
TESTSRC
}${
FS
}
loader.jar
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
ClientAuth.java
...
...
test/sun/security/pkcs11/KeyStore/Solaris.sh
浏览文件 @
443f7cf4
...
...
@@ -53,9 +53,13 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
"/net/radiant/export1/charlie/mustang/build/solaris-sparc"
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
# get command from input args -
...
...
@@ -133,7 +137,7 @@ ${CHMOD} 600 ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
if
[
"
${
RECOMPILE
}
"
=
"yes"
]
;
then
cd
${
TESTCLASSES
}
${
RM
}
*
.class
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FS
}
..
${
PS
}${
TESTSRC
}${
FS
}
loader.jar
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
Basic.java
...
...
test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
浏览文件 @
443f7cf4
...
...
@@ -41,9 +41,13 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
"/net/radiant/export1/charlie/mustang/build/solaris-sparc"
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
# let java test exit if platform unsupported
...
...
@@ -92,7 +96,7 @@ esac
# compile test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FS
}
..
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
ConfigQuotedString.java
...
...
test/sun/security/pkcs11/Provider/Login.sh
浏览文件 @
443f7cf4
...
...
@@ -42,9 +42,13 @@ fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
TESTJAVA
=
"/net/radiant/export1/charlie/mustang/build/solaris-sparc"
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
echo
TESTSRC
=
${
TESTSRC
}
echo
TESTCLASSES
=
${
TESTCLASSES
}
echo
TESTJAVA
=
${
TESTJAVA
}
echo
COMPILEJAVA
=
${
COMPILEJAVA
}
echo
""
# let java test exit if platform unsupported
...
...
@@ -101,7 +105,7 @@ ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
# compile test
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-classpath
${
TESTSRC
}${
FS
}
..
\
-d
${
TESTCLASSES
}
\
${
TESTSRC
}${
FS
}
Login.java
...
...
test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
浏览文件 @
443f7cf4
...
...
@@ -41,6 +41,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -65,12 +69,14 @@ esac
# compile the test program
cd
${
TESTSRC
}${
FILESEP
}
rm
GrantAllPermToExtWhenNoPolicy.class
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
-d
${
TESTSRC
}${
FILESEP
}
${
TESTSRC
}${
FILESEP
}
SomeExtensionClass.java
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
-d
${
TESTSRC
}${
FILESEP
}
${
TESTSRC
}${
FILESEP
}
GrantAllPermToExtWhenNoPolicy.java
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTSRC
}${
FILESEP
}
${
TESTSRC
}${
FILESEP
}
SomeExtensionClass.java
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
\
-d
${
TESTSRC
}${
FILESEP
}
${
TESTSRC
}${
FILESEP
}
GrantAllPermToExtWhenNoPolicy.java
# create the extension JAR file
cd
${
TESTCLASSES
}
${
TEST
JAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar cvf SomeExt.jar SomeExtensionClass
*
.class
${
COMPILE
JAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar cvf SomeExt.jar SomeExtensionClass
*
.class
rm
SomeExtensionClass.class
# move the extension JAR file to the extension directory
...
...
test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
浏览文件 @
443f7cf4
...
...
@@ -44,6 +44,10 @@ if [ "${TESTJAVA}" = "" ] ; then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
...
...
@@ -81,15 +85,15 @@ if [ ! -d ${TESTCLASSES}${FS}app ]; then
fi
cd
${
TESTSRC
}${
FS
}
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
TESTSRC
}${
FS
}
NoArgPermission.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
TESTSRC
}${
FS
}
OneArgPermission.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
TESTSRC
}${
FS
}
TwoArgPermission.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
boot
\
${
TESTSRC
}${
FS
}
TwoArgNullActionsPermission.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
${
TESTCLASSES
}${
FS
}
app
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
${
TESTCLASSES
}${
FS
}
app
\
${
TESTSRC
}${
FS
}
GetInstance.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
\
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
浏览文件 @
443f7cf4
...
...
@@ -51,7 +51,8 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
DebugReportsOneExtraByte.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FS
}
DebugReportsOneExtraByte.java
STRING
=
'main, WRITE: TLSv1 Application Data, length = 8'
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
浏览文件 @
443f7cf4
...
...
@@ -35,6 +35,10 @@ then
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
if
[
"
${
TESTSRC
}
"
=
""
]
then
TESTSRC
=
"."
...
...
@@ -63,12 +67,12 @@ set -ex
#
# Compile the tests, package into their respective jars
#
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
-d
.
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FILESEP
}
NotifyHandshakeTest.java
\
${
TESTSRC
}${
FILESEP
}
NotifyHandshakeTestHeyYou.java
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
-cvf
com.jar
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
${
TESTTOOLVMOPTS
}
-cvf
com.jar
\
com
${
FILESEP
}
NotifyHandshakeTest
*
.class
${
TESTJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
-cvf
edu.jar
\
${
COMPILEJAVA
}${
FILESEP
}
bin
${
FILESEP
}
jar
${
TESTTOOLVMOPTS
}
-cvf
edu.jar
\
edu
${
FILESEP
}
NotifyHandshakeTestHeyYou.class
#
...
...
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
浏览文件 @
443f7cf4
...
...
@@ -50,7 +50,9 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
OriginServer.java
\
${
TESTSRC
}${
FS
}
ProxyTunnelServer.java
${
TESTSRC
}${
FS
}
PostThruProxy.java
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
\
${
TESTSRC
}${
FS
}
OriginServer.java
\
${
TESTSRC
}${
FS
}
ProxyTunnelServer.java
\
${
TESTSRC
}${
FS
}
PostThruProxy.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
PostThruProxy
${
HOSTNAME
}
${
TESTSRC
}
exit
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
浏览文件 @
443f7cf4
...
...
@@ -50,7 +50,7 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
OriginServer.java
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
OriginServer.java
\
${
TESTSRC
}${
FS
}
ProxyTunnelServer.java
\
${
TESTSRC
}${
FS
}
PostThruProxyWithAuth.java
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
PostThruProxyWithAuth
${
HOSTNAME
}
${
TESTSRC
}
...
...
test/sun/security/tools/keytool/autotest.sh
浏览文件 @
443f7cf4
...
...
@@ -40,6 +40,9 @@ if [ "${TESTJAVA}" = "" ] ; then
echo
"FAILED!!!"
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
find_one
()
{
for
TARGET_FILE
in
$@
;
do
...
...
@@ -82,7 +85,7 @@ if [ "$LIBNAME" = "" ]; then
exit
1
fi
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
-XDignore
.symbol.file
\
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
-XDignore
.symbol.file
\
${
TESTSRC
}${
FS
}
KeyToolTest.java
||
exit
10
NSS
=
${
TESTSRC
}${
FS
}
..
${
FS
}
..
${
FS
}
pkcs11
${
FS
}
nss
...
...
test/sun/security/tools/keytool/printssl.sh
浏览文件 @
443f7cf4
...
...
@@ -33,6 +33,9 @@ if [ "${TESTJAVA}" = "" ] ; then
echo
"FAILED!!!"
exit
1
fi
if
[
"
${
COMPILEJAVA
}
"
=
""
]
;
then
COMPILEJAVA
=
"
${
TESTJAVA
}
"
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
...
...
@@ -52,7 +55,7 @@ case "$OS" in
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
PrintSSL.java
||
exit
10
${
COMPILEJAVA
}${
FS
}
bin
${
FS
}
javac
${
TESTJAVACOPTS
}
${
TESTTOOLVMOPTS
}
-d
.
${
TESTSRC
}${
FS
}
PrintSSL.java
||
exit
10
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
${
TESTVMOPTS
}
-Dtest
.src
=
$TESTSRC
PrintSSL |
(
read
PORT
;
${
TESTJAVA
}${
FS
}
bin
${
FS
}
keytool
-printcert
-sslserver
localhost:
$PORT
)
status
=
$?
...
...
test/sun/security/tools/keytool/readjar.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/sun/security/tools/keytool/standard.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/sun/security/util/Oid/S11N.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/sun/security/validator/certreplace.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/sun/security/validator/samedn.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/tools/launcher/ClassPathWildCard.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
test/tools/launcher/MultipleJRE.sh
浏览文件 @
443f7cf4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录