mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-12 04:19:39 +01:00
Compare commits
42 Commits
jdk-11.0.2
...
jdk-11.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bb3ed339b | ||
|
|
d2d988af90 | ||
|
|
64269a3c5a | ||
|
|
7bed7f1b2d | ||
|
|
10f08844e5 | ||
|
|
a855cab3e3 | ||
|
|
a60a5c4305 | ||
|
|
93c5f7c50d | ||
|
|
8dc28922c2 | ||
|
|
e075097dc8 | ||
|
|
ea06b5c966 | ||
|
|
776f1e31a9 | ||
|
|
6711fc8da7 | ||
|
|
43a56c89c6 | ||
|
|
fe8c20c8de | ||
|
|
30dfe8115d | ||
|
|
1b207cc9cc | ||
|
|
f4cf239df1 | ||
|
|
398f486c2a | ||
|
|
aeb6381306 | ||
|
|
97241329cf | ||
|
|
c9052141c1 | ||
|
|
382942dffb | ||
|
|
de3ae6f265 | ||
|
|
38a60d78c4 | ||
|
|
cc88c3ca4e | ||
|
|
ccd4c98e39 | ||
|
|
a5e6577c5b | ||
|
|
92cb5eb766 | ||
|
|
ddc3e41100 | ||
|
|
6ecf198c7c | ||
|
|
f7cd14cc2b | ||
|
|
8af22e796a | ||
|
|
10894a07f0 | ||
|
|
1047521856 | ||
|
|
1f516f62f2 | ||
|
|
bcdad92ce0 | ||
|
|
daf393a3fa | ||
|
|
621048ac87 | ||
|
|
a60fb5a71d | ||
|
|
1f85c15d3b | ||
|
|
5aa8538b17 |
20
make/data/cacerts/certainlyroote1
Normal file
20
make/data/cacerts/certainlyroote1
Normal file
@@ -0,0 +1,20 @@
|
||||
Owner: CN=Certainly Root E1, O=Certainly, C=US
|
||||
Issuer: CN=Certainly Root E1, O=Certainly, C=US
|
||||
Serial number: 62533b1470333275cf98d9ab9bfccf8
|
||||
Valid from: Thu Apr 01 00:00:00 GMT 2021 until: Sun Apr 01 00:00:00 GMT 2046
|
||||
Signature algorithm name: SHA384withECDSA
|
||||
Subject Public Key Algorithm: 384-bit EC (secp384r1) key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB9zCCAX2gAwIBAgIQBiUzsUcDMydc+Y2aub/M+DAKBggqhkjOPQQDAzA9MQsw
|
||||
CQYDVQQGEwJVUzESMBAGA1UEChMJQ2VydGFpbmx5MRowGAYDVQQDExFDZXJ0YWlu
|
||||
bHkgUm9vdCBFMTAeFw0yMTA0MDEwMDAwMDBaFw00NjA0MDEwMDAwMDBaMD0xCzAJ
|
||||
BgNVBAYTAlVTMRIwEAYDVQQKEwlDZXJ0YWlubHkxGjAYBgNVBAMTEUNlcnRhaW5s
|
||||
eSBSb290IEUxMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE3m/4fxzf7flHh4axpMCK
|
||||
+IKXgOqPyEpeKn2IaKcBYhSRJHpcnqMXfYqGITQYUBsQ3tA3SybHGWCA6TS9YBk2
|
||||
QNYphwk8kXr2vBMj3VlOBF7PyAIcGFPBMdjaIOlEjeR2o0IwQDAOBgNVHQ8BAf8E
|
||||
BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8ygYy2R17ikq6+2uI1g4
|
||||
hevIIgcwCgYIKoZIzj0EAwMDaAAwZQIxALGOWiDDshliTd6wT99u0nCK8Z9+aozm
|
||||
ut6Dacpps6kFtZaSF4fC0urQe87YQVt8rgIwRt7qy12a7DLCZRawTDBcMPPaTnOG
|
||||
BtjOiQRINzf43TNRnXCve1XYAS59BWQOhriR
|
||||
-----END CERTIFICATE-----
|
||||
38
make/data/cacerts/certainlyrootr1
Normal file
38
make/data/cacerts/certainlyrootr1
Normal file
@@ -0,0 +1,38 @@
|
||||
Owner: CN=Certainly Root R1, O=Certainly, C=US
|
||||
Issuer: CN=Certainly Root R1, O=Certainly, C=US
|
||||
Serial number: 8e0ff94b907168653354f4d44439b7e0
|
||||
Valid from: Thu Apr 01 00:00:00 GMT 2021 until: Sun Apr 01 00:00:00 GMT 2046
|
||||
Signature algorithm name: SHA256withRSA
|
||||
Subject Public Key Algorithm: 4096-bit RSA key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFRzCCAy+gAwIBAgIRAI4P+UuQcWhlM1T01EQ5t+AwDQYJKoZIhvcNAQELBQAw
|
||||
PTELMAkGA1UEBhMCVVMxEjAQBgNVBAoTCUNlcnRhaW5seTEaMBgGA1UEAxMRQ2Vy
|
||||
dGFpbmx5IFJvb3QgUjEwHhcNMjEwNDAxMDAwMDAwWhcNNDYwNDAxMDAwMDAwWjA9
|
||||
MQswCQYDVQQGEwJVUzESMBAGA1UEChMJQ2VydGFpbmx5MRowGAYDVQQDExFDZXJ0
|
||||
YWlubHkgUm9vdCBSMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANA2
|
||||
1B/q3avk0bbm+yLA3RMNansiExyXPGhjZjKcA7WNpIGD2ngwEc/csiu+kr+O5MQT
|
||||
vqRoTNoCaBZ0vrLdBORrKt03H2As2/X3oXyVtwxwhi7xOu9S98zTm/mLvg7fMbed
|
||||
aFySpvXl8wo0tf97ouSHocavFwDvA5HtqRxOcT3Si2yJ9HiG5mpJoM610rCrm/b0
|
||||
1C7jcvk2xusVtyWMOvwlDbMicyF0yEqWYZL1LwsYpfSt4u5BvQF5+paMjRcCMLT5
|
||||
r3gajLQ2EBAHBXDQ9DGQilHFhiZ5shGIXsXwClTNSaa/ApzSRKft43jvRl5tcdF5
|
||||
cBxGX1HpyTfcX35pe0HfNEXgO4T0oYoKNp43zGJS4YkNKPl6I7ENPT2a/Z2B7yyQ
|
||||
wHtETrtJ4A5KVpK8y7XdeReJkd5hiXSSqOMyhb5OhaRLWcsrxXiOcVTQAjeZjOVJ
|
||||
6uBUcqQRBi8LjMFbvrWhsFNunLhgkR9Za/kt9JQKl7XsxXYDVBtlUrpMklZRNaBA
|
||||
2CnbrlJ2Oy0wQJuK0EJWtLeIAaSHO1OWzaMWj/Nmqhexx2DgwUMFDO6bW2BvBlyH
|
||||
Wyf5QBGenDPBt+U1VwV/J84XIIwc/PH72jEpSe31C4SnT8H2TsIonPru4K8H+zMR
|
||||
eiFPCyEQtkA6qyI6BJyLm4SGcprSp6XEtHWRqSsjAgMBAAGjQjBAMA4GA1UdDwEB
|
||||
/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTgqj8ljZ9EXME66C6u
|
||||
d0yEPmcM9DANBgkqhkiG9w0BAQsFAAOCAgEAuVevuBLaV4OPaAszHQNTVfSVcOQr
|
||||
PbA56/qJYv331hgELyE03fFo8NWWWt7CgKPBjcZq91l3rhVkz1t5BXdm6ozTaw3d
|
||||
8VkswTOlMIAVRQdFGjEitpIAq5lNOo93r6kiyi9jyhXWx8bwPWz8HA2YEGGeEaIi
|
||||
1wrykXprOQ4vMMM2SZ/g6Q8CRFA3lFV96p/2O7qUpUzpvD5RtOjKkjZUbVwlKNrd
|
||||
rRT90+7iIgXr0PK3aBLXWopBGsaSpVo7Y0VPv+E6dyIvXL9G+VoDhRNCX8reU9di
|
||||
taY1BMJH/5n9hN9czulegChB8n3nHpDYT3Y+gjwN/KUD+nsa2UUeYNrEjvn8K8l7
|
||||
lcUq/6qJ34IxD3L/DCfXCh5WAFAeDJDBlrXYFIW7pw0WwfgHJBu6haEaBQmAupVj
|
||||
yTrsJZ9/nbqkRxWbRHDxakvWOF5D8xh+UG7pWijmZeZ3Gzr9Hb4DJqPb1OG7fpYn
|
||||
Kx3upPvaJVQTA945xsMfTZDsjxtK0hzthZU4UHlG1sGQUDGpXJpuHfUzVounmdLy
|
||||
yCwzk5Iwx06MZTMQZBf9JBeW0Y3COmor6xOLRPIh80oat3df1+2IpHLlOR+Vnb5n
|
||||
wXARPbv0+Em34yaXOp/SX3z7wJl8OSngex2/DaeP0ik0biQVy96QXr8axGbqwua6
|
||||
OV+KmalBWQewLK8=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -32,7 +32,7 @@ formatVersion=3
|
||||
# Version of the currency code information in this class.
|
||||
# It is a serial number that accompanies with each amendment.
|
||||
|
||||
dataVersion=175
|
||||
dataVersion=176
|
||||
|
||||
# List of all valid ISO 4217 currency codes.
|
||||
# To ensure compatibility, do not remove codes.
|
||||
@@ -55,7 +55,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036
|
||||
SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
|
||||
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
|
||||
UYU858-UZS860-VEB862-VED926-VEF937-VES928-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
|
||||
XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
|
||||
XBB956-XBC957-XBD958-XCD951-XCG532-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
|
||||
XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
|
||||
ZWN942-ZWR935
|
||||
|
||||
@@ -189,11 +189,11 @@ CR=CRC
|
||||
# COTE D'IVOIRE
|
||||
CI=XOF
|
||||
# CROATIA
|
||||
HR=HRK;2022-12-31-23-00-00;EUR
|
||||
HR=EUR
|
||||
# CUBA
|
||||
CU=CUP
|
||||
# Cura\u00e7ao
|
||||
CW=ANG
|
||||
CW=ANG;2025-04-01-04-00-00;XCG
|
||||
# CYPRUS
|
||||
CY=EUR
|
||||
# CZECHIA
|
||||
@@ -510,7 +510,7 @@ SR=SRD
|
||||
# SVALBARD AND JAN MAYEN
|
||||
SJ=NOK
|
||||
# Sint Maarten (Dutch part)
|
||||
SX=ANG
|
||||
SX=ANG;2025-04-01-04-00-00;XCG
|
||||
# ESWATINI
|
||||
SZ=SZL
|
||||
# SWEDEN
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2023d
|
||||
tzdata2024a
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
|
||||
# https://www.jstor.org/stable/1774359
|
||||
#
|
||||
# For the 1911/1912 establishment of standard time in French possessions, see:
|
||||
# Société Française de Physique, Recueil de constantes physiques (1913),
|
||||
# page 752, 18b.
|
||||
#
|
||||
# European-style abbreviations are commonly used along the Mediterranean.
|
||||
# For sub-Saharan Africa abbreviations were less standardized.
|
||||
# Previous editions of this database used WAT, CAT, SAT, and EAT
|
||||
@@ -136,7 +140,7 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia
|
||||
|
||||
# Chad
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
|
||||
Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena
|
||||
1:00 - WAT 1979 Oct 14
|
||||
1:00 1:00 WAST 1980 Mar 8
|
||||
1:00 - WAT
|
||||
@@ -162,7 +166,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
|
||||
# Inaccessible, Nightingale: uninhabited
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Abidjan -0:16:08 - LMT 1912
|
||||
Zone Africa/Abidjan -0:16:08 - LMT 1912 Jan 1
|
||||
0:00 - GMT
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -2480,18 +2480,33 @@ Zone Asia/Amman 2:23:44 - LMT 1931
|
||||
# effective December 21st, 2018....
|
||||
# http://adilet.zan.kz/rus/docs/P1800000817 (russian language).
|
||||
|
||||
# From Zhanbolat Raimbekov (2024-01-19):
|
||||
# Kazakhstan (all parts) switching to UTC+5 on March 1, 2024
|
||||
# https://www.gov.kz/memleket/entities/mti/press/news/details/688998?lang=ru
|
||||
# [in Russian]
|
||||
# (2024-01-20): https://primeminister.kz/ru/decisions/19012024-20
|
||||
#
|
||||
# From Alexander Krivenyshev (2024-01-19):
|
||||
# According to a different news and the official web site for the Ministry of
|
||||
# Trade and Integration of the Republic of Kazakhstan:
|
||||
# https://en.inform.kz/news/kazakhstan-to-switch-to-single-hour-zone-mar-1-54ad0b/
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
#
|
||||
# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
|
||||
# This includes KZ-AKM, KZ-ALA, KZ-ALM, KZ-AST, KZ-BAY, KZ-VOS, KZ-ZHA,
|
||||
# KZ-KAR, KZ-SEV, KZ-PAV, and KZ-YUZ.
|
||||
# This includes Abai/Abay (ISO 3166-2 code KZ-10), Aqmola/Akmola (KZ-11),
|
||||
# Almaty (KZ-19), Almaty city (KZ-75), Astana city (KZ-71),
|
||||
# East Kazkhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33),
|
||||
# Karaganda (KZ-35), North Kazakhstan (KZ-59), Pavlodar (KZ-55),
|
||||
# Shyumkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62).
|
||||
Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata
|
||||
5:00 - +05 1930 Jun 21
|
||||
6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
|
||||
5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s
|
||||
6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s
|
||||
6:00 - +06
|
||||
# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY)
|
||||
6:00 - +06 2024 Mar 1 0:00
|
||||
5:00 - +05
|
||||
# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-43)
|
||||
Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
|
||||
4:00 - +04 1930 Jun 21
|
||||
5:00 - +05 1981 Apr 1
|
||||
@@ -2504,8 +2519,7 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
|
||||
5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
|
||||
6:00 - +06 2018 Dec 21 0:00
|
||||
5:00 - +05
|
||||
#
|
||||
# Qostanay (aka Kostanay, Kustanay) (KZ-KUS)
|
||||
# Qostanay (aka Kostanay, Kustanay) (KZ-39)
|
||||
# The 1991/2 rules are unclear partly because of the 1997 Turgai
|
||||
# reorganization.
|
||||
Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2
|
||||
@@ -2516,9 +2530,9 @@ Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2
|
||||
5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
|
||||
4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
|
||||
5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
|
||||
6:00 - +06
|
||||
|
||||
# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT)
|
||||
6:00 - +06 2024 Mar 1 0:00
|
||||
5:00 - +05
|
||||
# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-15)
|
||||
Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
|
||||
4:00 - +04 1930 Jun 21
|
||||
5:00 - +05 1981 Apr 1
|
||||
@@ -2528,7 +2542,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
|
||||
4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
|
||||
5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
|
||||
5:00 - +05
|
||||
# Mangghystaū (KZ-MAN)
|
||||
# Mangghystaū (KZ-47)
|
||||
# Aqtau was not founded until 1963, but it represents an inhabited region,
|
||||
# so include timestamps before 1963.
|
||||
Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
|
||||
@@ -2540,7 +2554,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
|
||||
5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s
|
||||
4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
|
||||
5:00 - +05
|
||||
# Atyraū (KZ-ATY) is like Mangghystaū except it switched from
|
||||
# Atyraū (KZ-23) is like Mangghystaū except it switched from
|
||||
# +04/+05 to +05/+06 in spring 1999, not fall 1994.
|
||||
Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2
|
||||
3:00 - +03 1930 Jun 21
|
||||
@@ -2551,7 +2565,7 @@ Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2
|
||||
5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s
|
||||
4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
|
||||
5:00 - +05
|
||||
# West Kazakhstan (KZ-ZAP)
|
||||
# West Kazakhstan (KZ-27)
|
||||
# From Paul Eggert (2016-03-18):
|
||||
# The 1989 transition is from USSR act No. 227 (1989-03-14).
|
||||
Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk
|
||||
@@ -3453,19 +3467,26 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
||||
# ... winter time will begin in Palestine from Saturday 10-28-2023,
|
||||
# 02:00 AM by 60 minutes back.
|
||||
#
|
||||
# From Paul Eggert (2023-03-22):
|
||||
# From Heba Hamad (2024-01-25):
|
||||
# the summer time for the years 2024,2025 will begin in Palestine
|
||||
# from Saturday at 02:00 AM by 60 minutes forward as shown below:
|
||||
# year date
|
||||
# 2024 2024-04-20
|
||||
# 2025 2025-04-12
|
||||
#
|
||||
# From Paul Eggert (2024-01-25):
|
||||
# For now, guess that spring and fall transitions will normally
|
||||
# continue to use 2022's rules, that during DST Palestine will switch
|
||||
# to standard time at 02:00 the last Saturday before Ramadan and back
|
||||
# to DST at 02:00 the first Saturday after Ramadan, and that
|
||||
# to DST at 02:00 the second Saturday after Ramadan, and that
|
||||
# if the normal spring-forward or fall-back transition occurs during
|
||||
# Ramadan the former is delayed and the latter advanced.
|
||||
# To implement this, I predicted Ramadan-oriented transition dates for
|
||||
# 2023 through 2086 by running the following program under GNU Emacs 28.2,
|
||||
# 2026 through 2086 by running the following program under GNU Emacs 29.2,
|
||||
# with the results integrated by hand into the table below.
|
||||
# Predictions after 2086 are approximated without Ramadan.
|
||||
#
|
||||
# (let ((islamic-year 1444))
|
||||
# (let ((islamic-year 1447))
|
||||
# (require 'cal-islam)
|
||||
# (while (< islamic-year 1510)
|
||||
# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
|
||||
@@ -3474,6 +3495,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
||||
# (while (/= saturday (mod (setq a (1- a)) 7)))
|
||||
# (while (/= saturday (mod b 7))
|
||||
# (setq b (1+ b)))
|
||||
# (setq b (+ 7 b))
|
||||
# (setq a (calendar-gregorian-from-absolute a))
|
||||
# (setq b (calendar-gregorian-from-absolute b))
|
||||
# (insert
|
||||
@@ -3524,84 +3546,84 @@ Rule Palestine 2021 only - Oct 29 1:00 0 -
|
||||
Rule Palestine 2022 only - Mar 27 0:00 1:00 S
|
||||
Rule Palestine 2022 2035 - Oct Sat<=30 2:00 0 -
|
||||
Rule Palestine 2023 only - Apr 29 2:00 1:00 S
|
||||
Rule Palestine 2024 only - Apr 13 2:00 1:00 S
|
||||
Rule Palestine 2025 only - Apr 5 2:00 1:00 S
|
||||
Rule Palestine 2024 only - Apr 20 2:00 1:00 S
|
||||
Rule Palestine 2025 only - Apr 12 2:00 1:00 S
|
||||
Rule Palestine 2026 2054 - Mar Sat<=30 2:00 1:00 S
|
||||
Rule Palestine 2036 only - Oct 18 2:00 0 -
|
||||
Rule Palestine 2037 only - Oct 10 2:00 0 -
|
||||
Rule Palestine 2038 only - Sep 25 2:00 0 -
|
||||
Rule Palestine 2039 only - Sep 17 2:00 0 -
|
||||
Rule Palestine 2039 only - Oct 22 2:00 1:00 S
|
||||
Rule Palestine 2039 2067 - Oct Sat<=30 2:00 0 -
|
||||
Rule Palestine 2040 only - Sep 1 2:00 0 -
|
||||
Rule Palestine 2040 only - Oct 13 2:00 1:00 S
|
||||
Rule Palestine 2040 only - Oct 20 2:00 1:00 S
|
||||
Rule Palestine 2040 2067 - Oct Sat<=30 2:00 0 -
|
||||
Rule Palestine 2041 only - Aug 24 2:00 0 -
|
||||
Rule Palestine 2041 only - Sep 28 2:00 1:00 S
|
||||
Rule Palestine 2041 only - Oct 5 2:00 1:00 S
|
||||
Rule Palestine 2042 only - Aug 16 2:00 0 -
|
||||
Rule Palestine 2042 only - Sep 20 2:00 1:00 S
|
||||
Rule Palestine 2042 only - Sep 27 2:00 1:00 S
|
||||
Rule Palestine 2043 only - Aug 1 2:00 0 -
|
||||
Rule Palestine 2043 only - Sep 12 2:00 1:00 S
|
||||
Rule Palestine 2043 only - Sep 19 2:00 1:00 S
|
||||
Rule Palestine 2044 only - Jul 23 2:00 0 -
|
||||
Rule Palestine 2044 only - Aug 27 2:00 1:00 S
|
||||
Rule Palestine 2044 only - Sep 3 2:00 1:00 S
|
||||
Rule Palestine 2045 only - Jul 15 2:00 0 -
|
||||
Rule Palestine 2045 only - Aug 19 2:00 1:00 S
|
||||
Rule Palestine 2045 only - Aug 26 2:00 1:00 S
|
||||
Rule Palestine 2046 only - Jun 30 2:00 0 -
|
||||
Rule Palestine 2046 only - Aug 11 2:00 1:00 S
|
||||
Rule Palestine 2046 only - Aug 18 2:00 1:00 S
|
||||
Rule Palestine 2047 only - Jun 22 2:00 0 -
|
||||
Rule Palestine 2047 only - Jul 27 2:00 1:00 S
|
||||
Rule Palestine 2047 only - Aug 3 2:00 1:00 S
|
||||
Rule Palestine 2048 only - Jun 6 2:00 0 -
|
||||
Rule Palestine 2048 only - Jul 18 2:00 1:00 S
|
||||
Rule Palestine 2048 only - Jul 25 2:00 1:00 S
|
||||
Rule Palestine 2049 only - May 29 2:00 0 -
|
||||
Rule Palestine 2049 only - Jul 3 2:00 1:00 S
|
||||
Rule Palestine 2049 only - Jul 10 2:00 1:00 S
|
||||
Rule Palestine 2050 only - May 21 2:00 0 -
|
||||
Rule Palestine 2050 only - Jun 25 2:00 1:00 S
|
||||
Rule Palestine 2050 only - Jul 2 2:00 1:00 S
|
||||
Rule Palestine 2051 only - May 6 2:00 0 -
|
||||
Rule Palestine 2051 only - Jun 17 2:00 1:00 S
|
||||
Rule Palestine 2051 only - Jun 24 2:00 1:00 S
|
||||
Rule Palestine 2052 only - Apr 27 2:00 0 -
|
||||
Rule Palestine 2052 only - Jun 1 2:00 1:00 S
|
||||
Rule Palestine 2052 only - Jun 8 2:00 1:00 S
|
||||
Rule Palestine 2053 only - Apr 12 2:00 0 -
|
||||
Rule Palestine 2053 only - May 24 2:00 1:00 S
|
||||
Rule Palestine 2053 only - May 31 2:00 1:00 S
|
||||
Rule Palestine 2054 only - Apr 4 2:00 0 -
|
||||
Rule Palestine 2054 only - May 16 2:00 1:00 S
|
||||
Rule Palestine 2055 only - May 1 2:00 1:00 S
|
||||
Rule Palestine 2056 only - Apr 22 2:00 1:00 S
|
||||
Rule Palestine 2057 only - Apr 7 2:00 1:00 S
|
||||
Rule Palestine 2058 max - Mar Sat<=30 2:00 1:00 S
|
||||
Rule Palestine 2054 only - May 23 2:00 1:00 S
|
||||
Rule Palestine 2055 only - May 8 2:00 1:00 S
|
||||
Rule Palestine 2056 only - Apr 29 2:00 1:00 S
|
||||
Rule Palestine 2057 only - Apr 14 2:00 1:00 S
|
||||
Rule Palestine 2058 only - Apr 6 2:00 1:00 S
|
||||
Rule Palestine 2059 max - Mar Sat<=30 2:00 1:00 S
|
||||
Rule Palestine 2068 only - Oct 20 2:00 0 -
|
||||
Rule Palestine 2069 only - Oct 12 2:00 0 -
|
||||
Rule Palestine 2070 only - Oct 4 2:00 0 -
|
||||
Rule Palestine 2071 only - Sep 19 2:00 0 -
|
||||
Rule Palestine 2072 only - Sep 10 2:00 0 -
|
||||
Rule Palestine 2072 only - Oct 15 2:00 1:00 S
|
||||
Rule Palestine 2072 only - Oct 22 2:00 1:00 S
|
||||
Rule Palestine 2072 max - Oct Sat<=30 2:00 0 -
|
||||
Rule Palestine 2073 only - Sep 2 2:00 0 -
|
||||
Rule Palestine 2073 only - Oct 7 2:00 1:00 S
|
||||
Rule Palestine 2073 only - Oct 14 2:00 1:00 S
|
||||
Rule Palestine 2074 only - Aug 18 2:00 0 -
|
||||
Rule Palestine 2074 only - Sep 29 2:00 1:00 S
|
||||
Rule Palestine 2074 only - Oct 6 2:00 1:00 S
|
||||
Rule Palestine 2075 only - Aug 10 2:00 0 -
|
||||
Rule Palestine 2075 only - Sep 14 2:00 1:00 S
|
||||
Rule Palestine 2075 only - Sep 21 2:00 1:00 S
|
||||
Rule Palestine 2076 only - Jul 25 2:00 0 -
|
||||
Rule Palestine 2076 only - Sep 5 2:00 1:00 S
|
||||
Rule Palestine 2076 only - Sep 12 2:00 1:00 S
|
||||
Rule Palestine 2077 only - Jul 17 2:00 0 -
|
||||
Rule Palestine 2077 only - Aug 28 2:00 1:00 S
|
||||
Rule Palestine 2077 only - Sep 4 2:00 1:00 S
|
||||
Rule Palestine 2078 only - Jul 9 2:00 0 -
|
||||
Rule Palestine 2078 only - Aug 13 2:00 1:00 S
|
||||
Rule Palestine 2078 only - Aug 20 2:00 1:00 S
|
||||
Rule Palestine 2079 only - Jun 24 2:00 0 -
|
||||
Rule Palestine 2079 only - Aug 5 2:00 1:00 S
|
||||
Rule Palestine 2079 only - Aug 12 2:00 1:00 S
|
||||
Rule Palestine 2080 only - Jun 15 2:00 0 -
|
||||
Rule Palestine 2080 only - Jul 20 2:00 1:00 S
|
||||
Rule Palestine 2080 only - Jul 27 2:00 1:00 S
|
||||
Rule Palestine 2081 only - Jun 7 2:00 0 -
|
||||
Rule Palestine 2081 only - Jul 12 2:00 1:00 S
|
||||
Rule Palestine 2081 only - Jul 19 2:00 1:00 S
|
||||
Rule Palestine 2082 only - May 23 2:00 0 -
|
||||
Rule Palestine 2082 only - Jul 4 2:00 1:00 S
|
||||
Rule Palestine 2082 only - Jul 11 2:00 1:00 S
|
||||
Rule Palestine 2083 only - May 15 2:00 0 -
|
||||
Rule Palestine 2083 only - Jun 19 2:00 1:00 S
|
||||
Rule Palestine 2083 only - Jun 26 2:00 1:00 S
|
||||
Rule Palestine 2084 only - Apr 29 2:00 0 -
|
||||
Rule Palestine 2084 only - Jun 10 2:00 1:00 S
|
||||
Rule Palestine 2084 only - Jun 17 2:00 1:00 S
|
||||
Rule Palestine 2085 only - Apr 21 2:00 0 -
|
||||
Rule Palestine 2085 only - Jun 2 2:00 1:00 S
|
||||
Rule Palestine 2085 only - Jun 9 2:00 1:00 S
|
||||
Rule Palestine 2086 only - Apr 13 2:00 0 -
|
||||
Rule Palestine 2086 only - May 18 2:00 1:00 S
|
||||
Rule Palestine 2086 only - May 25 2:00 1:00 S
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
|
||||
@@ -3629,7 +3651,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
|
||||
|
||||
# Philippines
|
||||
|
||||
# From Paul Eggert (2018-11-18):
|
||||
# From Paul Eggert (2024-01-21):
|
||||
# The Spanish initially used American (west-of-Greenwich) time.
|
||||
# It is unknown what time Manila kept when the British occupied it from
|
||||
# 1762-10-06 through 1764-04; for now assume it kept American time.
|
||||
@@ -3637,7 +3659,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
|
||||
# Philippines, issued a proclamation announcing that 1844-12-30 was to
|
||||
# be immediately followed by 1845-01-01; see R.H. van Gent's
|
||||
# History of the International Date Line
|
||||
# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
|
||||
# https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm
|
||||
# The rest of the data entries are from Shanks & Pottenger.
|
||||
|
||||
# From Jesper Nørgaard Welen (2006-04-26):
|
||||
@@ -4064,7 +4086,8 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
|
||||
# The English-language name of Vietnam's most populous city is "Ho Chi Minh
|
||||
# City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters.
|
||||
|
||||
# From Paul Eggert (2022-07-27) after a 2014 heads-up from Trần Ngọc Quân:
|
||||
# From Paul Eggert (2024-01-14) after a 2014 heads-up from Trần Ngọc Quân
|
||||
# and a 2024-01-14 heads-up from Đoàn Trần Công Danh:
|
||||
# Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)"
|
||||
# (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50,
|
||||
# is quoted verbatim in:
|
||||
@@ -4094,14 +4117,35 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
|
||||
#
|
||||
# Trần cites the following sources; it's unclear which supplied the info above.
|
||||
#
|
||||
# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội,
|
||||
# No. 9, Paris, February 1982.
|
||||
# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội,
|
||||
# No. 9, Paris, February 1982.
|
||||
#
|
||||
# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)",
|
||||
# NXB Thống kê, Hanoi, 2000.
|
||||
# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)",
|
||||
# NXB Thống kê, Hanoi, 2000.
|
||||
#
|
||||
# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu",
|
||||
# NXB Thuận Hoá, Huế, 1995.
|
||||
# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu",
|
||||
# NXB Thuận Hoá, Huế, 1995.
|
||||
#
|
||||
# Here is the decision for the September 1945 transition:
|
||||
# Võ Nguyên Giáp, Việt Nam Dân Quốc Công Báo, No. 1 (1945-09-29), page 13
|
||||
# http://baochi.nlv.gov.vn/baochi/cgi-bin/baochi?a=d&d=JwvzO19450929.2.5&dliv=none
|
||||
# It says that on 1945-09-01 at 24:00, Vietnam moved back two hours, to +07.
|
||||
# It also mentions a 1945-03-29 decree (by a Japanese Goveror-General)
|
||||
# to set the time zone to +09, but does not say whether that decree
|
||||
# merely legalized an earlier change to +09.
|
||||
#
|
||||
# July 1955 transition:
|
||||
# Ngô Đình Diệm, Công Báo Việt Nam, No. 92 (1955-07-02), page 1780-1781
|
||||
# Ordinance (Dụ) No. 46 (1955-06-25)
|
||||
# http://ddsnext.crl.edu/titles/32341#?c=0&m=29&s=0&cv=4&r=0&xywh=-89%2C342%2C1724%2C1216
|
||||
# It says that on 1955-07-01 at 01:00, South Vietnam moved back 1 hour (to +07).
|
||||
#
|
||||
# December 1959 transition:
|
||||
# Ngô Đình Diệm, Công Báo Việt Nam Cộng Hòa, 1960 part 1 (1960-01-02), page 62
|
||||
# Decree (Sắc lệnh) No. 362-TTP (1959-12-30)
|
||||
# http://ddsnext.crl.edu/titles/32341#?c=0&m=138&s=0&cv=793&r=0&xywh=-54%2C1504%2C1705%2C1202
|
||||
# It says that on 1959-12-31 at 23:00, South Vietnam moved forward 1 hour (to +08).
|
||||
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
#STDOFF 7:06:30.13
|
||||
@@ -4109,9 +4153,9 @@ Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1
|
||||
7:06:30 - PLMT 1911 May 1 # Phù Liễn MT
|
||||
7:00 - +07 1942 Dec 31 23:00
|
||||
8:00 - +08 1945 Mar 14 23:00
|
||||
9:00 - +09 1945 Sep 2
|
||||
9:00 - +09 1945 Sep 1 24:00
|
||||
7:00 - +07 1947 Apr 1
|
||||
8:00 - +08 1955 Jul 1
|
||||
8:00 - +08 1955 Jul 1 01:00
|
||||
7:00 - +07 1959 Dec 31 23:00
|
||||
8:00 - +08 1975 Jun 13
|
||||
7:00 - +07
|
||||
|
||||
@@ -443,11 +443,11 @@ Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
|
||||
|
||||
# French Polynesia
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct # Rikitea
|
||||
Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct 1 # Rikitea
|
||||
-9:00 - -09
|
||||
Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct
|
||||
Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct 1
|
||||
-9:30 - -0930
|
||||
Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete
|
||||
Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct 1 # Papeete
|
||||
-10:00 - -10
|
||||
# Clipperton (near North America) is administered from French Polynesia;
|
||||
# it is uninhabited.
|
||||
@@ -825,7 +825,7 @@ Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5
|
||||
# Solomon Is
|
||||
# excludes Bougainville, for which see Papua New Guinea
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara
|
||||
Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara
|
||||
11:00 - +11
|
||||
|
||||
# Tokelau
|
||||
@@ -986,6 +986,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
|
||||
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
|
||||
# https://www.jstor.org/stable/1774359
|
||||
#
|
||||
# For the 1911/1912 establishment of standard time in French possessions, see:
|
||||
# Société Française de Physique, Recueil de constantes physiques (1913),
|
||||
# page 752, 18b.
|
||||
#
|
||||
# A reliable and entertaining source about time zones is
|
||||
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
|
||||
#
|
||||
@@ -2062,7 +2066,7 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
|
||||
# ordaining - by a masterpiece of diplomatic flattery - that
|
||||
# the Fourth of July should be celebrated twice in that year."
|
||||
# This happened in 1892, according to the Evening News (Sydney) of 1892-07-20.
|
||||
# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm
|
||||
# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm
|
||||
|
||||
# Although Shanks & Pottenger says they both switched to UT -11:30
|
||||
# in 1911, and to -11 in 1950. many earlier sources give -11
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
# These entries are for uses not otherwise covered by the tz database.
|
||||
# Their main practical use is for platforms like Android that lack
|
||||
# support for POSIX-style TZ strings. On such platforms these entries
|
||||
# support for POSIX.1-2017-style TZ strings. On such platforms these entries
|
||||
# can be useful if the timezone database is wrong or if a ship or
|
||||
# aircraft at sea is not in a timezone.
|
||||
|
||||
|
||||
@@ -1013,9 +1013,34 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
|
||||
# Czech Republic (Czechia)
|
||||
# Slovakia
|
||||
#
|
||||
# From Paul Eggert (2018-04-15):
|
||||
# The source for Czech data is: Kdy začíná a končí letní čas. 2018-04-15.
|
||||
# From Ivan Benovic (2024-01-30):
|
||||
# https://www.slov-lex.sk/pravne-predpisy/SK/ZZ/1946/54/
|
||||
# (This is an official link to the Czechoslovak Summer Time Act of
|
||||
# March 8, 1946 that authorizes the Czechoslovak government to set the
|
||||
# exact dates of change to summer time and back to Central European Time.
|
||||
# The act also implicitly confirms Central European Time as the
|
||||
# official time zone of Czechoslovakia and currently remains in force
|
||||
# in both the Czech Republic and Slovakia.)
|
||||
# https://www.psp.cz/eknih/1945pns/tisky/t0216_00.htm
|
||||
# (This is a link to the original legislative proposal dating back to
|
||||
# February 22, 1946. The accompanying memorandum to the proposal says
|
||||
# that an advisory committee on European railroad transportation that
|
||||
# met in Brussels in October 1945 decided that the change of time
|
||||
# should be carried out in all participating countries in a strictly
|
||||
# coordinated manner....)
|
||||
#
|
||||
# From Paul Eggert (2024-01-30):
|
||||
# The source for Czech data is: Kdy začíná a končí letní čas.
|
||||
# https://kalendar.beda.cz/kdy-zacina-a-konci-letni-cas
|
||||
# Its main text disagrees with its quoted sources only in 1918,
|
||||
# where the main text says spring and autumn transitions
|
||||
# occurred at 02:00 and 03:00 respectively (as usual),
|
||||
# whereas the 1918 source "Oznámení o zavedení letního času v roce 1918"
|
||||
# says transitions were at 01:00 and 02:00 respectively.
|
||||
# As the 1918 source appears to be a humorous piece, and it is
|
||||
# unlikely that Prague would have disagreed with its neighbors by an hour,
|
||||
# go with the main text for now.
|
||||
#
|
||||
# We know of no English-language name for historical Czech winter time;
|
||||
# abbreviate it as "GMT", as it happened to be GMT.
|
||||
#
|
||||
|
||||
@@ -26,13 +26,10 @@
|
||||
# This file is in the public domain.
|
||||
|
||||
# This file is generated automatically from the data in the public-domain
|
||||
# NIST format leap-seconds.list file, which can be copied from
|
||||
# <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
|
||||
# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
|
||||
# The NIST file is used instead of its IERS upstream counterpart
|
||||
# NIST/IERS format leap-seconds.list file, which can be copied from
|
||||
# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>
|
||||
# because under US law the NIST file is public domain
|
||||
# whereas the IERS file's copyright and license status is unclear.
|
||||
# or, in a variant with different comments, from
|
||||
# <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
|
||||
# For more about leap-seconds.list, please see
|
||||
# The NTP Timescale and Leap Seconds
|
||||
# <https://www.eecis.udel.edu/~mills/leap.html>.
|
||||
@@ -95,11 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S
|
||||
# Any additional leap seconds will come after this.
|
||||
# This Expires line is commented out for now,
|
||||
# so that pre-2020a zic implementations do not reject this file.
|
||||
#Expires 2024 Jun 28 00:00:00
|
||||
#Expires 2024 Dec 28 00:00:00
|
||||
|
||||
# POSIX timestamps for the data in this file:
|
||||
#updated 1467936000 (2016-07-08 00:00:00 UTC)
|
||||
#expires 1719532800 (2024-06-28 00:00:00 UTC)
|
||||
#updated 1704708379 (2024-01-08 10:06:19 UTC)
|
||||
#expires 1735344000 (2024-12-28 00:00:00 UTC)
|
||||
|
||||
# Updated through IERS Bulletin C66
|
||||
# File expires on: 28 June 2024
|
||||
# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
|
||||
# File expires on 28 December 2024
|
||||
|
||||
@@ -1291,6 +1291,10 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
|
||||
# <http://cs.ucla.edu/~eggert/The-Waste-of-Daylight-19th.pdf>
|
||||
# [PDF] (1914-03)
|
||||
#
|
||||
# For the 1911/1912 establishment of standard time in French possessions, see:
|
||||
# Société Française de Physique, Recueil de constantes physiques (1913),
|
||||
# page 752, 18b.
|
||||
#
|
||||
# See the 'europe' file for Greenland.
|
||||
|
||||
# Canada
|
||||
@@ -1377,7 +1381,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
|
||||
# From Paul Eggert (2014-10-18):
|
||||
# H. David Matthews and Mary Vincent's map
|
||||
# "It's about TIME", _Canadian Geographic_ (September-October 1998)
|
||||
# http://www.canadiangeographic.ca/Magazine/SO98/alacarte.asp
|
||||
# https://web.archive.org/web/19990827055050/https://canadiangeographic.ca/SO98/geomap.htm
|
||||
# contains detailed boundaries for regions observing nonstandard
|
||||
# time and daylight saving time arrangements in Canada circa 1998.
|
||||
#
|
||||
@@ -1665,6 +1669,15 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
|
||||
# Some cities in the United States have pushed the deadline back
|
||||
# three weeks and will change over from daylight saving in October.
|
||||
|
||||
# From Chris Walton (2024-01-09):
|
||||
# The [Toronto] changes in 1947, 1948, and 1949 took place at 2:00 a.m. local
|
||||
# time instead of midnight.... Toronto Daily Star - ...
|
||||
# April 2, 1947 - Page 39 ... April 7, 1948 - Page 13 ...
|
||||
# April 2, 1949 - Page 1 ... April 7, 1949 - Page 24 ...
|
||||
# November 25, 1949 - Page 52 ... April 21, 1950 - Page 14 ...
|
||||
# September 19, 1950 - Page 46 ... September 20, 1950 - Page 3 ...
|
||||
# November 24, 1950 - Page 21
|
||||
|
||||
# From Arthur David Olson (2010-07-17):
|
||||
#
|
||||
# "Standard Time and Time Zones in Canada" appeared in
|
||||
@@ -1726,13 +1739,9 @@ Rule Toronto 1927 1937 - Sep Sun>=25 2:00 0 S
|
||||
Rule Toronto 1928 1937 - Apr Sun>=25 2:00 1:00 D
|
||||
Rule Toronto 1938 1940 - Apr lastSun 2:00 1:00 D
|
||||
Rule Toronto 1938 1939 - Sep lastSun 2:00 0 S
|
||||
Rule Toronto 1945 1946 - Sep lastSun 2:00 0 S
|
||||
Rule Toronto 1946 only - Apr lastSun 2:00 1:00 D
|
||||
Rule Toronto 1947 1949 - Apr lastSun 0:00 1:00 D
|
||||
Rule Toronto 1947 1948 - Sep lastSun 0:00 0 S
|
||||
Rule Toronto 1949 only - Nov lastSun 0:00 0 S
|
||||
Rule Toronto 1950 1973 - Apr lastSun 2:00 1:00 D
|
||||
Rule Toronto 1950 only - Nov lastSun 2:00 0 S
|
||||
Rule Toronto 1945 1948 - Sep lastSun 2:00 0 S
|
||||
Rule Toronto 1946 1973 - Apr lastSun 2:00 1:00 D
|
||||
Rule Toronto 1949 1950 - Nov lastSun 2:00 0 S
|
||||
Rule Toronto 1951 1956 - Sep lastSun 2:00 0 S
|
||||
# Shanks & Pottenger say Toronto ended DST a week early in 1971,
|
||||
# namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this
|
||||
@@ -3455,7 +3464,7 @@ Zone America/Jamaica -5:07:10 - LMT 1890 # Kingston
|
||||
# Martinique
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France
|
||||
-4:04:20 - FFMT 1911 May # Fort-de-France MT
|
||||
-4:04:20 - FFMT 1911 May 1 # Fort-de-France MT
|
||||
-4:00 - AST 1980 Apr 6
|
||||
-4:00 1:00 ADT 1980 Sep 28
|
||||
-4:00 - AST
|
||||
@@ -3562,7 +3571,7 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan
|
||||
# St Pierre and Miquelon
|
||||
# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
|
||||
Zone America/Miquelon -3:44:40 - LMT 1911 Jun 15 # St Pierre
|
||||
-4:00 - AST 1980 May
|
||||
-3:00 - -03 1987
|
||||
-3:00 Canada -03/-02
|
||||
|
||||
@@ -1593,8 +1593,11 @@ Zone Atlantic/Stanley -3:51:24 - LMT 1890
|
||||
-3:00 - -03
|
||||
|
||||
# French Guiana
|
||||
# For the 1911/1912 establishment of standard time in French possessions, see:
|
||||
# Société Française de Physique, Recueil de constantes physiques (1913),
|
||||
# page 752, 18b.
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Cayenne -3:29:20 - LMT 1911 Jul
|
||||
Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1
|
||||
-4:00 - -04 1967 Oct
|
||||
-3:00 - -03
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# Need extra inlining to collapse all marking code into the hot marking loop
|
||||
BUILD_LIBJVM_shenandoahConcurrentMark.cpp_CXXFLAGS := --param inline-unit-growth=1000
|
||||
endif
|
||||
ifeq ($(call check-jvm-feature, dtrace), true)
|
||||
# DTRACE_PROBE macros trigger a maybe-uninitialized warning on 'ret'
|
||||
BUILD_LIBJVM_jni.cpp_CXXFLAGS := -Wno-maybe-uninitialized
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2023, 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
|
||||
@@ -30,6 +30,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
@@ -312,9 +313,15 @@ public class GenerateCurrencyData {
|
||||
validCurrencyCodes.substring(i * 7 + 3, i * 7 + 6));
|
||||
checkCurrencyCode(currencyCode);
|
||||
int tableEntry = mainTable[(currencyCode.charAt(0) - 'A') * A_TO_Z + (currencyCode.charAt(1) - 'A')];
|
||||
if (tableEntry == INVALID_COUNTRY_ENTRY ||
|
||||
(tableEntry & SPECIAL_CASE_COUNTRY_MASK) != 0 ||
|
||||
(tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) != (currencyCode.charAt(2) - 'A')) {
|
||||
|
||||
// Do not allow a future currency to be classified as an otherCurrency,
|
||||
// otherwise it will leak out into Currency:getAvailableCurrencies
|
||||
boolean futureCurrency = Arrays.asList(specialCaseNewCurrencies).contains(currencyCode);
|
||||
boolean simpleCurrency = (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) == (currencyCode.charAt(2) - 'A');
|
||||
|
||||
// If neither a simple currency, or one defined in the future
|
||||
// then the current currency is applicable to be added to the otherTable
|
||||
if (!futureCurrency && !simpleCurrency) {
|
||||
if (otherCurrenciesCount == maxOtherCurrencies) {
|
||||
throw new RuntimeException("too many other currencies");
|
||||
}
|
||||
|
||||
@@ -516,7 +516,6 @@ else
|
||||
LIBFREETYPE_LIBS := -lfreetype
|
||||
endif
|
||||
|
||||
# gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
@@ -529,7 +528,6 @@ else
|
||||
DISABLED_WARNINGS_microsoft := 4018 4267 4244 4312 4819, \
|
||||
DISABLED_WARNINGS_gcc := implicit-fallthrough cast-function-type bad-function-cast, \
|
||||
DISABLED_WARNINGS_clang := missing-declarations, \
|
||||
DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
))
|
||||
|
||||
@@ -105,11 +105,11 @@ class CgroupV1Subsystem: public CgroupSubsystem {
|
||||
|
||||
private:
|
||||
/* controllers */
|
||||
CachingCgroupController* _memory = NULL;
|
||||
CgroupV1Controller* _cpuset = NULL;
|
||||
CachingCgroupController* _cpu = NULL;
|
||||
CgroupV1Controller* _cpuacct = NULL;
|
||||
CgroupV1Controller* _pids = NULL;
|
||||
CachingCgroupController* _memory;
|
||||
CgroupV1Controller* _cpuset;
|
||||
CachingCgroupController* _cpu;
|
||||
CgroupV1Controller* _cpuacct;
|
||||
CgroupV1Controller* _pids;
|
||||
|
||||
char * pids_max_val();
|
||||
|
||||
|
||||
@@ -51,10 +51,10 @@ class CgroupV2Controller: public CgroupController {
|
||||
class CgroupV2Subsystem: public CgroupSubsystem {
|
||||
private:
|
||||
/* One unified controller */
|
||||
CgroupController* _unified = NULL;
|
||||
CgroupController* _unified;
|
||||
/* Caching wrappers for cpu/memory metrics */
|
||||
CachingCgroupController* _memory = NULL;
|
||||
CachingCgroupController* _cpu = NULL;
|
||||
CachingCgroupController* _memory;
|
||||
CachingCgroupController* _cpu;
|
||||
|
||||
char *mem_limit_val();
|
||||
char *mem_swp_limit_val();
|
||||
|
||||
@@ -1862,7 +1862,11 @@ PcDesc* PcDescContainer::find_pc_desc_internal(address pc, bool approximate, con
|
||||
|
||||
if (match_desc(upper, pc_offset, approximate)) {
|
||||
assert(upper == linear_search(search, pc_offset, approximate), "search ok");
|
||||
_pc_desc_cache.add_pc_desc(upper);
|
||||
if (!Thread::current_in_asgct()) {
|
||||
// we don't want to modify the cache if we're in ASGCT
|
||||
// which is typically called in a signal handler
|
||||
_pc_desc_cache.add_pc_desc(upper);
|
||||
}
|
||||
return upper;
|
||||
} else {
|
||||
assert(NULL == linear_search(search, pc_offset, approximate), "search ok");
|
||||
|
||||
@@ -40,9 +40,13 @@ Symbol::Symbol(const u1* name, int length, int refcount) {
|
||||
_refcount = refcount;
|
||||
_length = length;
|
||||
_identity_hash = (short)os::random();
|
||||
for (int i = 0; i < _length; i++) {
|
||||
byte_at_put(i, name[i]);
|
||||
}
|
||||
// _body[0..1] are allocated in the header just by coincidence in the current
|
||||
// implementation of Symbol. They are read by identity_hash(), so make sure they
|
||||
// are initialized.
|
||||
// No other code should assume that _body[0..1] are always allocated. E.g., do
|
||||
// not unconditionally read base()[0] as that will be invalid for an empty Symbol.
|
||||
_body[0] = _body[1] = 0;
|
||||
memcpy(_body, name, length);
|
||||
}
|
||||
|
||||
void* Symbol::operator new(size_t sz, int len, TRAPS) throw() {
|
||||
|
||||
@@ -128,11 +128,6 @@ class Symbol : public MetaspaceObj {
|
||||
return (int)heap_word_size(byte_size(length));
|
||||
}
|
||||
|
||||
void byte_at_put(int index, int value) {
|
||||
assert(index >=0 && index < _length, "symbol index overflow");
|
||||
_body[index] = value;
|
||||
}
|
||||
|
||||
Symbol(const u1* name, int length, int refcount);
|
||||
void* operator new(size_t size, int len, TRAPS) throw();
|
||||
void* operator new(size_t size, int len, Arena* arena, TRAPS) throw();
|
||||
|
||||
@@ -554,8 +554,9 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
|
||||
return;
|
||||
}
|
||||
|
||||
// !important! make sure all to call thread->set_in_asgct(false) before every return
|
||||
thread->set_in_asgct(true);
|
||||
|
||||
// signify to other code in the VM that we're in ASGCT
|
||||
ThreadInAsgct tia(thread);
|
||||
|
||||
switch (thread->thread_state()) {
|
||||
case _thread_new:
|
||||
@@ -614,7 +615,6 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
|
||||
trace->num_frames = ticks_unknown_state; // -7
|
||||
break;
|
||||
}
|
||||
thread->set_in_asgct(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -321,6 +321,7 @@ Thread::Thread() {
|
||||
}
|
||||
|
||||
MACOS_AARCH64_ONLY(DEBUG_ONLY(_wx_init = false));
|
||||
_in_asgct = false;
|
||||
}
|
||||
|
||||
void Thread::initialize_thread_current() {
|
||||
|
||||
@@ -762,6 +762,31 @@ protected:
|
||||
void init_wx();
|
||||
WXMode enable_wx(WXMode new_state);
|
||||
#endif // __APPLE__ && AARCH64
|
||||
|
||||
private:
|
||||
bool _in_asgct;
|
||||
public:
|
||||
bool in_asgct() const { return _in_asgct; }
|
||||
void set_in_asgct(bool value) { _in_asgct = value; }
|
||||
static bool current_in_asgct() {
|
||||
Thread *cur = Thread::current_or_null_safe();
|
||||
return cur != NULL && cur->in_asgct();
|
||||
}
|
||||
};
|
||||
|
||||
class ThreadInAsgct {
|
||||
private:
|
||||
Thread* _thread;
|
||||
public:
|
||||
ThreadInAsgct(Thread* thread) : _thread(thread) {
|
||||
assert(thread != NULL, "invariant");
|
||||
assert(!thread->in_asgct(), "invariant");
|
||||
thread->set_in_asgct(true);
|
||||
}
|
||||
~ThreadInAsgct() {
|
||||
assert(_thread->in_asgct(), "invariant");
|
||||
_thread->set_in_asgct(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Inline implementation of Thread::current()
|
||||
|
||||
@@ -1261,53 +1261,74 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
||||
}
|
||||
|
||||
private void expect100Continue() throws IOException {
|
||||
// Expect: 100-Continue was set, so check the return code for
|
||||
// Acceptance
|
||||
int oldTimeout = http.getReadTimeout();
|
||||
boolean enforceTimeOut = false;
|
||||
boolean timedOut = false;
|
||||
if (oldTimeout <= 0) {
|
||||
// 5s read timeout in case the server doesn't understand
|
||||
// Expect: 100-Continue
|
||||
http.setReadTimeout(5000);
|
||||
enforceTimeOut = true;
|
||||
// Expect: 100-Continue was set, so check the return code for
|
||||
// Acceptance
|
||||
int oldTimeout = http.getReadTimeout();
|
||||
boolean timedOut = false;
|
||||
boolean tempTimeOutSet = false;
|
||||
if (oldTimeout <= 0 || oldTimeout > 5000) {
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
logger.fine("Timeout currently set to " +
|
||||
oldTimeout + " temporarily setting it to 5 seconds");
|
||||
}
|
||||
// 5s read timeout in case the server doesn't understand
|
||||
// Expect: 100-Continue
|
||||
http.setReadTimeout(5000);
|
||||
tempTimeOutSet = true;
|
||||
}
|
||||
|
||||
try {
|
||||
http.parseHTTP(responses, pi, this);
|
||||
} catch (SocketTimeoutException se) {
|
||||
if (!enforceTimeOut) {
|
||||
throw se;
|
||||
}
|
||||
timedOut = true;
|
||||
http.setIgnoreContinue(true);
|
||||
try {
|
||||
http.parseHTTP(responses, pi, this);
|
||||
} catch (SocketTimeoutException se) {
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
logger.fine("SocketTimeoutException caught," +
|
||||
" will attempt to send body regardless");
|
||||
}
|
||||
if (!timedOut) {
|
||||
// Can't use getResponseCode() yet
|
||||
String resp = responses.getValue(0);
|
||||
// Parse the response which is of the form:
|
||||
// HTTP/1.1 417 Expectation Failed
|
||||
// HTTP/1.1 100 Continue
|
||||
if (resp != null && resp.startsWith("HTTP/")) {
|
||||
String[] sa = resp.split("\\s+");
|
||||
responseCode = -1;
|
||||
try {
|
||||
// Response code is 2nd token on the line
|
||||
if (sa.length > 1)
|
||||
responseCode = Integer.parseInt(sa[1]);
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
timedOut = true;
|
||||
}
|
||||
|
||||
if (!timedOut) {
|
||||
// Can't use getResponseCode() yet
|
||||
String resp = responses.getValue(0);
|
||||
// Parse the response which is of the form:
|
||||
// HTTP/1.1 417 Expectation Failed
|
||||
// HTTP/1.1 100 Continue
|
||||
if (resp != null && resp.startsWith("HTTP/")) {
|
||||
String[] sa = resp.split("\\s+");
|
||||
responseCode = -1;
|
||||
try {
|
||||
// Response code is 2nd token on the line
|
||||
if (sa.length > 1)
|
||||
responseCode = Integer.parseInt(sa[1]);
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
logger.fine("response code received " + responseCode);
|
||||
}
|
||||
}
|
||||
if (responseCode != 100) {
|
||||
throw new ProtocolException("Server rejected operation");
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
}
|
||||
}
|
||||
if (responseCode != 100) {
|
||||
// responseCode will be returned to caller
|
||||
throw new ProtocolException("Server rejected operation");
|
||||
}
|
||||
}
|
||||
|
||||
// If timeout was changed, restore to original value
|
||||
if (tempTimeOutSet) {
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
logger.fine("Restoring original timeout : " + oldTimeout);
|
||||
}
|
||||
http.setReadTimeout(oldTimeout);
|
||||
}
|
||||
|
||||
responseCode = -1;
|
||||
responses.reset();
|
||||
// Proceed
|
||||
// Ignore any future 100 continue messages
|
||||
http.setIgnoreContinue(true);
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
logger.fine("Set Ignore Continue to true");
|
||||
}
|
||||
|
||||
responseCode = -1;
|
||||
responses.reset();
|
||||
// Proceed
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1369,7 +1390,6 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
||||
boolean expectContinue = false;
|
||||
String expects = requests.findValue("Expect");
|
||||
if ("100-Continue".equalsIgnoreCase(expects) && streaming()) {
|
||||
http.setIgnoreContinue(false);
|
||||
expectContinue = true;
|
||||
}
|
||||
|
||||
@@ -1378,6 +1398,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
||||
}
|
||||
|
||||
if (expectContinue) {
|
||||
http.setIgnoreContinue(false);
|
||||
expect100Continue();
|
||||
}
|
||||
ps = (PrintStream)http.getOutputStream();
|
||||
@@ -1419,6 +1440,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
||||
}
|
||||
}
|
||||
|
||||
// Streaming returns true if there is a request body to send
|
||||
public boolean streaming () {
|
||||
return (fixedContentLength != -1) || (fixedContentLengthLong != -1) ||
|
||||
(chunkLength != -1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2023, 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
|
||||
@@ -266,6 +266,7 @@ XBB=XBB
|
||||
XBC=XBC
|
||||
XBD=XBD
|
||||
XCD=XCD
|
||||
XCG=XCG
|
||||
XDR=XDR
|
||||
XFO=XFO
|
||||
XFU=XFU
|
||||
@@ -491,6 +492,7 @@ xbb=European Monetary Unit
|
||||
xbc=European Unit of Account (XBC)
|
||||
xbd=European Unit of Account (XBD)
|
||||
xcd=East Caribbean Dollar
|
||||
xcg=Caribbean Guilder
|
||||
xdr=Special Drawing Rights
|
||||
xfo=French Gold Franc
|
||||
xfu=French UIC-Franc
|
||||
|
||||
@@ -90,6 +90,7 @@ typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme);
|
||||
typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc,
|
||||
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
|
||||
|
||||
typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
|
||||
typedef HTHEME(__stdcall *PFNOPENTHEMEDATAFORDPI)(HWND hwnd, LPCWSTR pszClassList, UINT dpi);
|
||||
|
||||
typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc,
|
||||
@@ -134,6 +135,7 @@ typedef HRESULT (__stdcall *PFNGETTHEMETRANSITIONDURATION)
|
||||
(HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo,
|
||||
int iPropId, DWORD *pdwDuration);
|
||||
|
||||
static PFNOPENTHEMEDATA OpenThemeDataFunc = NULL;
|
||||
static PFNOPENTHEMEDATAFORDPI OpenThemeDataForDpiFunc = NULL;
|
||||
static PFNDRAWTHEMEBACKGROUND DrawThemeBackground = NULL;
|
||||
static PFNCLOSETHEMEDATA CloseThemeData = NULL;
|
||||
@@ -154,13 +156,17 @@ static PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT
|
||||
//this function might not exist on Windows XP
|
||||
static PFNGETTHEMETRANSITIONDURATION GetThemeTransitionDuration = NULL;
|
||||
|
||||
constexpr unsigned int defaultDPI = 96;
|
||||
|
||||
BOOL InitThemes() {
|
||||
|
||||
static BOOL InitThemes() {
|
||||
static HMODULE hModThemes = NULL;
|
||||
hModThemes = JDK_LoadSystemLibrary("UXTHEME.DLL");
|
||||
DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes);
|
||||
if(hModThemes) {
|
||||
DTRACE_PRINTLN("Loaded UxTheme.dll\n");
|
||||
OpenThemeDataFunc = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes,
|
||||
"OpenThemeData");
|
||||
OpenThemeDataForDpiFunc = (PFNOPENTHEMEDATAFORDPI)GetProcAddress(
|
||||
hModThemes, "OpenThemeDataForDpi");
|
||||
DrawThemeBackground = (PFNDRAWTHEMEBACKGROUND)GetProcAddress(
|
||||
@@ -198,7 +204,7 @@ BOOL InitThemes() {
|
||||
(PFNGETTHEMETRANSITIONDURATION)GetProcAddress(hModThemes,
|
||||
"GetThemeTransitionDuration");
|
||||
|
||||
if(OpenThemeDataForDpiFunc
|
||||
if((OpenThemeDataForDpiFunc || OpenThemeDataFunc)
|
||||
&& DrawThemeBackground
|
||||
&& CloseThemeData
|
||||
&& DrawThemeText
|
||||
@@ -218,10 +224,12 @@ BOOL InitThemes() {
|
||||
DTRACE_PRINTLN("Loaded function pointers.\n");
|
||||
// We need to make sure we can load the Theme.
|
||||
// Use the default DPI value of 96 on windows.
|
||||
constexpr unsigned int defaultDPI = 96;
|
||||
HTHEME hTheme = OpenThemeDataForDpiFunc (
|
||||
AwtToolkit::GetInstance().GetHWnd(),
|
||||
L"Button", defaultDPI);
|
||||
HTHEME hTheme = OpenThemeDataForDpiFunc
|
||||
? OpenThemeDataForDpiFunc(AwtToolkit::GetInstance().GetHWnd(),
|
||||
L"Button", defaultDPI)
|
||||
: OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(),
|
||||
L"Button");
|
||||
|
||||
if(hTheme) {
|
||||
DTRACE_PRINTLN("Loaded Theme data.\n");
|
||||
CloseThemeData(hTheme);
|
||||
@@ -285,11 +293,13 @@ JNIEXPORT jlong JNICALL Java_sun_awt_windows_ThemeReader_openTheme
|
||||
JNU_ThrowOutOfMemoryError(env, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// We need to open the Theme on a Window that will stick around.
|
||||
// The best one for that purpose is the Toolkit window.
|
||||
HTHEME htheme = OpenThemeDataForDpiFunc(
|
||||
AwtToolkit::GetInstance().GetHWnd(),
|
||||
str, dpi);
|
||||
HTHEME htheme = OpenThemeDataForDpiFunc
|
||||
? OpenThemeDataForDpiFunc(AwtToolkit::GetInstance().GetHWnd(), str, dpi)
|
||||
: OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(), str);
|
||||
|
||||
JNU_ReleaseStringPlatformChars(env, widget, str);
|
||||
return (jlong) htheme;
|
||||
}
|
||||
@@ -469,9 +479,14 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground
|
||||
|
||||
rect.left = 0;
|
||||
rect.top = 0;
|
||||
rect.bottom = rectBottom;
|
||||
rect.right = rectRight;
|
||||
|
||||
if (OpenThemeDataForDpiFunc) {
|
||||
rect.bottom = rectBottom;
|
||||
rect.right = rectRight;
|
||||
} else {
|
||||
rect.bottom = h;
|
||||
rect.right = w;
|
||||
}
|
||||
ZeroMemory(pSrcBits,(BITS_PER_PIXEL>>3)*w*h);
|
||||
|
||||
HRESULT hres = DrawThemeBackground(hTheme, memDC, part, state, &rect, NULL);
|
||||
@@ -494,6 +509,28 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground
|
||||
ReleaseDC(NULL,defaultDC);
|
||||
}
|
||||
|
||||
static void rescale(SIZE *size) {
|
||||
static int dpiX = -1;
|
||||
static int dpiY = -1;
|
||||
|
||||
if (dpiX == -1 || dpiY == -1) {
|
||||
HWND hWnd = ::GetDesktopWindow();
|
||||
HDC hDC = ::GetDC(hWnd);
|
||||
dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||
dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||
::ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
if (dpiX !=0 && dpiX != defaultDPI) {
|
||||
float invScaleX = (float) defaultDPI / dpiX;
|
||||
size->cx = (int) round(size->cx * invScaleX);
|
||||
}
|
||||
if (dpiY != 0 && dpiY != defaultDPI) {
|
||||
float invScaleY = (float) defaultDPI / dpiY;
|
||||
size->cy = (int) round(size->cy * invScaleY);
|
||||
}
|
||||
}
|
||||
|
||||
jobject newInsets(JNIEnv *env, jint top, jint left, jint bottom, jint right) {
|
||||
if (env->EnsureLocalCapacity(2) < 0) {
|
||||
return NULL;
|
||||
@@ -785,6 +822,10 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPartSize
|
||||
CHECK_NULL_RETURN(dimMID, NULL);
|
||||
}
|
||||
|
||||
if (!OpenThemeDataForDpiFunc) {
|
||||
rescale(&size);
|
||||
}
|
||||
|
||||
jobject dimObj = env->NewObject(dimClassID, dimMID, size.cx, size.cy);
|
||||
if (safe_ExceptionOccurred(env)) {
|
||||
env->ExceptionDescribe();
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# All tests
|
||||
|
||||
all = \
|
||||
:hotspot_all
|
||||
|
||||
hotspot_all = \
|
||||
/
|
||||
|
||||
@@ -28,6 +33,8 @@ hotspot_all_no_apps = \
|
||||
/ \
|
||||
-applications
|
||||
|
||||
# Component test groups
|
||||
|
||||
hotspot_compiler = \
|
||||
compiler
|
||||
|
||||
@@ -417,6 +424,21 @@ hotspot_rest_runtime = \
|
||||
-:hotspot_nmt \
|
||||
-:hotspot_tier2_runtime_platform_agnostic
|
||||
|
||||
jcstress_part1 = \
|
||||
applications/jcstress/seqcst.java
|
||||
|
||||
jcstress_part2 = \
|
||||
applications/jcstress/accessAtomic.java \
|
||||
applications/jcstress/acqrel.java \
|
||||
applications/jcstress/atomics.java \
|
||||
applications/jcstress/coherence.java \
|
||||
applications/jcstress/locks.java
|
||||
|
||||
jcstress_part3 = \
|
||||
applications/jcstress \
|
||||
-:jcstress_part1 \
|
||||
-:jcstress_part2
|
||||
|
||||
# Stress tests against information provided by VM via JMX
|
||||
vmTestbase_nsk_monitoring = \
|
||||
vmTestbase/nsk/monitoring
|
||||
|
||||
@@ -29,6 +29,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.nio.file.Files;
|
||||
@@ -51,11 +52,6 @@ import java.util.function.Predicate;
|
||||
* Use jcstress test suite to generate jtreg tests in 'test.src' or current
|
||||
* directory. Used version is defined in JcstressRunner class.
|
||||
*
|
||||
* Each generated jtreg test file will contain several tests. Subdirectories are
|
||||
* used to allow running all tests from a file using command line. 'copy',
|
||||
* 'acqrel', 'fences', 'atomicity', 'seqcst.sync', 'seqcst.volatiles' and
|
||||
* 'other' tests will be generated.
|
||||
*
|
||||
* This generator depends on testlibrary, therefore it should be compiled and
|
||||
* added to classpath. One can replace @notest by @test in jtreg test
|
||||
* description above to run this class with jtreg.
|
||||
@@ -97,58 +93,18 @@ public class TestGenerator {
|
||||
" */\n\n", years);
|
||||
}
|
||||
|
||||
private static enum JcstressGroup {
|
||||
MEMEFFECTS("memeffects"),
|
||||
COPY("copy"),
|
||||
ACQREL("acqrel"),
|
||||
FENCES("fences"),
|
||||
ATOMICITY("atomicity"),
|
||||
SEQCST_SYNC("seqcst.sync"),
|
||||
SEQCST_VOLATILES("seqcst.volatiles"),
|
||||
OTHER("other", JcstressGroup.otherFilter());
|
||||
|
||||
private final String groupName;
|
||||
private final Predicate<String> filter;
|
||||
|
||||
private JcstressGroup(String groupName, Predicate<String> filter) {
|
||||
this.groupName = groupName;
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
private JcstressGroup(String groupName) {
|
||||
this(groupName, JcstressGroup.nameFilter(groupName));
|
||||
}
|
||||
|
||||
private static Predicate<String> nameFilter(String group) {
|
||||
return s -> s.startsWith("org.openjdk.jcstress.tests." + group + ".");
|
||||
}
|
||||
|
||||
private static Predicate<String> otherFilter() {
|
||||
return (s) -> {
|
||||
for (JcstressGroup g : EnumSet.complementOf(EnumSet.of(OTHER))) {
|
||||
if (g.filter.test(s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static String DESC_FORMAT = "\n"
|
||||
+ "/**\n"
|
||||
+ " * @test %1$s\n"
|
||||
+ " * @library /test/lib /\n"
|
||||
+ " * @run driver/timeout=2400 " + JcstressRunner.class.getName()
|
||||
+ " * @run driver/timeout=21600 " + JcstressRunner.class.getName()
|
||||
// verbose output
|
||||
+ " -v"
|
||||
// test mode preset
|
||||
+ " -m default"
|
||||
// test name
|
||||
+ " -t %1$s\n"
|
||||
+ " -t org.openjdk.jcstress.tests.%1$s\\.\n"
|
||||
+ " */\n";
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws IOException {
|
||||
Path path = JcstressRunner.pathToArtifact();
|
||||
Path output;
|
||||
try {
|
||||
@@ -162,56 +118,32 @@ public class TestGenerator {
|
||||
} catch (Exception e) {
|
||||
throw new Error("Can not get list of tests", e);
|
||||
}
|
||||
for (JcstressGroup group : JcstressGroup.values()) {
|
||||
try {
|
||||
try (BufferedReader reader = Files.newBufferedReader(output)) {
|
||||
// skip first 4 lines: name, -{80}, revision and empty line
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
reader.readLine();
|
||||
}
|
||||
new TestGenerator(group).generate(reader);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new Error("Generating tests for " + group.name()
|
||||
+ " has failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
BufferedReader reader = Files.newBufferedReader(output);
|
||||
|
||||
reader.lines()
|
||||
.skip(4) // skip first 4 lines: name, -{80}, revision and empty line
|
||||
.map(s -> s.split("\\.")[4]) // group by the package name following "org.openjdk.jcstress.tests."
|
||||
.distinct()
|
||||
.filter(s -> !s.startsWith("sample")) // skip sample test
|
||||
.forEach(TestGenerator::generate);
|
||||
|
||||
output.toFile().delete();
|
||||
}
|
||||
|
||||
private final JcstressGroup group;
|
||||
|
||||
private TestGenerator(JcstressGroup group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
private void generate(BufferedReader reader) throws IOException {
|
||||
// array is needed to change value inside a lambda
|
||||
long[] count = {0L};
|
||||
String root = Utils.TEST_SRC;
|
||||
Path testFile = Paths.get(root)
|
||||
.resolve(group.groupName)
|
||||
.resolve("Test.java");
|
||||
File testDir = testFile.getParent().toFile();
|
||||
if (!testDir.mkdirs() && !testDir.exists()) {
|
||||
throw new Error("Can not create directories for "
|
||||
+ testFile.toString());
|
||||
}
|
||||
private static void generate(String group) {
|
||||
Path testFile = Paths.get(Utils.TEST_SRC).resolve(group + ".java");
|
||||
|
||||
System.out.println("Generating " + testFile);
|
||||
try (PrintStream ps = new PrintStream(testFile.toFile())) {
|
||||
ps.print(COPYRIGHT);
|
||||
ps.printf("/* DO NOT MODIFY THIS FILE. GENERATED BY %s */\n",
|
||||
getClass().getName());
|
||||
TestGenerator.class.getName());
|
||||
|
||||
reader.lines()
|
||||
.filter(group.filter)
|
||||
.forEach(s -> {
|
||||
count[0]++;
|
||||
ps.printf(DESC_FORMAT, s);
|
||||
});
|
||||
ps.printf(DESC_FORMAT, group);
|
||||
ps.print('\n');
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("Failed to generate tests for " + group);
|
||||
}
|
||||
System.out.printf("%d tests generated in %s%n",
|
||||
count[0], group.groupName);
|
||||
}
|
||||
}
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/accessAtomic.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/accessAtomic.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test accessAtomic
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.accessAtomic\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/acqrel.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/acqrel.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test acqrel
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.acqrel\.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
31
test/hotspot/jtreg/applications/jcstress/atomicity.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/atomicity.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test atomicity
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.atomicity\.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
31
test/hotspot/jtreg/applications/jcstress/atomics.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/atomics.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test atomics
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.atomics\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/causality.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/causality.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test causality
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.causality\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/coherence.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/coherence.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test coherence
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.coherence\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/copy.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/copy.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test copy
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.copy\.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
31
test/hotspot/jtreg/applications/jcstress/countdownlatch.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/countdownlatch.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test countdownlatch
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.countdownlatch\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/defaultValues.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/defaultValues.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test defaultValues
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.defaultValues\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/executors.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/executors.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test executors
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.executors\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/fences.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/fences.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test fences
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.fences\.
|
||||
*/
|
||||
|
||||
@@ -1,829 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.FencedAcquireReleaseTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.FencedAcquireReleaseTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.FencedDekkerTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.FencedDekkerTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.FencedPublicationTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.FencedPublicationTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.FencedReadTwiceTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.FencedReadTwiceTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.UnfencedAcquireReleaseTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.UnfencedAcquireReleaseTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.UnfencedDekkerTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.UnfencedDekkerTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.UnfencedPublicationTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.UnfencedPublicationTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.UnfencedReadTwiceTest
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.UnfencedReadTwiceTest
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.AcquireFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadLoadFenceTest.LoadLoadFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest1.ReleaseFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.AcquireFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.LoadStoreFenceTest2.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreLoadFenceTest.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.ReleaseFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest1.StoreStoreFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.FullFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.ReleaseFenceString
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceBoolean
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceBoolean
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceByte
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceByte
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceChar
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceChar
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceDouble
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceDouble
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceFloat
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceFloat
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceInt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceInt
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceLong
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceLong
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceShort
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceShort
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceString
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=2400 applications.jcstress.JcstressRunner -v -m default -t org.openjdk.jcstress.tests.fences.varHandles.StoreStoreFenceTest2.StoreStoreFenceString
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/future.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/future.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test future
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.future\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/init.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/init.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test init
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.init\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/initClass.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/initClass.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test initClass
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.initClass\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/initLen.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/initLen.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test initLen
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.initLen\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/interrupt.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/interrupt.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test interrupt
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.interrupt\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/locks.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/locks.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test locks
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.locks\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/memeffects.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/memeffects.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test memeffects
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.memeffects\.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
31
test/hotspot/jtreg/applications/jcstress/seqcst.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/seqcst.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test seqcst
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.seqcst\.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
31
test/hotspot/jtreg/applications/jcstress/singletons.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/singletons.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test singletons
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.singletons\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/strings.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/strings.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test strings
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.strings\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/tearing.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/tearing.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test tearing
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.tearing\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/unsafe.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/unsafe.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test unsafe
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.unsafe\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/varhandles.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/varhandles.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test varhandles
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.varhandles\.
|
||||
*/
|
||||
|
||||
31
test/hotspot/jtreg/applications/jcstress/volatiles.java
Normal file
31
test/hotspot/jtreg/applications/jcstress/volatiles.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, 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.
|
||||
*/
|
||||
|
||||
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
|
||||
|
||||
/**
|
||||
* @test volatiles
|
||||
* @library /test/lib /
|
||||
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.volatiles\.
|
||||
*/
|
||||
|
||||
@@ -205,7 +205,8 @@ public class LevelTransitionTest extends TieredLevelsTest {
|
||||
}
|
||||
|
||||
private static class CompileMethodHolder {
|
||||
private final int iter = 10;
|
||||
// Make sure that loop backedge is never taken to prevent unexpected OSR compilations.
|
||||
private final int iter = 1;
|
||||
private int field = 42;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@@ -53,7 +53,7 @@ public class TestArrayAllocatorMallocLimit {
|
||||
private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *";
|
||||
|
||||
public static void testDefaultValue() throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(
|
||||
"-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2018, 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.
|
||||
#
|
||||
|
||||
exclusiveAccess.dirs=.
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2018, 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.
|
||||
#
|
||||
|
||||
exclusiveAccess.dirs=.
|
||||
@@ -20,6 +20,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# All tests
|
||||
|
||||
all = \
|
||||
:jaxp_all
|
||||
|
||||
jaxp_all = \
|
||||
/
|
||||
|
||||
# Tiered testing definitions
|
||||
|
||||
# No jaxp tests are tier 1.
|
||||
@@ -34,6 +42,3 @@ tier3 =
|
||||
|
||||
# No tier 4 tests.
|
||||
tier4 =
|
||||
|
||||
jaxp_all = \
|
||||
javax/xml/jaxp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2022, 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
|
||||
@@ -23,7 +23,9 @@
|
||||
package jaxp.library;
|
||||
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.security.CodeSource;
|
||||
import java.security.Permission;
|
||||
import java.security.PermissionCollection;
|
||||
@@ -161,7 +163,7 @@ public class JAXPPolicyManager {
|
||||
*/
|
||||
class TestPolicy extends Policy {
|
||||
private final static Set<String> TEST_JARS =
|
||||
Set.of("jtreg.jar", "javatest.jar", "testng.jar", "jcommander.jar");
|
||||
Set.of("jtreg.*jar", "javatest.*jar", "testng.*jar", "jcommander.*jar");
|
||||
private final PermissionCollection permissions = new Permissions();
|
||||
|
||||
private ThreadLocal<Map<Integer, Permission>> transientPermissions = new ThreadLocal<>();
|
||||
@@ -213,9 +215,10 @@ class TestPolicy extends Policy {
|
||||
private boolean isTestMachineryDomain(ProtectionDomain domain) {
|
||||
CodeSource cs = (domain == null) ? null : domain.getCodeSource();
|
||||
URL loc = (cs == null) ? null : cs.getLocation();
|
||||
String path = (loc == null) ? null : loc.getPath();
|
||||
return path != null && TEST_JARS.stream()
|
||||
.filter(path::endsWith)
|
||||
URI uri = (loc == null) ? null : URI.create(loc.toString());
|
||||
String name = (uri == null) ? null : Path.of(uri).getFileName().toString();
|
||||
return name != null && TEST_JARS.stream()
|
||||
.filter(name::matches)
|
||||
.findAny()
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
@@ -517,7 +517,6 @@ java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-
|
||||
# jdk_io
|
||||
|
||||
java/io/pathNames/GeneralWin32.java 8180264 windows-all
|
||||
java/io/File/createTempFile/SpecialTempFile.java 8274122 windows11
|
||||
|
||||
############################################################################
|
||||
|
||||
|
||||
@@ -20,6 +20,17 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# All tests
|
||||
#
|
||||
|
||||
all = \
|
||||
:jdk_all
|
||||
|
||||
jdk_all = \
|
||||
/
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Tiered testing definitions
|
||||
|
||||
@@ -57,12 +57,11 @@ public class JdwpOnThrowTest {
|
||||
private static AttachingConnector attachingConnector;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
int port = findFreePort();
|
||||
try (Debuggee debuggee = Debuggee.launcher("ThrowCaughtException").setAddress("localhost:" + port)
|
||||
.enableOnThrow("Ex", "Start").setSuspended(true).launch()) {
|
||||
try (Debuggee debuggee = Debuggee.launcher("ThrowCaughtException")
|
||||
.enableOnThrow("Ex").setSuspended(true).launch()) {
|
||||
VirtualMachine vm = null;
|
||||
try {
|
||||
vm = attach("localhost", "" + port);
|
||||
vm = attach("localhost", debuggee.getAddress());
|
||||
EventQueue queue = vm.eventQueue();
|
||||
log("Waiting for exception event");
|
||||
long start = System.currentTimeMillis();
|
||||
@@ -111,14 +110,6 @@ public class JdwpOnThrowTest {
|
||||
}
|
||||
}
|
||||
|
||||
private static int findFreePort() {
|
||||
try (ServerSocket socket = new ServerSocket(0)) {
|
||||
return socket.getLocalPort();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static VirtualMachine attach(String address, String port) throws IOException {
|
||||
if (attachingConnector == null) {
|
||||
attachingConnector = (AttachingConnector)getConnector(ATTACH_CONNECTOR);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023, 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
|
||||
@@ -24,6 +24,7 @@
|
||||
package lib.jdb;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
import jdk.test.lib.util.Pair;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
import java.io.Closeable;
|
||||
@@ -32,6 +33,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -65,12 +67,12 @@ public class Debuggee implements Closeable {
|
||||
public static class Launcher {
|
||||
private final String mainClass;
|
||||
private final List<String> options = new LinkedList<>();
|
||||
private String vmOptions = null;
|
||||
private String transport = "dt_socket";
|
||||
private String address = null;
|
||||
private boolean suspended = true;
|
||||
private String onthrow = "";
|
||||
private boolean waitForPortPrint = true;
|
||||
private String expectedOutputBeforeThrow = "";
|
||||
private static final String LAUNCH_ECHO_STRING = "Listen Args:";
|
||||
|
||||
private Launcher(String mainClass) {
|
||||
this.mainClass = mainClass;
|
||||
@@ -83,6 +85,10 @@ public class Debuggee implements Closeable {
|
||||
this.options.addAll(options);
|
||||
return this;
|
||||
}
|
||||
public Launcher addVMOptions(String vmOptions) {
|
||||
this.vmOptions = vmOptions;
|
||||
return this;
|
||||
}
|
||||
// default is "dt_socket"
|
||||
public Launcher setTransport(String value) {
|
||||
transport = value;
|
||||
@@ -99,17 +105,17 @@ public class Debuggee implements Closeable {
|
||||
return this;
|
||||
}
|
||||
|
||||
// required to pass non null port with address and emit string before the throw
|
||||
public Launcher enableOnThrow(String value, String expectedOutputBeforeThrow) {
|
||||
this.onthrow = value;
|
||||
this.waitForPortPrint = false;
|
||||
this.expectedOutputBeforeThrow = expectedOutputBeforeThrow;
|
||||
public Launcher enableOnThrow(String exceptionClassName) {
|
||||
this.onthrow = exceptionClassName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProcessBuilder prepare() {
|
||||
List<String> debuggeeArgs = new LinkedList<>();
|
||||
String onthrowArgs = onthrow.isEmpty() ? "" : ",onthrow=" + onthrow + ",launch=exit";
|
||||
if (vmOptions != null) {
|
||||
debuggeeArgs.add(vmOptions);
|
||||
}
|
||||
String onthrowArgs = onthrow.isEmpty() ? "" : ",onthrow=" + onthrow + ",launch=echo " + LAUNCH_ECHO_STRING;
|
||||
debuggeeArgs.add("-agentlib:jdwp=transport=" + transport
|
||||
+ (address == null ? "" : ",address=" + address)
|
||||
+ ",server=y,suspend=" + (suspended ? "y" : "n")
|
||||
@@ -120,41 +126,57 @@ public class Debuggee implements Closeable {
|
||||
}
|
||||
|
||||
public Debuggee launch(String name) {
|
||||
return new Debuggee(prepare(), name, waitForPortPrint, expectedOutputBeforeThrow);
|
||||
return new Debuggee(prepare(), name,
|
||||
onthrow.isEmpty() ?
|
||||
Launcher::parseListenAddress :
|
||||
Launcher::parseLaunchEchoListenAddress
|
||||
);
|
||||
}
|
||||
public Debuggee launch() {
|
||||
return launch("debuggee");
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses debuggee output to get listening transport and address, printed by `launch=echo`.
|
||||
* Returns null if the string specified does not contain required info.
|
||||
*/
|
||||
private static Pair<String, String> parseLaunchEchoListenAddress(String debuggeeOutput) {
|
||||
Pattern listenRegexp = Pattern.compile(LAUNCH_ECHO_STRING + " \\b(.+)\\b \\b(.+)\\b");
|
||||
Matcher m = listenRegexp.matcher(debuggeeOutput);
|
||||
if (m.find()) {
|
||||
return new Pair<String, String>(m.group(1), m.group(2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses debuggee output to get listening transport and address, printed by `launch=echo`.
|
||||
* Returns null if the string specified does not contain required info.
|
||||
*/
|
||||
private static Pair<String, String> parseListenAddress(String debuggeeOutput) {
|
||||
Pattern listenRegexp = Pattern.compile("Listening for transport \\b(.+)\\b at address: \\b(.+)\\b");
|
||||
Matcher m = listenRegexp.matcher(debuggeeOutput);
|
||||
if (m.find()) {
|
||||
return new Pair<String, String>(m.group(1), m.group(2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// starts the process, waits for "Listening for transport" output and detects transport/address
|
||||
private Debuggee(ProcessBuilder pb, String name, boolean waitForPortPrint, String expectedOutputBeforeThrow) {
|
||||
// debuggeeListen[0] - transport, debuggeeListen[1] - address
|
||||
// starts the process, waits until the provided addressDetector detects transport/address from the process output
|
||||
private Debuggee(ProcessBuilder pb, String name, Function<String, Pair<String, String>> addressDetector) {
|
||||
String[] debuggeeListen = new String[2];
|
||||
Pattern listenRegexp = Pattern.compile("Listening for transport \\b(.+)\\b at address: \\b(.+)\\b");
|
||||
if (!waitForPortPrint) {
|
||||
try {
|
||||
p = ProcessTools.startProcess(name, pb, s -> {output.add(s);}, s -> {
|
||||
return s.equals(expectedOutputBeforeThrow);
|
||||
}, 30, TimeUnit.SECONDS);
|
||||
} catch (IOException | InterruptedException | TimeoutException ex) {
|
||||
throw new RuntimeException("failed to launch debuggee", ex);
|
||||
}
|
||||
transport = null;
|
||||
address = null;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
p = ProcessTools.startProcess(name, pb,
|
||||
s -> output.add(s), // output consumer
|
||||
s -> { // warm-up predicate
|
||||
Matcher m = listenRegexp.matcher(s);
|
||||
if (!m.matches()) {
|
||||
return false;
|
||||
s -> {
|
||||
Pair<String, String> addr = addressDetector.apply(s);
|
||||
if (addr != null) {
|
||||
debuggeeListen[0] = addr.first;
|
||||
debuggeeListen[1] = addr.second;
|
||||
return true;
|
||||
}
|
||||
debuggeeListen[0] = m.group(1);
|
||||
debuggeeListen[1] = m.group(2);
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
30, TimeUnit.SECONDS);
|
||||
transport = debuggeeListen[0];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@@ -124,7 +124,7 @@ public class LdapPoolTimeoutTest {
|
||||
// assertCompletion may wrap a CommunicationException in an RTE
|
||||
assertNotNull(msg);
|
||||
assertTrue(msg.contains("Network is unreachable")
|
||||
|| msg.contains("No route to host"));
|
||||
|| msg.contains("No route to host") || msg.contains("Connection timed out"));
|
||||
} catch (NamingException ex) {
|
||||
String msg = ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage();
|
||||
System.err.println("MSG: " + msg);
|
||||
|
||||
376
test/jdk/java/awt/Component/GetListenersTest.java
Normal file
376
test/jdk/java/awt/Component/GetListenersTest.java
Normal file
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, 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 4240721
|
||||
@summary Test Component.getListeners API added in 1.3
|
||||
@key headful
|
||||
@run main GetListenersTest
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Checkbox;
|
||||
import java.awt.CheckboxMenuItem;
|
||||
import java.awt.Choice;
|
||||
import java.awt.Component;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Label;
|
||||
import java.awt.Menu;
|
||||
import java.awt.MenuBar;
|
||||
import java.awt.MenuItem;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Scrollbar;
|
||||
import java.awt.TextArea;
|
||||
import java.awt.TextField;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.AdjustmentListener;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.ContainerAdapter;
|
||||
import java.awt.event.ContainerListener;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.HierarchyBoundsAdapter;
|
||||
import java.awt.event.HierarchyBoundsListener;
|
||||
import java.awt.event.HierarchyEvent;
|
||||
import java.awt.event.HierarchyListener;
|
||||
import java.awt.event.InputMethodEvent;
|
||||
import java.awt.event.InputMethodListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.MouseWheelListener;
|
||||
import java.awt.event.TextEvent;
|
||||
import java.awt.event.TextListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowFocusListener;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.beans.BeanInfo;
|
||||
import java.beans.EventSetDescriptor;
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.EventListener;
|
||||
|
||||
public class GetListenersTest {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
EventQueue.invokeAndWait(()-> {
|
||||
// Create frame with a bunch of components
|
||||
// and test that each component returns
|
||||
// the right type of listeners from Component.getListeners
|
||||
GLTFrame gltFrame = new GLTFrame();
|
||||
try {
|
||||
gltFrame.initAndShowGui();
|
||||
gltFrame.test();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Test failed", e);
|
||||
} finally {
|
||||
gltFrame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks an object has a listener for every support listener type
|
||||
*/
|
||||
static void checkForListenersOfEveryType(Object object) throws Exception {
|
||||
Class type = object.getClass();
|
||||
|
||||
BeanInfo info = Introspector.getBeanInfo(type);
|
||||
EventSetDescriptor esets[] = info.getEventSetDescriptors();
|
||||
|
||||
// ensure there are listeners for every type
|
||||
for (int nset = 0; nset < esets.length; nset++) {
|
||||
Class listenerType = esets[nset].getListenerType();
|
||||
EventListener listener[] = getListeners(object, listenerType);
|
||||
// Skip PropertyChangeListener for now
|
||||
if (listener.length == 0 && validListenerToTest(listenerType)) {
|
||||
throw new RuntimeException("getListeners didn't return type "
|
||||
+ listenerType);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("************");
|
||||
System.out.println("PASSED: getListeners on "
|
||||
+ object + " has all the right listeners.");
|
||||
System.out.println("************");
|
||||
}
|
||||
|
||||
/*
|
||||
* Calls getListeners on the object
|
||||
*/
|
||||
static EventListener[] getListeners(Object object, Class type)
|
||||
throws Exception {
|
||||
Method methods[] = object.getClass().getMethods();
|
||||
Method method = null;
|
||||
|
||||
for (int nmethod = 0; nmethod < methods.length; nmethod++) {
|
||||
if (methods[nmethod].getName().equals("getListeners")) {
|
||||
method = methods[nmethod];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new RuntimeException("Object "
|
||||
+ object + " has no getListeners method");
|
||||
}
|
||||
Class params[] = {type};
|
||||
EventListener listeners[] = null;
|
||||
listeners = (EventListener[]) method.invoke(object, params);
|
||||
System.out.println("Listeners of type: " + type + " on " + object);
|
||||
GetListenersTest.printArray(listeners);
|
||||
return listeners;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a listener of every type to the object
|
||||
*/
|
||||
static void addDummyListenersOfEveryType(Object object) throws Exception {
|
||||
Class type = object.getClass();
|
||||
|
||||
BeanInfo info = Introspector.getBeanInfo(type);
|
||||
EventSetDescriptor esets[] = info.getEventSetDescriptors();
|
||||
|
||||
// add every kind of listener
|
||||
for (int nset = 0; nset < esets.length; nset++) {
|
||||
Class listenerType = esets[nset].getListenerType();
|
||||
EventListener listener = makeListener(listenerType);
|
||||
Method addListenerMethod = esets[nset].getAddListenerMethod();
|
||||
Object params[] = {listener};
|
||||
addListenerMethod.invoke(object, params);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Determines what listeners to exclude from the test for now
|
||||
*/
|
||||
static boolean validListenerToTest(Class listenerType) {
|
||||
/* Don't have any provision for PropertyChangeListeners... */
|
||||
if ( listenerType == PropertyChangeListener.class ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void testGetListeners(Object object) throws Exception {
|
||||
GetListenersTest.addDummyListenersOfEveryType(object);
|
||||
GetListenersTest.checkForListenersOfEveryType(object);
|
||||
}
|
||||
|
||||
static void printArray(Object objects[]) {
|
||||
System.out.println("{");
|
||||
for(int n = 0; n < objects.length; n++) {
|
||||
System.out.println("\t"+objects[n]+",");
|
||||
}
|
||||
System.out.println("}");
|
||||
}
|
||||
|
||||
/*
|
||||
* Makes a dummy listener implementation for the given listener type
|
||||
*/
|
||||
static EventListener makeListener(Class listenerType) throws Exception {
|
||||
Object map[][] = {
|
||||
{ActionListener.class, MyActionAdapter.class},
|
||||
{AdjustmentListener.class, MyAdjustmentAdapter.class},
|
||||
{ComponentListener.class, MyComponentAdapter.class},
|
||||
{ContainerListener.class, MyContainerAdapter.class},
|
||||
{FocusListener.class, MyFocusAdapter.class},
|
||||
{HierarchyBoundsListener.class, MyHierarchyBoundsAdapter.class},
|
||||
{HierarchyListener.class, MyHierarchyAdapter.class},
|
||||
{InputMethodListener.class, MyInputMethodAdapter.class},
|
||||
{ItemListener.class, MyItemAdapter.class},
|
||||
{KeyListener.class, MyKeyAdapter.class},
|
||||
{MouseListener.class, MyMouseAdapter.class},
|
||||
{MouseMotionListener.class, MyMouseMotionAdapter.class},
|
||||
{MouseWheelListener.class, MyMouseWheelAdapter.class},
|
||||
{TextListener.class, MyTextAdapter.class},
|
||||
{WindowListener.class, MyWindowAdapter.class},
|
||||
{WindowFocusListener.class, MyWindowFocusAdapter.class},
|
||||
{WindowStateListener.class, MyWindowStateAdapter.class},
|
||||
{PropertyChangeListener.class, MyPropertyChangeAdapter.class},
|
||||
};
|
||||
|
||||
for (int n = 0; n < map.length; n++) {
|
||||
if (map[n][0] == listenerType) {
|
||||
Class adapterClass = (Class) map[n][1];
|
||||
EventListener listener =
|
||||
(EventListener) adapterClass.newInstance();
|
||||
return listener;
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException("No adapter found for listener type "
|
||||
+ listenerType);
|
||||
}
|
||||
}
|
||||
|
||||
class GLTFrame extends Frame {
|
||||
MenuItem mitem;
|
||||
CheckboxMenuItem cmitem;
|
||||
|
||||
GLTFrame() {
|
||||
super("Component.getListeners API Test");
|
||||
}
|
||||
|
||||
public void initAndShowGui() {
|
||||
setLayout(new FlowLayout());
|
||||
|
||||
add(new Label("Label"));
|
||||
add(new Button("Button"));
|
||||
add(new Checkbox("Checkbox"));
|
||||
Choice c = new Choice();
|
||||
c.add("choice");
|
||||
java.awt.List l = new java.awt.List();
|
||||
l.add("list");
|
||||
add(new Scrollbar());
|
||||
add(new TextField("TextField"));
|
||||
add(new TextArea("TextArea"));
|
||||
add(new Panel());
|
||||
add(new Canvas());
|
||||
|
||||
MenuBar menuBar = new MenuBar();
|
||||
Menu menu = new Menu("Menu");
|
||||
mitem = new MenuItem("Item 1");
|
||||
cmitem = new CheckboxMenuItem("Item 2");
|
||||
menu.add(mitem);
|
||||
menu.add(cmitem);
|
||||
menuBar.add(menu);
|
||||
setMenuBar(menuBar);
|
||||
|
||||
pack();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
// test Frame.getListeners
|
||||
GetListenersTest.testGetListeners(this);
|
||||
|
||||
//
|
||||
// test getListeners on menu items
|
||||
//
|
||||
GetListenersTest.testGetListeners(mitem);
|
||||
GetListenersTest.testGetListeners(cmitem);
|
||||
|
||||
//
|
||||
// test getListeners on all AWT Components
|
||||
//
|
||||
Component components[] = getComponents();
|
||||
for (int nc = 0; nc < components.length; nc++) {
|
||||
GetListenersTest.testGetListeners(components[nc]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* Dummy listener implementations we add to our components/models/objects
|
||||
*/
|
||||
|
||||
class MyPropertyChangeAdapter implements PropertyChangeListener {
|
||||
public void propertyChange(PropertyChangeEvent evt) {}
|
||||
}
|
||||
|
||||
class MyActionAdapter implements ActionListener {
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyAdjustmentAdapter implements AdjustmentListener {
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyHierarchyAdapter implements HierarchyListener {
|
||||
public void hierarchyChanged(HierarchyEvent e) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyInputMethodAdapter implements InputMethodListener {
|
||||
public void inputMethodTextChanged(InputMethodEvent event) {
|
||||
}
|
||||
|
||||
public void caretPositionChanged(InputMethodEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyItemAdapter implements ItemListener {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyTextAdapter implements TextListener {
|
||||
public void textValueChanged(TextEvent e) {
|
||||
}
|
||||
}
|
||||
|
||||
class MyComponentAdapter extends ComponentAdapter {
|
||||
}
|
||||
|
||||
class MyContainerAdapter extends ContainerAdapter {
|
||||
}
|
||||
|
||||
class MyFocusAdapter extends FocusAdapter {
|
||||
}
|
||||
|
||||
class MyHierarchyBoundsAdapter extends HierarchyBoundsAdapter {
|
||||
}
|
||||
|
||||
class MyKeyAdapter extends KeyAdapter {
|
||||
}
|
||||
|
||||
class MyMouseAdapter extends MouseAdapter {
|
||||
}
|
||||
|
||||
class MyMouseMotionAdapter extends MouseMotionAdapter {
|
||||
}
|
||||
|
||||
class MyMouseWheelAdapter implements MouseWheelListener {
|
||||
public void mouseWheelMoved(MouseWheelEvent e) {}
|
||||
}
|
||||
|
||||
class MyWindowAdapter extends WindowAdapter {
|
||||
}
|
||||
|
||||
class MyWindowFocusAdapter implements WindowFocusListener {
|
||||
public void windowGainedFocus(WindowEvent t) {}
|
||||
public void windowLostFocus(WindowEvent t) {}
|
||||
}
|
||||
|
||||
class MyWindowStateAdapter extends WindowAdapter {
|
||||
}
|
||||
127
test/jdk/java/awt/Container/OpenedPopupFrameDisposal.java
Normal file
127
test/jdk/java/awt/Container/OpenedPopupFrameDisposal.java
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4852790
|
||||
@summary Frame disposal must remove opened popup without exception
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
|
||||
public class OpenedPopupFrameDisposal {
|
||||
public static final int SIZE = 300;
|
||||
|
||||
volatile JFrame jf = null;
|
||||
volatile JComboBox<String> jcb = null;
|
||||
|
||||
public void start() {
|
||||
jf = new JFrame("OpenedPopupFrameDisposal - Frame to dispose");
|
||||
// Note that original bug cannot be reproduced without JMenuBar present.
|
||||
jf.setJMenuBar(new JMenuBar());
|
||||
jf.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
jf.setLocationRelativeTo(null);
|
||||
jf.addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent evt) {
|
||||
jf.setVisible(false);
|
||||
jf.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JPanel panel = new JPanel(new FlowLayout());
|
||||
jcb = new JComboBox<>();
|
||||
jcb.addItem("one");
|
||||
jcb.addItem("two");
|
||||
jcb.addItem("Three");
|
||||
panel.add(jcb);
|
||||
|
||||
jf.getContentPane().add(panel, BorderLayout.CENTER);
|
||||
jf.pack();
|
||||
jf.setSize(new Dimension(SIZE, SIZE));
|
||||
|
||||
jf.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
Robot robot = new Robot();
|
||||
robot.delay(1000); // wait for jf visible
|
||||
Point pt = jf.getLocationOnScreen();
|
||||
|
||||
int x, y;
|
||||
|
||||
x = pt.x + SIZE / 2;
|
||||
y = pt.y + SIZE / 2;
|
||||
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1000);
|
||||
|
||||
pt = jcb.getLocationOnScreen();
|
||||
x = pt.x + jcb.getWidth() / 2;
|
||||
y = pt.y + jcb.getHeight() / 2;
|
||||
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1000);
|
||||
|
||||
// Here on disposal we had a NullPointerException
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (jf != null) {
|
||||
jf.setVisible(false);
|
||||
jf.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
OpenedPopupFrameDisposal imt = new OpenedPopupFrameDisposal();
|
||||
try {
|
||||
EventQueue.invokeAndWait(imt::start);
|
||||
imt.test();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (imt.jf != null) {
|
||||
imt.jf.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
56
test/jdk/java/awt/Container/RemoveByIndexExceptionTest.java
Normal file
56
test/jdk/java/awt/Container/RemoveByIndexExceptionTest.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2023, 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 4546535
|
||||
@summary java.awt.Container.remove(int) throws unexpected NPE
|
||||
*/
|
||||
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Panel;
|
||||
|
||||
public class RemoveByIndexExceptionTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Panel p = new Panel();
|
||||
p.add(new Canvas());
|
||||
p.remove(0);
|
||||
|
||||
int[] bad = {-1, 0, 1};
|
||||
for (int i = 0; i < bad.length; i++) {
|
||||
try {
|
||||
System.out.println("Removing " + bad[i]);
|
||||
p.remove(bad[i]);
|
||||
System.out.println("No exception");
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("This is correct exception - " + e);
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("Test Failed: NPE was thrown.");
|
||||
}
|
||||
}
|
||||
System.out.println("Test Passed.");
|
||||
}
|
||||
}
|
||||
105
test/jdk/java/awt/Container/ShowingChangedEventTest.java
Normal file
105
test/jdk/java/awt/Container/ShowingChangedEventTest.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4924516
|
||||
@summary Verifies that SHOWING_CHANGED event is propagated to \
|
||||
HierarchyListeners then toolkit enabled
|
||||
@key headful
|
||||
*/
|
||||
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.AWTEventListener;
|
||||
import java.awt.event.HierarchyEvent;
|
||||
import java.awt.event.HierarchyListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class ShowingChangedEventTest
|
||||
implements AWTEventListener, HierarchyListener{
|
||||
private boolean eventRegisteredOnButton = false;
|
||||
|
||||
private final JFrame frame = new JFrame("ShowingChangedEventTest");
|
||||
private final JPanel panel = new JPanel();
|
||||
private final JButton button = new JButton();
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
ShowingChangedEventTest showingChangedEventTest
|
||||
= new ShowingChangedEventTest();
|
||||
|
||||
try {
|
||||
showingChangedEventTest.start();
|
||||
} finally {
|
||||
showingChangedEventTest.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void start () {
|
||||
frame.getContentPane().add(panel);
|
||||
panel.add(button);
|
||||
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
Toolkit.getDefaultToolkit()
|
||||
.addAWTEventListener(this, AWTEvent.HIERARCHY_EVENT_MASK);
|
||||
|
||||
button.addHierarchyListener(this);
|
||||
panel.setVisible(false);
|
||||
|
||||
if (!eventRegisteredOnButton){
|
||||
throw new RuntimeException("Event wasn't registered on Button.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eventDispatched(AWTEvent awtevt) {
|
||||
if (awtevt instanceof HierarchyEvent) {
|
||||
HierarchyEvent hevt = (HierarchyEvent) awtevt;
|
||||
if (hevt != null && (hevt.getChangeFlags()
|
||||
& HierarchyEvent.SHOWING_CHANGED) != 0) {
|
||||
System.out.println("Hierarchy event was received on Toolkit. "
|
||||
+ "SHOWING_CHANGED for "
|
||||
+ hevt.getChanged().getClass().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hierarchyChanged(HierarchyEvent e) {
|
||||
if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0) {
|
||||
System.out.println("Hierarchy event was received on Button. "
|
||||
+ "SHOWING_CHANGED for "
|
||||
+ e.getChanged().getClass().getName());
|
||||
}
|
||||
eventRegisteredOnButton = true;
|
||||
}
|
||||
}
|
||||
55
test/jdk/java/awt/Panel/SetForegroundTest.java
Normal file
55
test/jdk/java/awt/Panel/SetForegroundTest.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2023, 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 4994151
|
||||
@summary REGRESSION: Bug when setting the foreground of a JWindow
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Color;
|
||||
|
||||
import javax.swing.JWindow;
|
||||
|
||||
public class SetForegroundTest {
|
||||
static JWindow jwindow;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
jwindow = new JWindow();
|
||||
jwindow.pack();
|
||||
jwindow.setForeground(Color.BLACK);
|
||||
System.out.println("TEST PASSED");
|
||||
});
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (jwindow != null) {
|
||||
jwindow.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
115
test/jdk/java/awt/PopupMenu/PopupMenuStayOpen.java
Normal file
115
test/jdk/java/awt/PopupMenu/PopupMenuStayOpen.java
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4791953
|
||||
@requires (os.family == "linux" | os.family == "mac")
|
||||
@summary Checks that popup menu stay open after a triggering click.
|
||||
@key headful
|
||||
@run main/othervm -Dsun.java2d.uiScale=1 PopupMenuStayOpen
|
||||
*/
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Point;
|
||||
import java.awt.PopupMenu;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
|
||||
public class PopupMenuStayOpen {
|
||||
public static final int MAX_COUNT = 100;
|
||||
public volatile static boolean wasActionFired = false;
|
||||
static Frame frame;
|
||||
static PopupMenu pom;
|
||||
volatile static Point point;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
String nm = Toolkit.getDefaultToolkit().getClass().getName();
|
||||
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
frame = new Frame("Click-to-see-Popup");
|
||||
pom = new PopupMenu();
|
||||
frame.setTitle(nm);
|
||||
frame.setSize(300, 300);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
pom.add("A long enough line");
|
||||
|
||||
pom.getItem(0).addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
wasActionFired = true;
|
||||
}
|
||||
});
|
||||
|
||||
frame.add(pom);
|
||||
frame.addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent me) {
|
||||
pom.show(frame, me.getX(), me.getY());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Robot robot = new Robot();
|
||||
robot.delay(1000);
|
||||
robot.waitForIdle();
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
point = frame.getLocationOnScreen();
|
||||
});
|
||||
|
||||
robot.mouseMove(point.x + 50, point.y + 100);
|
||||
robot.mousePress(InputEvent.BUTTON2_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON2_DOWN_MASK);
|
||||
|
||||
robot.delay(1000);
|
||||
robot.waitForIdle();
|
||||
|
||||
robot.mouseMove(point.x + 50 + 30, point.y + 100 + 15);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(500);
|
||||
|
||||
|
||||
if (!wasActionFired) {
|
||||
throw new RuntimeException("Popup not visible or has no focus");
|
||||
}
|
||||
System.out.println("Test Pass!!");
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
95
test/jdk/java/awt/Robot/RobotMoveMultiscreen.java
Normal file
95
test/jdk/java/awt/Robot/RobotMoveMultiscreen.java
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2023, 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 4288230
|
||||
@summary Tests that Robot can move mouse to another screen
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Robot;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
|
||||
public class RobotMoveMultiscreen {
|
||||
static volatile int x_dest = 20;
|
||||
static volatile int y_dest = 20;
|
||||
static Frame frame;
|
||||
static volatile Boolean testCondition = false;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
GraphicsDevice[] devs =
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
|
||||
if (devs.length <= 1) {
|
||||
System.out.println("Minimum 2 display screens are required" +
|
||||
" for the test, Found " + devs.length);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
GraphicsDevice workDev = devs[devs.length - 1];
|
||||
GraphicsConfiguration config = workDev.getDefaultConfiguration();
|
||||
Rectangle bounds = config.getBounds();
|
||||
x_dest = bounds.x + bounds.width / 2;
|
||||
y_dest = bounds.y + bounds.height / 2;
|
||||
frame = new Frame("Listening frame");
|
||||
frame.addMouseMotionListener(new MouseMotionAdapter() {
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
testCondition = true;
|
||||
}
|
||||
});
|
||||
frame.setLocation(x_dest,y_dest);
|
||||
frame.setSize(100,100);
|
||||
frame.setVisible(true);
|
||||
});
|
||||
|
||||
Robot robot = new Robot();
|
||||
robot.delay(1000);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(x_dest+50, y_dest+50);
|
||||
robot.waitForIdle();
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (testCondition == false) {
|
||||
throw new RuntimeException("Can't move to another display");
|
||||
}
|
||||
});
|
||||
|
||||
System.out.println("Test Pass!!");
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
82
test/jdk/java/awt/Scrollbar/PageIncrementTest.java
Normal file
82
test/jdk/java/awt/Scrollbar/PageIncrementTest.java
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4677084
|
||||
@summary Tests that the PageIncrement (BlockIncrement) and
|
||||
LineIncrement (UnitIncrement) cannot be < 1
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.Scrollbar;
|
||||
|
||||
public class PageIncrementTest {
|
||||
static Scrollbar sb;
|
||||
|
||||
public static void main(String[] args) {
|
||||
sb = new Scrollbar();
|
||||
sb.setBlockIncrement(0);
|
||||
sb.setUnitIncrement(0);
|
||||
|
||||
if (sb.getBlockIncrement() < 1) {
|
||||
String msg = "Failed: getBlockIncrement() == " + sb.getBlockIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
if (sb.getUnitIncrement() < 1) {
|
||||
String msg = "Failed: getLineIncrement() == " + sb.getUnitIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
|
||||
sb.setBlockIncrement(-1);
|
||||
sb.setUnitIncrement(-1);
|
||||
|
||||
if (sb.getBlockIncrement() < 1) {
|
||||
String msg = "Failed: getBlockIncrement() == " + sb.getBlockIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
if (sb.getUnitIncrement() < 1) {
|
||||
String msg = "Failed: getLineIncrement() == " + sb.getUnitIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
|
||||
sb.setBlockIncrement(2);
|
||||
sb.setUnitIncrement(2);
|
||||
|
||||
if (sb.getBlockIncrement() != 2) {
|
||||
String msg = "Failed: getBlockIncrement() == " + sb.getBlockIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
if (sb.getUnitIncrement() != 2) {
|
||||
String msg = "Failed: getLineIncrement() == " + sb.getUnitIncrement();
|
||||
System.out.println(msg);
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
System.out.println("Test Pass!!");
|
||||
}
|
||||
}
|
||||
168
test/jdk/java/awt/Scrollbar/ScrollbarKeyControlTest.java
Normal file
168
test/jdk/java/awt/Scrollbar/ScrollbarKeyControlTest.java
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4943277
|
||||
@requires (os.family == "linux")
|
||||
@summary XAWT: Scrollbar can't be controlled by keyboard
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.AWTException;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Scrollbar;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import java.awt.event.AdjustmentListener;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
|
||||
public class ScrollbarKeyControlTest implements AdjustmentListener, KeyListener {
|
||||
Scrollbar scrollbarV;
|
||||
Scrollbar scrollbarH;
|
||||
volatile int changesTotal = 0;
|
||||
Robot robot;
|
||||
Object LOCK = new Object();
|
||||
Frame frame;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (!System.getProperty("os.name").startsWith("Linux")) {
|
||||
System.out.println("This test is for XAWT only.");
|
||||
return;
|
||||
}
|
||||
ScrollbarKeyControlTest scrollbarKeyControlTest = new ScrollbarKeyControlTest();
|
||||
scrollbarKeyControlTest.init();
|
||||
}
|
||||
|
||||
public void init() throws Exception {
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
frame = new Frame("Scrollbar Test");
|
||||
|
||||
scrollbarV = new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, 255);
|
||||
scrollbarH = new Scrollbar(Scrollbar.HORIZONTAL, 0, 60, 0, 300);
|
||||
|
||||
scrollbarH.addAdjustmentListener(this);
|
||||
scrollbarH.addKeyListener(this);
|
||||
scrollbarV.addAdjustmentListener(this);
|
||||
scrollbarV.addKeyListener(this);
|
||||
|
||||
frame.add("South", scrollbarH);
|
||||
frame.add("East", scrollbarV);
|
||||
|
||||
frame.setSize(200, 200);
|
||||
frame.setVisible(true);
|
||||
frame.validate();
|
||||
frame.toFront();
|
||||
});
|
||||
robot = new Robot();
|
||||
robot.delay(1000);
|
||||
robot.waitForIdle();
|
||||
|
||||
testOneScrollbar(scrollbarV);
|
||||
if (changesTotal != 9) { //one by mouse click and six by keys
|
||||
throw new RuntimeException("Test failed. Not all adjustment " +
|
||||
"events received by vertical scrollbar (" + changesTotal + " of 9)");
|
||||
}
|
||||
changesTotal = 0;
|
||||
testOneScrollbar(scrollbarH);
|
||||
if (changesTotal != 9) { //one by mouse click and six by keys
|
||||
throw new RuntimeException("Test failed. Not all adjustment " +
|
||||
"events received by horizontal scrollbar (" + changesTotal + " of 9)");
|
||||
}
|
||||
System.out.println("Test passed. Adjustment Event called "
|
||||
+ changesTotal + " times for each scrollbar");
|
||||
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void testOneScrollbar(Scrollbar sb) {
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(sb.getLocationOnScreen().x + sb.getWidth() / 2,
|
||||
sb.getLocationOnScreen().y + sb.getHeight() / 2);
|
||||
try {
|
||||
synchronized (LOCK) {
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_DOWN);
|
||||
robot.keyRelease(KeyEvent.VK_DOWN);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_PAGE_DOWN);
|
||||
robot.keyRelease(KeyEvent.VK_PAGE_DOWN);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_UP);
|
||||
robot.keyRelease(KeyEvent.VK_UP);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_PAGE_UP);
|
||||
robot.keyRelease(KeyEvent.VK_PAGE_UP);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_RIGHT);
|
||||
robot.keyRelease(KeyEvent.VK_RIGHT);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_LEFT);
|
||||
robot.keyRelease(KeyEvent.VK_LEFT);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_HOME);
|
||||
robot.keyRelease(KeyEvent.VK_HOME);
|
||||
LOCK.wait(2000);
|
||||
robot.keyPress(KeyEvent.VK_END);
|
||||
robot.keyRelease(KeyEvent.VK_END);
|
||||
LOCK.wait(2000);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException("Test interrupted while keys being pressed.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
changesTotal++;
|
||||
synchronized (LOCK) {
|
||||
LOCK.notify();
|
||||
}
|
||||
System.out.println("Adjustment Event called ");
|
||||
}
|
||||
|
||||
public void keyPressed(KeyEvent e) {
|
||||
System.out.println("KeyPressed called");
|
||||
}
|
||||
|
||||
public void keyReleased(KeyEvent e) {
|
||||
System.out.println("in keyReleased");
|
||||
}
|
||||
|
||||
public void keyTyped(KeyEvent e) {
|
||||
System.out.println("in keyTyped");
|
||||
}
|
||||
}
|
||||
81
test/jdk/java/awt/TextArea/ReplaceRangeTest.java
Normal file
81
test/jdk/java/awt/TextArea/ReplaceRangeTest.java
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2023, 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 5025532
|
||||
@requires (os.family == "windows")
|
||||
@summary Tests that textarea replaces text correctly if the text contains
|
||||
line separators
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.TextArea;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class ReplaceRangeTest {
|
||||
static Frame f;
|
||||
|
||||
public static void main(String[] args) throws InterruptedException, InvocationTargetException {
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
f = new Frame("Test frame");
|
||||
f.setSize(400, 400);
|
||||
f.setLayout(new GridLayout(3, 1));
|
||||
|
||||
TextArea textArea1 = new TextArea(5, 80);
|
||||
TextArea textArea2 = new TextArea(5, 80);
|
||||
TextArea textArea3 = new TextArea(5, 80);
|
||||
f.add(textArea1);
|
||||
f.add(textArea2);
|
||||
f.add(textArea3);
|
||||
f.setVisible(true);
|
||||
|
||||
textArea1.setText("01234");
|
||||
textArea1.replaceRange("X", 3, 4);
|
||||
textArea2.setText("0\r\n234");
|
||||
textArea2.replaceRange("X", 3, 4);
|
||||
textArea3.setText("0\n\n34");
|
||||
textArea3.replaceRange("X", 3, 4);
|
||||
|
||||
if (textArea1.getText().equals("012X4") &&
|
||||
textArea2.getText().equals("0\r\n2X4") &&
|
||||
textArea3.getText().equals("0\n\nX4")) {
|
||||
System.out.println("Test Pass");
|
||||
return;
|
||||
} else {
|
||||
throw new RuntimeException("Test FAILED");
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (f != null) {
|
||||
f.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
155
test/jdk/java/awt/TextArea/TextAreaCRLFAutoDetectTest.java
Normal file
155
test/jdk/java/awt/TextArea/TextAreaCRLFAutoDetectTest.java
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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 4800187
|
||||
@requires (os.family == "windows")
|
||||
@summary REGRESSION:show the wrong selection when there are \r characters in the text
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Frame;
|
||||
import java.awt.IllegalComponentStateException;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.TextArea;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.InputEvent;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class TextAreaCRLFAutoDetectTest {
|
||||
Frame f;
|
||||
TextArea ta1;
|
||||
TextArea ta2;
|
||||
Button b;
|
||||
boolean passed = true;
|
||||
boolean crlf = true;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
TextAreaCRLFAutoDetectTest crlfAutoDetectTest = new TextAreaCRLFAutoDetectTest();
|
||||
crlfAutoDetectTest.init();
|
||||
crlfAutoDetectTest.start();
|
||||
}
|
||||
|
||||
public void init() throws InterruptedException, InvocationTargetException {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
f = new Frame("TextAreaCRLFAutoDetectTest");
|
||||
ta1 = new TextArea(5, 20);
|
||||
ta2 = new TextArea(5, 20);
|
||||
b = new Button("Click Me");
|
||||
b.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
ta1.setText("");
|
||||
ta2.setText("");
|
||||
System.out.println("--------------------------------");
|
||||
|
||||
String eoln = (crlf) ? "\r\n" : "\n";
|
||||
String s = eoln + "123" + eoln + "567" + eoln + "90" + eoln;
|
||||
printString(" s=", s);
|
||||
ta1.setText(s);
|
||||
printString("ta1.getText()=", ta1.getText());
|
||||
|
||||
s = "67" + eoln + "9";
|
||||
ta1.select(6, 10);
|
||||
|
||||
String s1 = ta1.getSelectedText();
|
||||
printString("ta1.getSelectedText()=", s1);
|
||||
passed = passed && s.equals(s1);
|
||||
|
||||
ta2.setText(s1);
|
||||
printString(" ta2.getText()=", s1);
|
||||
passed = passed && s1.equals(ta2.getText());
|
||||
|
||||
crlf = false;
|
||||
}
|
||||
});
|
||||
|
||||
f.setLayout(new FlowLayout());
|
||||
f.add(ta1);
|
||||
f.add(ta2);
|
||||
f.add(b);
|
||||
f.setLocation(300, 50);
|
||||
f.pack();
|
||||
f.setVisible(true);
|
||||
});
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
try {
|
||||
Robot robot = new Robot();
|
||||
robot.setAutoWaitForIdle(true);
|
||||
robot.setAutoDelay(50);
|
||||
robot.waitForIdle();
|
||||
|
||||
Point pt = new Point(0, 0);
|
||||
|
||||
boolean drawn = false;
|
||||
while (!drawn) {
|
||||
try {
|
||||
pt = b.getLocationOnScreen();
|
||||
} catch (IllegalComponentStateException icse) {
|
||||
Thread.sleep(50);
|
||||
continue;
|
||||
}
|
||||
drawn = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
pt = b.getLocationOnScreen();
|
||||
robot.mouseMove(pt.x + b.getWidth() / 2,
|
||||
pt.y + b.getHeight() / 2);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
Thread.sleep(250);
|
||||
}
|
||||
if (!passed) {
|
||||
throw new RuntimeException("TextAreaCRLFAutoDetectTest FAILED.");
|
||||
} else {
|
||||
System.out.println("TextAreaCRLFAutoDetectTest PASSED");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("The test was not completed.\n\n" + e);
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (f != null) {
|
||||
f.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void printString(String t, String s) {
|
||||
byte b[] = s.getBytes();
|
||||
String o = t;
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
o += Byte.toString(b[i]) + " ";
|
||||
}
|
||||
System.out.println(o);
|
||||
}
|
||||
}
|
||||
116
test/jdk/java/awt/TextArea/TextLengthTest.java
Normal file
116
test/jdk/java/awt/TextArea/TextLengthTest.java
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2023, 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 4072264
|
||||
@summary REGRESSION:Test to verify getSelectedText,
|
||||
getSelectedStart/End in TextArea class
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Robot;
|
||||
import java.awt.TextArea;
|
||||
|
||||
public class TextLengthTest {
|
||||
static final int MY_SIZE = 100;
|
||||
static final int MY_START = 13;
|
||||
static final int MY_END = 47;
|
||||
TextArea ta;
|
||||
Frame f;
|
||||
int mySize;
|
||||
int myStart;
|
||||
int myEnd;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
TextLengthTest textLengthTest = new TextLengthTest();
|
||||
textLengthTest.init();
|
||||
textLengthTest.start();
|
||||
}
|
||||
|
||||
public void init() throws Exception {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
f = new Frame("TextLengthTest");
|
||||
ta = new TextArea(15, 30);
|
||||
f.add(ta);
|
||||
f.setSize(400, 400);
|
||||
f.setVisible(true);
|
||||
});
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
try {
|
||||
Robot r = new Robot();
|
||||
r.delay(1000);
|
||||
r.waitForIdle();
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
StringBuffer bigStringBuffer = new StringBuffer();
|
||||
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
bigStringBuffer.append("abcdefghi\n");
|
||||
}
|
||||
|
||||
ta.setText(bigStringBuffer.toString());
|
||||
|
||||
mySize = bigStringBuffer.toString().length();
|
||||
System.out.println("String size = " + mySize);
|
||||
|
||||
if (mySize != MY_SIZE) {
|
||||
throw new Error("The string size is " +
|
||||
mySize + "but it should be " + MY_SIZE);
|
||||
}
|
||||
|
||||
ta.select(MY_START, MY_END);
|
||||
|
||||
String str = new String(ta.getSelectedText());
|
||||
str = str.toUpperCase();
|
||||
|
||||
myStart = ta.getSelectionStart();
|
||||
myEnd = ta.getSelectionEnd();
|
||||
System.out.println("Selected string start = " + myStart);
|
||||
System.out.println("Selected string end = " + myEnd);
|
||||
|
||||
if (myStart != MY_START) {
|
||||
throw new Error("The selected text starts at " +
|
||||
mySize + "but it should start at " + MY_START);
|
||||
}
|
||||
|
||||
if (myEnd != MY_END) {
|
||||
throw new Error("The selected text ends at " +
|
||||
myEnd + "but it should end at " + MY_END);
|
||||
}
|
||||
|
||||
ta.replaceRange(str, myStart, myEnd);
|
||||
});
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (f != null) {
|
||||
f.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
System.out.println("Test Pass");
|
||||
}
|
||||
}
|
||||
85
test/jdk/java/awt/TextArea/TextLimitTest.java
Normal file
85
test/jdk/java/awt/TextArea/TextLimitTest.java
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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 4260109
|
||||
@summary tests that the text limit is set to the maximum possible value
|
||||
@key headful
|
||||
*/
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.TextArea;
|
||||
|
||||
public class TextLimitTest {
|
||||
static Frame frame;
|
||||
static TextArea textarea;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
frame = new Frame("Text Limit Test");
|
||||
textarea = new TextArea(3, 10);
|
||||
frame.setLayout(new BorderLayout());
|
||||
frame.add(textarea);
|
||||
frame.setSize(200, 200);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
/*
|
||||
* The magic number 0xF700 was choosen because of the two reasons:
|
||||
* - it shouldn't be greater since on win95 (even in native win32 apps)
|
||||
* adding more than 0xF800 symbols to a textarea doesn't always work,
|
||||
* - it shouldn't be less since in this case we won't run in the stack
|
||||
* overflow on Win95 even if we use W2A allocating memory on the stack.
|
||||
*/
|
||||
for (int i = 0; i < 0xF700; i += 0x10) {
|
||||
buffer.append("0123456789abcdef");
|
||||
}
|
||||
|
||||
textarea.setText(buffer.toString());
|
||||
System.out.println("Text length before append: " +
|
||||
Integer.toString(textarea.getText().length(), 16));
|
||||
|
||||
textarea.append("0123456789abcdef");
|
||||
|
||||
int len = textarea.getText().length();
|
||||
System.out.println("Text length after append: " +
|
||||
Integer.toString(len, 16));
|
||||
if (len != 0xF710) {
|
||||
throw new RuntimeException("Test failed: textarea has " +
|
||||
"wrong text limit!");
|
||||
}
|
||||
});
|
||||
System.out.println("Test pass");
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
304
test/jdk/java/awt/dnd/DropTargetingTest.java
Normal file
304
test/jdk/java/awt/dnd/DropTargetingTest.java
Normal file
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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.
|
||||
*/
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceAdapter;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetAdapter;
|
||||
import java.awt.dnd.DropTargetContext;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.event.AWTEventListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4426794 4435403
|
||||
@summary tests that drag notifications are targeted to the drop target
|
||||
whose operable part is currently intersected by cursor's hotspot
|
||||
@key headful
|
||||
@run main DropTargetingTest
|
||||
*/
|
||||
|
||||
public class DropTargetingTest implements AWTEventListener {
|
||||
|
||||
volatile JFrame sourceFrame;
|
||||
volatile JFrame targetFrame1;
|
||||
volatile JFrame targetFrame2;
|
||||
volatile JButton obscurer;
|
||||
|
||||
volatile DragSource dragSource;
|
||||
volatile Transferable transferable;
|
||||
volatile DragSourceListener dragSourceListener;
|
||||
volatile DragGestureListener dragGestureListener;
|
||||
volatile Point srcPoint;
|
||||
volatile Point dstPoint;
|
||||
volatile Dimension d;
|
||||
|
||||
static class TestDropTargetListener extends DropTargetAdapter {
|
||||
private boolean dropRecognized = false;
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
dropRecognized = true;
|
||||
dtde.rejectDrop();
|
||||
synchronized (SYNC_LOCK) {
|
||||
SYNC_LOCK.notifyAll();
|
||||
}
|
||||
}
|
||||
public void reset() {
|
||||
dropRecognized = false;
|
||||
}
|
||||
public boolean dropRecognized() {
|
||||
return dropRecognized;
|
||||
}
|
||||
}
|
||||
volatile TestDropTargetListener dropTargetListener;
|
||||
|
||||
static final Object SYNC_LOCK = new Object();
|
||||
static final int FRAME_ACTIVATION_TIMEOUT = 2000;
|
||||
static final int DROP_COMPLETION_TIMEOUT = 5000;
|
||||
static final int MOUSE_RELEASE_TIMEOUT = 1000;
|
||||
|
||||
Component clickedComponent = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
DropTargetingTest test = new DropTargetingTest();
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.sourceFrame != null) {
|
||||
test.sourceFrame.dispose();
|
||||
}
|
||||
if (test.targetFrame1 != null) {
|
||||
test.targetFrame1.dispose();
|
||||
}
|
||||
if (test.targetFrame2 != null) {
|
||||
test.targetFrame2.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
sourceFrame = new JFrame();
|
||||
targetFrame1 = new JFrame();
|
||||
targetFrame2 = new JFrame();
|
||||
obscurer = new JButton("Obscurer");
|
||||
|
||||
dragSource = DragSource.getDefaultDragSource();
|
||||
transferable = new StringSelection("TEXT");
|
||||
dragSourceListener = new DragSourceAdapter() {};
|
||||
dragGestureListener = new DragGestureListener() {
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, transferable, dragSourceListener);
|
||||
}
|
||||
};
|
||||
dropTargetListener = new TestDropTargetListener();
|
||||
|
||||
sourceFrame.setTitle("DropTargetingTest Source frame");
|
||||
sourceFrame.setBounds(100, 100, 100, 100);
|
||||
sourceFrame.getToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK);
|
||||
dragSource.createDefaultDragGestureRecognizer(sourceFrame, DnDConstants.ACTION_COPY,
|
||||
dragGestureListener);
|
||||
targetFrame1.setTitle("Target frame 1");
|
||||
targetFrame1.setBounds(200, 100, 100, 100);
|
||||
targetFrame1.getGlassPane().setVisible(true);
|
||||
targetFrame1.getGlassPane().setDropTarget(
|
||||
new DropTarget(targetFrame1.getGlassPane(), dropTargetListener));
|
||||
targetFrame2.setTitle("Target frame 2");
|
||||
targetFrame2.setBounds(300, 100, 100, 100);
|
||||
targetFrame2.setDropTarget(new DropTarget(targetFrame1, dropTargetListener));
|
||||
targetFrame2.getContentPane().add(obscurer);
|
||||
|
||||
sourceFrame.setVisible(true);
|
||||
targetFrame1.setVisible(true);
|
||||
targetFrame2.setVisible(true);
|
||||
}
|
||||
|
||||
public static int sign(int n) {
|
||||
return n < 0 ? -1 : n == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
Robot robot = new Robot();
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
if (!test(robot, targetFrame1)) {
|
||||
throw new RuntimeException("Failed to recognize drop on a glass pane");
|
||||
}
|
||||
|
||||
if (!test(robot, targetFrame2)) {
|
||||
throw new RuntimeException("Failed to recognize drop on a composite component");
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
clickedComponent = null;
|
||||
}
|
||||
|
||||
public void eventDispatched(AWTEvent e) {
|
||||
if (e.getID() == MouseEvent.MOUSE_RELEASED) {
|
||||
clickedComponent = (Component)e.getSource();
|
||||
synchronized (SYNC_LOCK) {
|
||||
SYNC_LOCK.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean pointInComponent(Robot robot, Point p, Component comp)
|
||||
throws InterruptedException {
|
||||
robot.waitForIdle();
|
||||
reset();
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
synchronized (SYNC_LOCK) {
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
SYNC_LOCK.wait(MOUSE_RELEASE_TIMEOUT);
|
||||
}
|
||||
|
||||
Component c = clickedComponent;
|
||||
|
||||
while (c != null && c != comp) {
|
||||
c = c.getParent();
|
||||
}
|
||||
|
||||
return c == comp;
|
||||
}
|
||||
|
||||
boolean test(Robot robot, JFrame targetFrame) throws Exception {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
srcPoint = sourceFrame.getLocationOnScreen();
|
||||
d = sourceFrame.getSize();
|
||||
});
|
||||
srcPoint.translate(d.width / 2, d.height / 2);
|
||||
|
||||
if (!pointInComponent(robot, srcPoint, sourceFrame)) {
|
||||
System.err.println("WARNING: Couldn't locate source frame.");
|
||||
return true;
|
||||
}
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
dstPoint = targetFrame.getLocationOnScreen();
|
||||
d = targetFrame.getSize();
|
||||
});
|
||||
dstPoint.translate(d.width / 2, d.height / 2);
|
||||
|
||||
if (!pointInComponent(robot, dstPoint, targetFrame)) {
|
||||
System.err.println("WARNING: Couldn't locate target frame: " + targetFrame);
|
||||
return true;
|
||||
}
|
||||
|
||||
dropTargetListener.reset();
|
||||
robot.mouseMove(srcPoint.x, srcPoint.y);
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
for (;!srcPoint.equals(dstPoint);
|
||||
srcPoint.translate(sign(dstPoint.x - srcPoint.x),
|
||||
sign(dstPoint.y - srcPoint.y))) {
|
||||
robot.mouseMove(srcPoint.x, srcPoint.y);
|
||||
robot.delay(10);
|
||||
}
|
||||
synchronized (SYNC_LOCK) {
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
SYNC_LOCK.wait(DROP_COMPLETION_TIMEOUT);
|
||||
}
|
||||
|
||||
return dropTargetListener.dropRecognized();
|
||||
}
|
||||
}
|
||||
|
||||
class DropTargetPanel extends Panel implements DropTargetListener {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 100);
|
||||
boolean testPassed = true;
|
||||
|
||||
public DropTargetPanel() {
|
||||
setDropTarget(new DropTarget(this, this));
|
||||
}
|
||||
|
||||
public boolean getStatus() {
|
||||
return testPassed;
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
|
||||
public void dragEnter(DropTargetDragEvent dtde) {}
|
||||
|
||||
public void dragExit(DropTargetEvent dte) {
|
||||
testPassed = false;
|
||||
}
|
||||
|
||||
public void dragOver(DropTargetDragEvent dtde) {}
|
||||
|
||||
public void dropActionChanged(DropTargetDragEvent dtde) {}
|
||||
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
DropTargetContext dtc = dtde.getDropTargetContext();
|
||||
|
||||
if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) {
|
||||
dtde.acceptDrop(DnDConstants.ACTION_COPY);
|
||||
} else {
|
||||
dtde.rejectDrop();
|
||||
}
|
||||
|
||||
DataFlavor[] dfs = dtde.getCurrentDataFlavors();
|
||||
Component comp = null;
|
||||
|
||||
if (dfs != null && dfs.length >= 1) {
|
||||
Transferable transfer = dtde.getTransferable();
|
||||
|
||||
try {
|
||||
comp = (Component)transfer.getTransferData(dfs[0]);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
dtc.dropComplete(false);
|
||||
}
|
||||
}
|
||||
dtc.dropComplete(true);
|
||||
|
||||
add(comp);
|
||||
}
|
||||
}
|
||||
367
test/jdk/java/awt/dnd/DroppingVMHangTest.java
Normal file
367
test/jdk/java/awt/dnd/DroppingVMHangTest.java
Normal file
@@ -0,0 +1,367 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, 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.
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceDragEvent;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DragSourceEvent;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetContext;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4338893
|
||||
@summary tests that dnd between two different VMs doesn't cause hang
|
||||
on the dropping side.
|
||||
@key headful
|
||||
@run main/timeout=120 DroppingVMHangTest
|
||||
*/
|
||||
|
||||
public class DroppingVMHangTest {
|
||||
|
||||
public static final int CODE_NOT_RETURNED = -1;
|
||||
public static final int CODE_OK = 0;
|
||||
public static final int CODE_FAILURE = 1;
|
||||
public static final int CODE_HANG_FAILURE = 2;
|
||||
public static final int CODE_OTHER_FAILURE = 3;
|
||||
public static final int CODE_TIMEOUT = 4;
|
||||
|
||||
public static final int FRAME_ACTIVATION_TIMEOUT = 2000;
|
||||
|
||||
private int returnCode = CODE_NOT_RETURNED;
|
||||
|
||||
volatile Frame frame;
|
||||
volatile Point p;
|
||||
volatile Dimension d;
|
||||
Robot robot = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
DroppingVMHangTest test = new DroppingVMHangTest();
|
||||
if (args.length > 0) {
|
||||
test.run(args);
|
||||
} else {
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.frame != null) {
|
||||
test.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void run(String[] args) {
|
||||
try {
|
||||
frame = new Frame();
|
||||
frame.setTitle("DroppingVMHangTest DropTarget frame");
|
||||
frame.setLocation(300, 400);
|
||||
frame.add(new DropTargetPanel());
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
if (args.length != 2) {
|
||||
throw new RuntimeException("Incorrect number of arguments for child:" +
|
||||
args.length);
|
||||
}
|
||||
|
||||
int x = Integer.parseInt(args[0], 10);
|
||||
int y = Integer.parseInt(args[1], 10);
|
||||
|
||||
Point sourcePoint = new Point(x, y);
|
||||
Point targetPoint = frame.getLocationOnScreen();
|
||||
Dimension d = frame.getSize();
|
||||
targetPoint.translate(d.width / 2, d.height / 2);
|
||||
|
||||
robot = new Robot();
|
||||
robot.mouseMove(x, y);
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
while (!sourcePoint.equals(targetPoint)) {
|
||||
robot.mouseMove(sourcePoint.x, sourcePoint.y);
|
||||
Thread.sleep(10);
|
||||
int dx = sign(targetPoint.x - sourcePoint.x);
|
||||
int dy = sign(targetPoint.y - sourcePoint.y);
|
||||
sourcePoint.translate(dx, dy);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
|
||||
Thread.sleep(5000);
|
||||
System.exit(DroppingVMHangTest.CODE_TIMEOUT);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
System.exit(DroppingVMHangTest.CODE_OTHER_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int sign(int n) {
|
||||
return n > 0 ? 1 : n < 0 ? -1 : 0;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
frame = new Frame();
|
||||
frame.setTitle("DragSource frame");
|
||||
frame.setLocation(10, 200);
|
||||
frame.add(new DragSourcePanel());
|
||||
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
p = frame.getLocationOnScreen();
|
||||
d = frame.getSize();
|
||||
});
|
||||
|
||||
p.translate(d.width / 2, d.height / 2);
|
||||
|
||||
String javaPath = System.getProperty("java.home", "");
|
||||
String command = javaPath + File.separator + "bin" +
|
||||
File.separator + "java -cp " + System.getProperty("test.classes", ".") +
|
||||
" DroppingVMHangTest" + " " + p.x + " " + p.y;
|
||||
Process process = Runtime.getRuntime().exec(command);
|
||||
returnCode = process.waitFor();
|
||||
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
int count = errorStream.available();
|
||||
if (count > 0) {
|
||||
byte[] b = new byte[count];
|
||||
errorStream.read(b);
|
||||
System.err.println("========= Child VM System.err ========");
|
||||
System.err.print(new String(b));
|
||||
System.err.println("======================================");
|
||||
}
|
||||
|
||||
switch (returnCode) {
|
||||
case CODE_NOT_RETURNED:
|
||||
System.err.println("Child VM: failed to start");
|
||||
break;
|
||||
case CODE_OK:
|
||||
System.err.println("Child VM: normal termination");
|
||||
break;
|
||||
case CODE_FAILURE:
|
||||
System.err.println("Child VM: abnormal termination");
|
||||
break;
|
||||
case CODE_HANG_FAILURE:
|
||||
System.err.println("Child VM: hang on drop");
|
||||
break;
|
||||
case CODE_OTHER_FAILURE:
|
||||
System.err.println("Child VM: other failure");
|
||||
break;
|
||||
case CODE_TIMEOUT:
|
||||
System.err.println("Child VM: failed to simulate drag-and-drop operation with Robot");
|
||||
break;
|
||||
}
|
||||
if (returnCode != CODE_OK && returnCode != CODE_TIMEOUT) {
|
||||
throw new RuntimeException("The test failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DragSourceButton extends Button implements Serializable,
|
||||
Transferable,
|
||||
DragGestureListener,
|
||||
DragSourceListener {
|
||||
private transient final DataFlavor dataflavor =
|
||||
new DataFlavor(DragSourceButton.class, "DragSourceButton");
|
||||
|
||||
public DragSourceButton() {
|
||||
this("DragSourceButton");
|
||||
}
|
||||
|
||||
public DragSourceButton(String str) {
|
||||
super(str);
|
||||
|
||||
DragSource ds = DragSource.getDefaultDragSource();
|
||||
ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY,
|
||||
this);
|
||||
}
|
||||
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, this, this);
|
||||
}
|
||||
|
||||
public void dragEnter(DragSourceDragEvent dsde) {}
|
||||
|
||||
public void dragExit(DragSourceEvent dse) {}
|
||||
|
||||
public void dragOver(DragSourceDragEvent dsde) {}
|
||||
|
||||
public void dragDropEnd(DragSourceDropEvent dsde) {}
|
||||
|
||||
public void dropActionChanged(DragSourceDragEvent dsde) {}
|
||||
|
||||
public Object getTransferData(DataFlavor flavor)
|
||||
throws UnsupportedFlavorException, IOException {
|
||||
|
||||
if (!isDataFlavorSupported(flavor)) {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
|
||||
Object retObj = null;
|
||||
|
||||
ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
|
||||
ObjectOutputStream ooStream = new ObjectOutputStream(baoStream);
|
||||
ooStream.writeObject(this);
|
||||
|
||||
ByteArrayInputStream baiStream = new ByteArrayInputStream(baoStream.toByteArray());
|
||||
ObjectInputStream ois = new ObjectInputStream(baiStream);
|
||||
try {
|
||||
retObj = ois.readObject();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.toString());
|
||||
}
|
||||
|
||||
return retObj;
|
||||
}
|
||||
|
||||
public DataFlavor[] getTransferDataFlavors() {
|
||||
return new DataFlavor[] { dataflavor };
|
||||
}
|
||||
|
||||
public boolean isDataFlavorSupported(DataFlavor dflavor) {
|
||||
return dataflavor.equals(dflavor);
|
||||
}
|
||||
}
|
||||
|
||||
class DragSourcePanel extends Panel {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
|
||||
public DragSourcePanel() {
|
||||
setLayout(new GridLayout(1, 1));
|
||||
add(new DragSourceButton());
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
}
|
||||
|
||||
class DropTargetPanel extends Panel implements DropTargetListener,
|
||||
Runnable {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
|
||||
public DropTargetPanel() {
|
||||
setDropTarget(new DropTarget(this, this));
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
|
||||
public void dragEnter(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_COPY);
|
||||
}
|
||||
|
||||
public void dragExit(DropTargetEvent dte) {}
|
||||
|
||||
public void dragOver(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_COPY);
|
||||
}
|
||||
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
DropTargetContext dtc = dtde.getDropTargetContext();
|
||||
|
||||
if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) {
|
||||
dtde.acceptDrop(DnDConstants.ACTION_COPY);
|
||||
} else {
|
||||
dtde.rejectDrop();
|
||||
System.exit(DroppingVMHangTest.CODE_OTHER_FAILURE);
|
||||
}
|
||||
|
||||
DataFlavor[] dfs = dtde.getCurrentDataFlavors();
|
||||
Component comp = null;
|
||||
|
||||
if (dfs != null && dfs.length >= 1) {
|
||||
Transferable transfer = dtde.getTransferable();
|
||||
|
||||
try {
|
||||
comp = (Component)transfer.getTransferData(dfs[0]);
|
||||
comp.getClass();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
dtc.dropComplete(false);
|
||||
System.exit(DroppingVMHangTest.CODE_OTHER_FAILURE);
|
||||
}
|
||||
}
|
||||
dtc.dropComplete(true);
|
||||
|
||||
Thread thread = new Thread(this);
|
||||
thread.start();
|
||||
|
||||
add(comp);
|
||||
|
||||
System.exit(DroppingVMHangTest.CODE_OK);
|
||||
}
|
||||
|
||||
public void dropActionChanged(DropTargetDragEvent dtde) {}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(60000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
Runtime.getRuntime().halt(DroppingVMHangTest.CODE_HANG_FAILURE);
|
||||
}
|
||||
}
|
||||
171
test/jdk/java/awt/dnd/HonorTargetActionTest.java
Normal file
171
test/jdk/java/awt/dnd/HonorTargetActionTest.java
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, 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.
|
||||
*/
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceAdapter;
|
||||
import java.awt.dnd.DragSourceDragEvent;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetAdapter;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4869264
|
||||
@summary tests that DragSourceDragEvent.getDropAction() accords to its new spec
|
||||
(does not depend on the user drop action)
|
||||
@key headful
|
||||
@run main/othervm HonorTargetActionTest
|
||||
*/
|
||||
|
||||
public class HonorTargetActionTest extends Frame {
|
||||
|
||||
private static final int FRAME_ACTIVATION_TIMEOUT = 3000;
|
||||
|
||||
private boolean dragOverCalled;
|
||||
private int dropAction;
|
||||
|
||||
volatile Frame frame;
|
||||
volatile Point startPoint;
|
||||
volatile Point endPoint;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
HonorTargetActionTest test = new HonorTargetActionTest();
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.frame != null) {
|
||||
test.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
DragSourceListener dragSourceListener = new DragSourceAdapter() {
|
||||
public void dragOver(DragSourceDragEvent dsde) {
|
||||
dragOverCalled = true;
|
||||
dropAction = dsde.getDropAction();
|
||||
}
|
||||
};
|
||||
|
||||
DragGestureListener dragGestureListener = new DragGestureListener() {
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, new StringSelection("OOKK"), dragSourceListener);
|
||||
}
|
||||
};
|
||||
|
||||
new DragSource().createDefaultDragGestureRecognizer(frame,
|
||||
DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);
|
||||
|
||||
|
||||
DropTargetAdapter dropTargetListener = new DropTargetAdapter() {
|
||||
public void dragEnter(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_COPY);
|
||||
}
|
||||
|
||||
public void dragOver(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_COPY);
|
||||
}
|
||||
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
dtde.acceptDrop(DnDConstants.ACTION_COPY);
|
||||
}
|
||||
};
|
||||
|
||||
new DropTarget(frame, dropTargetListener);
|
||||
|
||||
dragOverCalled = false;
|
||||
dropAction = 0;
|
||||
frame = new Frame("Drag Test Frame");
|
||||
|
||||
setTitle("HonorTargetActionTest");
|
||||
setSize (200,200);
|
||||
setLayout (new BorderLayout());
|
||||
setVisible(true);
|
||||
validate();
|
||||
|
||||
frame.setBounds(100, 100, 200, 200);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
public void start() throws Exception {
|
||||
Robot robot = new Robot();
|
||||
robot.waitForIdle();
|
||||
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
startPoint = frame.getLocationOnScreen();
|
||||
});
|
||||
endPoint = new Point(startPoint);
|
||||
robot.waitForIdle();
|
||||
|
||||
startPoint.translate(50, 50);
|
||||
endPoint.translate(150, 150);
|
||||
|
||||
robot.mouseMove(startPoint.x, startPoint.y);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
for (Point p = new Point(startPoint); !p.equals(endPoint);
|
||||
p.translate(sign(endPoint.x - p.x),
|
||||
sign(endPoint.y - p.y))) {
|
||||
robot.mouseMove(p.x, p.y);
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
|
||||
boolean failed = dragOverCalled && dropAction != DnDConstants.ACTION_COPY;
|
||||
|
||||
if (failed) {
|
||||
throw new RuntimeException("test failed: dropAction=" + dropAction);
|
||||
} else {
|
||||
System.err.println("test passed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int sign(int n) {
|
||||
return n < 0 ? -1 : n == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
}
|
||||
273
test/jdk/java/awt/dnd/InterJVMLinkTest.java
Normal file
273
test/jdk/java/awt/dnd/InterJVMLinkTest.java
Normal file
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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.
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceAdapter;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4492640
|
||||
@summary tests that inter-JVM dnd works properly for ACTION_LINK
|
||||
@key headful
|
||||
@run main InterJVMLinkTest
|
||||
*/
|
||||
|
||||
public class InterJVMLinkTest {
|
||||
|
||||
public static final int CODE_NOT_RETURNED = -1;
|
||||
public static final int CODE_OK = 0;
|
||||
public static final int CODE_FAILURE = 1;
|
||||
public static final int FRAME_ACTIVATION_TIMEOUT = 2000;
|
||||
public static final int DROP_TIMEOUT = 60000;
|
||||
|
||||
private int returnCode = CODE_NOT_RETURNED;
|
||||
|
||||
volatile Frame frame;
|
||||
volatile DropTargetPanel panel;
|
||||
volatile Robot robot = null;
|
||||
volatile Point p;
|
||||
volatile Dimension d;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
InterJVMLinkTest test = new InterJVMLinkTest();
|
||||
if (args.length > 0) {
|
||||
test.run(args);
|
||||
} else {
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.frame != null) {
|
||||
test.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void run(String[] args) {
|
||||
try {
|
||||
if (args.length != 4) {
|
||||
throw new RuntimeException("Incorrect command line arguments.");
|
||||
}
|
||||
|
||||
int x = Integer.parseInt(args[0]);
|
||||
int y = Integer.parseInt(args[1]);
|
||||
int w = Integer.parseInt(args[2]);
|
||||
int h = Integer.parseInt(args[3]);
|
||||
|
||||
DragSourcePanel panel = new DragSourcePanel();
|
||||
frame = new Frame();
|
||||
|
||||
frame.setTitle("DragSource frame");
|
||||
frame.setLocation(300, 200);
|
||||
frame.add(panel);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
Point sourcePoint = panel.getLocationOnScreen();
|
||||
Dimension d = panel.getSize();
|
||||
sourcePoint.translate(d.width / 2, d.height / 2);
|
||||
|
||||
Point targetPoint = new Point(x + w / 2, y + h / 2);
|
||||
|
||||
robot = new Robot();
|
||||
robot.mouseMove(sourcePoint.x, sourcePoint.y);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
for (; !sourcePoint.equals(targetPoint);
|
||||
sourcePoint.translate(sign(targetPoint.x - sourcePoint.x),
|
||||
sign(targetPoint.y - sourcePoint.y))) {
|
||||
robot.mouseMove(sourcePoint.x, sourcePoint.y);
|
||||
Thread.sleep(50);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
|
||||
Thread.sleep(DROP_TIMEOUT);
|
||||
|
||||
System.exit(InterJVMLinkTest.CODE_OK);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
System.exit(InterJVMLinkTest.CODE_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
public static int sign(int n) {
|
||||
return n < 0 ? -1 : n == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
panel = new DropTargetPanel();
|
||||
|
||||
frame = new Frame();
|
||||
frame.setTitle("InterJVMLinkTest DropTarget frame");
|
||||
frame.setLocation(10, 200);
|
||||
frame.add(panel);
|
||||
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
p = panel.getLocationOnScreen();
|
||||
d = panel.getSize();
|
||||
});
|
||||
|
||||
String javaPath = System.getProperty("java.home", "");
|
||||
String command = javaPath + File.separator + "bin" +
|
||||
File.separator + "java -cp " + System.getProperty("test.classes", ".") +
|
||||
" InterJVMLinkTest " +
|
||||
p.x + " " + p.y + " " + d.width + " " + d.height;
|
||||
|
||||
Process process = Runtime.getRuntime().exec(command);
|
||||
returnCode = process.waitFor();
|
||||
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
int count = errorStream.available();
|
||||
if (count > 0) {
|
||||
byte[] b = new byte[count];
|
||||
errorStream.read(b);
|
||||
System.err.println("========= Child VM System.err ========");
|
||||
System.err.print(new String(b));
|
||||
System.err.println("======================================");
|
||||
}
|
||||
|
||||
switch (returnCode) {
|
||||
case CODE_NOT_RETURNED:
|
||||
System.err.println("Child VM: failed to start");
|
||||
break;
|
||||
case CODE_OK:
|
||||
System.err.println("Child VM: normal termination");
|
||||
break;
|
||||
case CODE_FAILURE:
|
||||
System.err.println("Child VM: abnormal termination");
|
||||
break;
|
||||
}
|
||||
if (panel == null || (panel.isEntered() && !panel.isDropped())) {
|
||||
throw new RuntimeException("The test failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DragSourceButton extends Button implements Serializable,
|
||||
DragGestureListener {
|
||||
final Transferable transferable = new StringSelection("TEXT");
|
||||
final DragSourceListener dragSourceListener = new DragSourceAdapter() {
|
||||
public void dragDropEnd(DragSourceDropEvent dsde) {
|
||||
System.exit(InterJVMLinkTest.CODE_OK);
|
||||
}
|
||||
};
|
||||
|
||||
public DragSourceButton() {
|
||||
super("DragSourceButton");
|
||||
|
||||
DragSource ds = DragSource.getDefaultDragSource();
|
||||
ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_LINK,
|
||||
this);
|
||||
}
|
||||
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, transferable, dragSourceListener);
|
||||
}
|
||||
}
|
||||
|
||||
class DragSourcePanel extends Panel {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
|
||||
public DragSourcePanel() {
|
||||
setLayout(new GridLayout(1, 1));
|
||||
add(new DragSourceButton());
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
}
|
||||
|
||||
class DropTargetPanel extends Panel implements DropTargetListener {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
boolean entered = false;
|
||||
boolean dropped = false;
|
||||
|
||||
public DropTargetPanel() {
|
||||
setDropTarget(new DropTarget(this, DnDConstants.ACTION_LINK, this));
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
|
||||
public void dragEnter(DropTargetDragEvent dtde) {
|
||||
entered = true;
|
||||
}
|
||||
|
||||
public void dragExit(DropTargetEvent dte) {}
|
||||
|
||||
public void dragOver(DropTargetDragEvent dtde) {}
|
||||
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
dtde.rejectDrop();
|
||||
dropped = true;
|
||||
}
|
||||
|
||||
public void dropActionChanged(DropTargetDragEvent dtde) {}
|
||||
|
||||
public boolean isEntered() {
|
||||
return entered;
|
||||
}
|
||||
|
||||
public boolean isDropped() {
|
||||
return dropped;
|
||||
}
|
||||
}
|
||||
283
test/jdk/java/awt/dnd/IntraJVMGetDropSuccessTest.java
Normal file
283
test/jdk/java/awt/dnd/IntraJVMGetDropSuccessTest.java
Normal file
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2023, 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.
|
||||
*/
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragGestureRecognizer;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceAdapter;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetAdapter;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.event.AWTEventListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4658741
|
||||
@summary verifies that getDropSuccess() returns correct value for intra-JVM DnD
|
||||
@key headful
|
||||
@run main IntraJVMGetDropSuccessTest
|
||||
*/
|
||||
|
||||
public class IntraJVMGetDropSuccessTest implements AWTEventListener {
|
||||
|
||||
static final Object SYNC_LOCK = new Object();
|
||||
static final int FRAME_ACTIVATION_TIMEOUT = 3000;
|
||||
static final int MOUSE_RELEASE_TIMEOUT = 1000;
|
||||
|
||||
static class DragSourceDropListener extends DragSourceAdapter {
|
||||
private boolean finished = false;
|
||||
private boolean dropSuccess = false;
|
||||
|
||||
public void reset() {
|
||||
finished = false;
|
||||
dropSuccess = false;
|
||||
}
|
||||
|
||||
public boolean isDropFinished() {
|
||||
return finished;
|
||||
}
|
||||
|
||||
public boolean getDropSuccess() {
|
||||
return dropSuccess;
|
||||
}
|
||||
|
||||
public void dragDropEnd(DragSourceDropEvent dsde) {
|
||||
finished = true;
|
||||
dropSuccess = dsde.getDropSuccess();
|
||||
synchronized (SYNC_LOCK) {
|
||||
SYNC_LOCK.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class ChildCanvas extends Canvas {
|
||||
private final Dimension preferredDimension = new Dimension(100, 200);
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
}
|
||||
|
||||
volatile Frame frame;
|
||||
volatile Canvas canvas1;
|
||||
volatile Canvas canvas2;
|
||||
volatile Canvas canvas3;
|
||||
volatile Point p;
|
||||
volatile Dimension d;
|
||||
volatile Component c;
|
||||
|
||||
volatile DragSourceDropListener dragSourceListener;
|
||||
volatile DragSource dragSource;
|
||||
volatile Transferable transferable;
|
||||
volatile DragGestureListener dragGestureListener;
|
||||
volatile DragGestureRecognizer dragGestureRecognizer;
|
||||
volatile DropTargetListener dropTargetListener;
|
||||
volatile DropTarget dropTarget;
|
||||
|
||||
Component clickedComponent = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IntraJVMGetDropSuccessTest test = new IntraJVMGetDropSuccessTest();
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.frame != null) {
|
||||
test.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
frame = new Frame();
|
||||
canvas1 = new ChildCanvas();
|
||||
canvas2 = new ChildCanvas();
|
||||
canvas3 = new ChildCanvas();
|
||||
|
||||
dragSourceListener = new DragSourceDropListener();
|
||||
dragSource = DragSource.getDefaultDragSource();
|
||||
transferable = new StringSelection("TEXT");
|
||||
dragGestureListener = new DragGestureListener() {
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, transferable, dragSourceListener);
|
||||
}
|
||||
};
|
||||
dragGestureRecognizer =
|
||||
dragSource.createDefaultDragGestureRecognizer(canvas2, DnDConstants.ACTION_COPY,
|
||||
dragGestureListener);
|
||||
dropTargetListener = new DropTargetAdapter() {
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
dtde.acceptDrop(DnDConstants.ACTION_COPY);
|
||||
dtde.dropComplete(true);
|
||||
}
|
||||
};
|
||||
dropTarget = new DropTarget(canvas3, dropTargetListener);
|
||||
|
||||
|
||||
canvas1.setBackground(Color.red);
|
||||
canvas2.setBackground(Color.yellow);
|
||||
canvas3.setBackground(Color.green);
|
||||
|
||||
frame.setTitle("IntraJVMGetDropSuccessTest");
|
||||
frame.setLocation(100, 100);
|
||||
frame.setLayout(new GridLayout(1, 3));
|
||||
frame.getToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK);
|
||||
frame.add(canvas1);
|
||||
frame.add(canvas2);
|
||||
frame.add(canvas3);
|
||||
frame.pack();
|
||||
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public static int sign(int n) {
|
||||
return n < 0 ? -1 : n == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
Robot robot = new Robot();
|
||||
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
final Point srcPoint = getCenterLocationOnScreen(canvas2);
|
||||
|
||||
if (!pointInComponent(robot, srcPoint, canvas2)) {
|
||||
System.err.println("WARNING: Couldn't locate " + canvas2);
|
||||
return;
|
||||
}
|
||||
|
||||
final Point dstPoint1 = getCenterLocationOnScreen(canvas1);
|
||||
|
||||
if (!pointInComponent(robot, dstPoint1, canvas1)) {
|
||||
System.err.println("WARNING: Couldn't locate " + canvas1);
|
||||
return;
|
||||
}
|
||||
|
||||
final Point dstPoint2 = getCenterLocationOnScreen(canvas3);
|
||||
if (!pointInComponent(robot, dstPoint2, canvas3)) {
|
||||
System.err.println("WARNING: Couldn't locate " + canvas3);
|
||||
return;
|
||||
}
|
||||
|
||||
robot.waitForIdle();
|
||||
test(robot, srcPoint, dstPoint1, false);
|
||||
test(robot, srcPoint, dstPoint2, true);
|
||||
test(robot, srcPoint, dstPoint1, false);
|
||||
}
|
||||
|
||||
public Point getCenterLocationOnScreen(Component c) throws Exception {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
p = c.getLocationOnScreen();
|
||||
d = c.getSize();
|
||||
});
|
||||
p.translate(d.width / 2, d.height / 2);
|
||||
return p;
|
||||
}
|
||||
|
||||
public void test(Robot robot, Point src, Point dst, boolean success)
|
||||
throws InterruptedException {
|
||||
|
||||
dragSourceListener.reset();
|
||||
robot.mouseMove(src.x, src.y);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
|
||||
for (Point p = new Point(src); !p.equals(dst);
|
||||
p.translate(sign(dst.x - p.x),
|
||||
sign(dst.y - p.y))) {
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.delay(50);
|
||||
}
|
||||
|
||||
synchronized (SYNC_LOCK) {
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
SYNC_LOCK.wait();
|
||||
}
|
||||
|
||||
if (!dragSourceListener.isDropFinished()) {
|
||||
throw new RuntimeException("Drop not finished");
|
||||
}
|
||||
|
||||
if (dragSourceListener.getDropSuccess() != success) {
|
||||
throw new RuntimeException("getDropSuccess() returned wrong value:"
|
||||
+ dragSourceListener.getDropSuccess());
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() throws Exception {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
clickedComponent = null;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void eventDispatched(AWTEvent e) {
|
||||
if (e.getID() == MouseEvent.MOUSE_RELEASED) {
|
||||
clickedComponent = (Component)e.getSource();
|
||||
synchronized (SYNC_LOCK) {
|
||||
SYNC_LOCK.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean pointInComponent(Robot robot, Point p, Component comp)
|
||||
throws Exception {
|
||||
robot.waitForIdle();
|
||||
reset();
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
synchronized (SYNC_LOCK) {
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
SYNC_LOCK.wait(MOUSE_RELEASE_TIMEOUT);
|
||||
}
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
c = clickedComponent;
|
||||
|
||||
while (c != null && c != comp) {
|
||||
c = c.getParent();
|
||||
}
|
||||
});
|
||||
|
||||
return c == comp;
|
||||
}
|
||||
}
|
||||
382
test/jdk/java/awt/dnd/LinkAcceptanceTest.java
Normal file
382
test/jdk/java/awt/dnd/LinkAcceptanceTest.java
Normal file
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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.
|
||||
*/
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Label;
|
||||
import java.awt.List;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceDragEvent;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DragSourceEvent;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetContext;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
|
||||
/*
|
||||
@test
|
||||
@bug 4416788
|
||||
@summary Tests that URL can be recognized by a java drop target
|
||||
@requires (os.family == "windows")
|
||||
@key headful
|
||||
@run main LinkAcceptanceTest
|
||||
*/
|
||||
|
||||
public class LinkAcceptanceTest {
|
||||
|
||||
public static final int CODE_NOT_RETURNED = -1;
|
||||
public static final int CODE_OK = 0;
|
||||
public static final int CODE_FAILURE = 1;
|
||||
public static final int FRAME_ACTIVATION_TIMEOUT = 2000;
|
||||
public static final int DROP_TIMEOUT = 12000;
|
||||
public static final int DROP_COMPLETION_TIMEOUT = 4000;
|
||||
|
||||
private int returnCode = CODE_NOT_RETURNED;
|
||||
|
||||
volatile Frame frame;
|
||||
volatile Robot robot;
|
||||
volatile Panel panel;
|
||||
volatile Point p;
|
||||
volatile Dimension d;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
LinkAcceptanceTest test = new LinkAcceptanceTest();
|
||||
if (args.length > 0) {
|
||||
test.run(args);
|
||||
} else {
|
||||
EventQueue.invokeAndWait(test::init);
|
||||
try {
|
||||
test.start();
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (test.frame != null) {
|
||||
test.frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void run(String[] args) {
|
||||
try {
|
||||
if (args.length != 4) {
|
||||
throw new RuntimeException("Incorrect command line arguments.");
|
||||
}
|
||||
|
||||
int x = Integer.parseInt(args[0]);
|
||||
int y = Integer.parseInt(args[1]);
|
||||
int w = Integer.parseInt(args[2]);
|
||||
int h = Integer.parseInt(args[3]);
|
||||
|
||||
TransferableURL t = new TransferableURL();
|
||||
panel = new DragSourcePanel(t);
|
||||
|
||||
frame = new Frame();
|
||||
frame.setTitle("LinkAcceptanceTest DragSource frame");
|
||||
frame.setLocation(300, 200);
|
||||
frame.add(panel);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
Point sourcePoint = panel.getLocationOnScreen();
|
||||
Dimension d = panel.getSize();
|
||||
sourcePoint.translate(d.width / 2, d.height / 2);
|
||||
|
||||
Point targetPoint = new Point(x + w / 2, y + h / 2);
|
||||
|
||||
robot = new Robot();
|
||||
robot.mouseMove(sourcePoint.x, sourcePoint.y);
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
for (; !sourcePoint.equals(targetPoint);
|
||||
sourcePoint.translate(sign(targetPoint.x - sourcePoint.x),
|
||||
sign(targetPoint.y - sourcePoint.y))) {
|
||||
robot.mouseMove(sourcePoint.x, sourcePoint.y);
|
||||
Thread.sleep(10);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
|
||||
synchronized (t) {
|
||||
t.wait(DROP_TIMEOUT);
|
||||
}
|
||||
|
||||
Thread.sleep(DROP_COMPLETION_TIMEOUT);
|
||||
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
System.exit(LinkAcceptanceTest.CODE_FAILURE);
|
||||
}
|
||||
|
||||
System.exit(LinkAcceptanceTest.CODE_OK);
|
||||
}
|
||||
|
||||
public static int sign(int n) {
|
||||
return n < 0 ? -1 : n == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
panel = new DropTargetPanel();
|
||||
|
||||
frame = new Frame();
|
||||
frame.setTitle("DropTarget frame");
|
||||
frame.setLocation(10, 200);
|
||||
frame.add(panel);
|
||||
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
try {
|
||||
Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
p = panel.getLocationOnScreen();
|
||||
d = panel.getSize();
|
||||
});
|
||||
|
||||
String javaPath = System.getProperty("java.home", "");
|
||||
String command = javaPath + File.separator + "bin" +
|
||||
File.separator + "java -cp " + System.getProperty("test.classes", ".") +
|
||||
" LinkAcceptanceTest " +
|
||||
p.x + " " + p.y + " " + d.width + " " + d.height;
|
||||
Process process = Runtime.getRuntime().exec(command);
|
||||
returnCode = process.waitFor();
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
int count = errorStream.available();
|
||||
if (count > 0) {
|
||||
byte[] b = new byte[count];
|
||||
errorStream.read(b);
|
||||
System.err.println("========= Child VM System.err ========");
|
||||
System.err.print(new String(b));
|
||||
System.err.println("======================================");
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
switch (returnCode) {
|
||||
case CODE_NOT_RETURNED:
|
||||
System.err.println("Child VM: failed to start");
|
||||
break;
|
||||
case CODE_OK:
|
||||
System.err.println("Child VM: normal termination");
|
||||
break;
|
||||
case CODE_FAILURE:
|
||||
System.err.println("Child VM: abnormal termination");
|
||||
break;
|
||||
}
|
||||
if (returnCode != CODE_OK) {
|
||||
throw new RuntimeException("The test failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TransferableURL implements Transferable {
|
||||
|
||||
public static String URL_STRING = "http://java.sun.com";
|
||||
public static final int NUM_DATA_FLAVORS = 3;
|
||||
static DataFlavor[] supportedFlavors = new DataFlavor[NUM_DATA_FLAVORS];
|
||||
|
||||
static String[] flavorList = { "application/x-java-url;class=java.net.URL",
|
||||
"text/uri-list;class=java.lang.String",
|
||||
"text/plain;class=java.lang.String" };
|
||||
static {
|
||||
try {
|
||||
for (int i = 0; i < NUM_DATA_FLAVORS; i++) {
|
||||
supportedFlavors[i] = new DataFlavor(flavorList[i]);
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException("Failed to construct the flavor");
|
||||
}
|
||||
}
|
||||
|
||||
public DataFlavor[] getTransferDataFlavors() {
|
||||
return supportedFlavors;
|
||||
}
|
||||
|
||||
public boolean isDataFlavorSupported(DataFlavor flavor) {
|
||||
|
||||
for (int i = 0; i < NUM_DATA_FLAVORS; i++) {
|
||||
if (flavor.equals(supportedFlavors[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
|
||||
|
||||
if (!isDataFlavorSupported(flavor)) {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
|
||||
return new String(URL_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
class DragSourceLabel extends Label implements Serializable,
|
||||
DragGestureListener,
|
||||
DragSourceListener {
|
||||
|
||||
final Transferable transferable;
|
||||
|
||||
public DragSourceLabel(Transferable t) {
|
||||
super(TransferableURL.URL_STRING);
|
||||
|
||||
this.transferable = t;
|
||||
DragSource ds = DragSource.getDefaultDragSource();
|
||||
ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_LINK,
|
||||
this);
|
||||
}
|
||||
|
||||
public void dragGestureRecognized(DragGestureEvent dge) {
|
||||
dge.startDrag(null, transferable, this);
|
||||
}
|
||||
|
||||
public void dragEnter(DragSourceDragEvent dsde) {}
|
||||
|
||||
public void dragExit(DragSourceEvent dse) {}
|
||||
|
||||
public void dragOver(DragSourceDragEvent dsde) {}
|
||||
|
||||
public void dragDropEnd(DragSourceDropEvent dsde) {}
|
||||
|
||||
public void dropActionChanged(DragSourceDragEvent dsde) {}
|
||||
}
|
||||
|
||||
|
||||
class DragSourcePanel extends Panel {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
|
||||
public DragSourcePanel(Transferable t) {
|
||||
setLayout(new GridLayout(1, 1));
|
||||
add(new DragSourceLabel(t));
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
}
|
||||
|
||||
class DropTargetPanel extends Panel implements DropTargetListener {
|
||||
|
||||
final Dimension preferredDimension = new Dimension(200, 200);
|
||||
|
||||
public DropTargetPanel() {
|
||||
setBackground(Color.green);
|
||||
setDropTarget(new DropTarget(this, this));
|
||||
setLayout(new GridLayout(1, 1));
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return preferredDimension;
|
||||
}
|
||||
|
||||
public void dragEnter(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_LINK);
|
||||
}
|
||||
|
||||
public void dragExit(DropTargetEvent dte) {}
|
||||
|
||||
public void dragOver(DropTargetDragEvent dtde) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_LINK);
|
||||
}
|
||||
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
DropTargetContext dtc = dtde.getDropTargetContext();
|
||||
|
||||
if ((dtde.getSourceActions() & DnDConstants.ACTION_LINK) != 0) {
|
||||
dtde.acceptDrop(DnDConstants.ACTION_LINK);
|
||||
} else {
|
||||
dtde.rejectDrop();
|
||||
return;
|
||||
}
|
||||
|
||||
removeAll();
|
||||
final List list = new List();
|
||||
add(list);
|
||||
|
||||
Transferable t = dtde.getTransferable();
|
||||
DataFlavor[] dfs = t.getTransferDataFlavors();
|
||||
|
||||
for (int i = 0; i < dfs.length; i++) {
|
||||
|
||||
DataFlavor flavor = dfs[i];
|
||||
String transferText = null;
|
||||
URL transferURL = null;
|
||||
|
||||
if (flavor.getRepresentationClass().equals(URL.class)) {
|
||||
try {
|
||||
transferURL = (URL)t.getTransferData(flavor);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("The test failed: unable to recognize " +
|
||||
flavor.getMimeType());
|
||||
}
|
||||
list.add(transferURL + ":" + flavor.getMimeType());
|
||||
}
|
||||
|
||||
if (flavor.getRepresentationClass().equals(String.class)) {
|
||||
try {
|
||||
transferText = (String)t.getTransferData(flavor);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("The test failed: unable to recognize " +
|
||||
flavor.getMimeType());
|
||||
}
|
||||
list.add(transferText + ":" + flavor.getMimeType());
|
||||
}
|
||||
}
|
||||
|
||||
dtc.dropComplete(true);
|
||||
validate();
|
||||
}
|
||||
|
||||
public void dropActionChanged(DropTargetDragEvent dtde) {}
|
||||
|
||||
}
|
||||
82
test/jdk/java/awt/dnd/ZeroFormatTransferableTest.java
Normal file
82
test/jdk/java/awt/dnd/ZeroFormatTransferableTest.java
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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 4388802
|
||||
@summary tests that getting clipboard data doesn't crash when there are no
|
||||
formats on the clipboard
|
||||
@key headful
|
||||
@run main ZeroFormatTransferableTest
|
||||
*/
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
|
||||
public class ZeroFormatTransferableTest {
|
||||
public static void main(String[] args) throws InterruptedException, IOException {
|
||||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
clipboard.setContents(new ZeroFormatTransferable(), null);
|
||||
|
||||
String javaPath = System.getProperty("java.home", "");
|
||||
|
||||
Process process = new ProcessBuilder(
|
||||
javaPath + File.separator + "bin" + File.separator + "java",
|
||||
"-cp",
|
||||
System.getProperty("test.classes", "."),
|
||||
"ZeroFormatTransferableTest").start();
|
||||
process.waitFor();
|
||||
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
int count = errorStream.available();
|
||||
if (count > 0) {
|
||||
byte[] b = new byte[count];
|
||||
errorStream.read(b);
|
||||
System.err.println("========= Child VM System.err ========");
|
||||
System.err.print(new String(b));
|
||||
System.err.println("======================================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ZeroFormatTransferable implements Transferable {
|
||||
public DataFlavor[] getTransferDataFlavors() {
|
||||
return new DataFlavor[] {};
|
||||
}
|
||||
|
||||
public boolean isDataFlavorSupported(DataFlavor df) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getTransferData(DataFlavor df)
|
||||
throws UnsupportedFlavorException {
|
||||
throw new UnsupportedFlavorException(df);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, 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 4267393
|
||||
@summary Ensures minimal amount of paints
|
||||
@key headful
|
||||
@run main ComponentResizedTest
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class ComponentResizedTest extends Frame {
|
||||
volatile int paintCount = 0;
|
||||
|
||||
public static void main(String[] args) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
ComponentResizedTest componentResizedTest = new ComponentResizedTest();
|
||||
EventQueue.invokeAndWait(componentResizedTest::init);
|
||||
componentResizedTest.start();
|
||||
if (componentResizedTest != null) EventQueue.invokeAndWait(()
|
||||
-> componentResizedTest.dispose());
|
||||
}
|
||||
|
||||
public void paint(Graphics g) {
|
||||
System.out.println("Paint called");
|
||||
++paintCount;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
setTitle("ComponentResizedTest");
|
||||
setSize(100, 100);
|
||||
setLocationRelativeTo(null);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
public void start () throws InterruptedException {
|
||||
Thread.sleep(1000);
|
||||
|
||||
paintCount = 0;
|
||||
dispatchEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED));
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
if (paintCount > 0) {
|
||||
throw new RuntimeException("ComponentResizedTest failed. " +
|
||||
"Paint called.");
|
||||
}
|
||||
}
|
||||
}
|
||||
58
test/jdk/java/awt/event/ComponentEvent/ObjectSourceTest.java
Normal file
58
test/jdk/java/awt/event/ComponentEvent/ObjectSourceTest.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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 4420658
|
||||
@summary No ClassCastException should be thrown when getComponent()
|
||||
is called on an event with a non-Component source.
|
||||
The result should be null.
|
||||
@key headful
|
||||
@run main ObjectSourceTest
|
||||
*/
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ComponentEvent;
|
||||
|
||||
|
||||
public class ObjectSourceTest {
|
||||
static Frame frame;
|
||||
|
||||
public static void main(String[] args) {
|
||||
frame = new Frame("ObjectSourceTest");
|
||||
|
||||
ComponentEvent ce = new ComponentEvent(frame, ComponentEvent.COMPONENT_SHOWN);
|
||||
Object obj = new Object();
|
||||
ce.setSource(obj);
|
||||
|
||||
Component comp = ce.getComponent();
|
||||
if (comp != null) {
|
||||
throw new RuntimeException("ObjectSourceTest failed. comp != null");
|
||||
}
|
||||
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
87
test/jdk/java/awt/event/ComponentEvent/ResizeDeniedTest.java
Normal file
87
test/jdk/java/awt/event/ComponentEvent/ResizeDeniedTest.java
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2023, 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 4523758
|
||||
@requires (os.family == "windows")
|
||||
@summary Checks denied setBounds doesn't generate ComponentEvent
|
||||
@key headful
|
||||
@run main ResizeDeniedTest
|
||||
*/
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class ResizeDeniedTest implements ComponentListener {
|
||||
static int runs = 0;
|
||||
static Frame frame;
|
||||
|
||||
public static void main(String[] args) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
|
||||
ResizeDeniedTest resizeDeniedTest = new ResizeDeniedTest();
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
frame = new Frame("ResizeDeniedTest");
|
||||
frame.addComponentListener(resizeDeniedTest);
|
||||
frame.setSize(1, 1);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
});
|
||||
|
||||
synchronized(resizeDeniedTest) {
|
||||
resizeDeniedTest.wait(2000);
|
||||
}
|
||||
|
||||
if (frame != null) {
|
||||
EventQueue.invokeAndWait(() -> frame.dispose());
|
||||
}
|
||||
|
||||
if (runs > 10) {
|
||||
System.out.println("Infinite loop");
|
||||
throw new RuntimeException("Infinite loop");
|
||||
}
|
||||
}
|
||||
|
||||
public void componentHidden(ComponentEvent e) {}
|
||||
|
||||
public void componentMoved(ComponentEvent e) {}
|
||||
|
||||
public void componentResized(ComponentEvent e) {
|
||||
frame.setSize(1, 1);
|
||||
System.out.println("Size " + frame.getSize());
|
||||
++runs;
|
||||
if (runs > 10) {
|
||||
System.out.println("Infinite loop");
|
||||
synchronized(this) {
|
||||
this.notify();
|
||||
}
|
||||
throw new RuntimeException("Infinite loop");
|
||||
}
|
||||
}
|
||||
|
||||
public void componentShown(ComponentEvent e) {}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2023, 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 4715486
|
||||
@summary Tests that FocusEvent.opposite is not serialized
|
||||
@key headful
|
||||
@run main OppositeSerialization
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import static java.lang.Integer.valueOf;
|
||||
|
||||
/**
|
||||
* "This is an AUTOMATIC test",
|
||||
* "however, that's what it does:",
|
||||
* "1. It tests that FocusEvent.opposite field is written",
|
||||
* "to serialized stream as null regardless of whether it",
|
||||
* "is actually null or not. For this purpose, we serialize",
|
||||
* "a FocusEvent with really huge opposite, and then check",
|
||||
* "if serialized object is huge or not.",
|
||||
* "2. It tests that FocusEvent.opposite deserializes as",
|
||||
* "null, even if it was serialized in the previous version",
|
||||
* "of JDK. For this purpose, file old.ser is included into",
|
||||
* "test. It is FocusEvent serialized with 1.4, with non-null",
|
||||
* "opposite. We check that after deserialization opposite",
|
||||
* "field is null"
|
||||
*/
|
||||
public class OppositeSerialization {
|
||||
static Button b1;
|
||||
static Frame b2;
|
||||
|
||||
public static void main(String[] args) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
b1 = new Button("OppositeSerialization - Source");
|
||||
b2 = new Frame("OppositeSerialization - Opposite");
|
||||
b2.setLayout(new FlowLayout());
|
||||
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
String s = (valueOf(i)).toString();
|
||||
b2.add(new Button("Button" + s));
|
||||
}
|
||||
});
|
||||
|
||||
FocusEvent evt1 = new FocusEvent(b1, FocusEvent.FOCUS_GAINED, false, b2);
|
||||
|
||||
/*
|
||||
* Here we test that opposite component isn't serialized.
|
||||
* We created a really huge opposite component for a focus
|
||||
* event evt1 and now we'll see if the size of serialized data
|
||||
* is big.
|
||||
*/
|
||||
try {
|
||||
FileOutputStream fos = new FileOutputStream("new.ser");
|
||||
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
||||
oos.writeObject(evt1);
|
||||
oos.flush();
|
||||
} catch (Exception e1) {
|
||||
System.out.println("Sorry! Couldn't write the stream");
|
||||
System.out.println("The test failed, but the reason is " +
|
||||
"unrelated to the subject");
|
||||
throw new RuntimeException("The test couldn't write serialized data");
|
||||
}
|
||||
|
||||
File file = new File("new.ser");
|
||||
if (file.length() > 50000) {
|
||||
System.out.println("The test failed: serialized " +
|
||||
"FocusEvent too huge");
|
||||
System.err.println("Serialized FocusEvent is too huge.");
|
||||
System.err.println("Probably opposite field is " +
|
||||
"serialized incorrectly.");
|
||||
throw new RuntimeException("Serialized FocusEvent is too huge");
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we test that opposite is not deserialized even if it is present
|
||||
* in the stream. old.ser is created with JDK1.4 using the following
|
||||
* source code:
|
||||
*
|
||||
* import java.awt.event.*;
|
||||
* import java.io.*;
|
||||
* import java.awt.*;
|
||||
*
|
||||
* public class OldFocusSerializer {
|
||||
*
|
||||
* public static void main(String[] args) {
|
||||
*
|
||||
* Button b1 = new Button("Source");
|
||||
* Button b2 = new Button("Opposite");
|
||||
*
|
||||
* FocusEvent evt1 = new FocusEvent(b1,
|
||||
* FocusEvent.FOCUS_GAINED,
|
||||
* false,
|
||||
* b2);
|
||||
*
|
||||
* try {
|
||||
* FileOutputStream fos = new FileOutputStream("old.ser");
|
||||
* ObjectOutputStream oos = new ObjectOutputStream(fos);
|
||||
* oos.writeObject(evt1);
|
||||
* oos.flush();
|
||||
* } catch (IOException e) {
|
||||
* System.out.println("Sorry! Couldn't write the stream");
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
FocusEvent evt2;
|
||||
String testPath = System.getProperty("test.src", ".");
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(testPath +
|
||||
File.separator + "old.ser");
|
||||
ObjectInputStream ois = new ObjectInputStream(fis);
|
||||
evt2 = (FocusEvent)ois.readObject();
|
||||
} catch (Exception e2) {
|
||||
System.out.println("The test failed as it couldn't read the stream");
|
||||
throw new RuntimeException("The test couldn't read serialized data");
|
||||
}
|
||||
|
||||
if (evt2.getOppositeComponent() != null) {
|
||||
System.out.println("The test failed: opposite component " +
|
||||
"deserialized to non-null value");
|
||||
System.err.println("FocusEvent stored in old.ser should have " +
|
||||
"null opposite field.");
|
||||
throw new RuntimeException("Non-null opposite component " +
|
||||
"after deserialization");
|
||||
}
|
||||
|
||||
if (b2 != null) {
|
||||
EventQueue.invokeAndWait(() -> b2.dispose());
|
||||
}
|
||||
|
||||
System.out.println("The test passed");
|
||||
}
|
||||
}
|
||||
BIN
test/jdk/java/awt/event/FocusEvent/OppositeSerialization/old.ser
Normal file
BIN
test/jdk/java/awt/event/FocusEvent/OppositeSerialization/old.ser
Normal file
Binary file not shown.
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, 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 4460376
|
||||
@summary HierarchyEvents on Frame should be dispatched correctly
|
||||
when on its child Window this event type enabled
|
||||
@key headful
|
||||
@run main HierarchyEventOnWindowTest
|
||||
*/
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Button;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.HierarchyBoundsAdapter;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class HierarchyEventOnWindowTest {
|
||||
static Frame frame;
|
||||
|
||||
public static void main(String args[]) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
frame = new Frame("HierarchyEventOnWindowTest");
|
||||
CustomWindow window = new CustomWindow(frame);
|
||||
window.enableEvents();
|
||||
frame.add(new Button(""));
|
||||
window.disableEvents();
|
||||
window.addHierarchyListener(e -> {});
|
||||
window.addHierarchyBoundsListener(new HierarchyBoundsAdapter(){});
|
||||
frame.add(new Button(""));
|
||||
});
|
||||
|
||||
if (frame != null) {
|
||||
EventQueue.invokeAndWait(() -> frame.dispose());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CustomWindow extends Window {
|
||||
public CustomWindow(Frame frame) {
|
||||
super(frame);
|
||||
}
|
||||
public void enableEvents() {
|
||||
enableEvents(AWTEvent.HIERARCHY_EVENT_MASK |
|
||||
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
|
||||
}
|
||||
public void disableEvents() {
|
||||
disableEvents(AWTEvent.HIERARCHY_EVENT_MASK |
|
||||
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@@ -21,30 +21,47 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.awt.AWTException;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.Timer;
|
||||
|
||||
import javax.swing.text.JTextComponent;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import javax.swing.text.html.StyleSheet;
|
||||
|
||||
import static javax.swing.SwingUtilities.invokeAndWait;
|
||||
import static javax.swing.SwingUtilities.isEventDispatchThread;
|
||||
@@ -68,8 +85,13 @@ public class PassFailJFrame {
|
||||
private static volatile boolean failed;
|
||||
private static volatile boolean timeout;
|
||||
private static volatile String testFailedReason;
|
||||
|
||||
private static final AtomicInteger imgCounter = new AtomicInteger(0);
|
||||
|
||||
private static JFrame frame;
|
||||
|
||||
private static Robot robot;
|
||||
|
||||
public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER}
|
||||
|
||||
public PassFailJFrame(String instructions) throws InterruptedException,
|
||||
@@ -114,21 +136,69 @@ public class PassFailJFrame {
|
||||
public PassFailJFrame(String title, String instructions, long testTimeOut,
|
||||
int rows, int columns) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
this(title, instructions, testTimeOut, rows, columns, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a JFrame with a given title & serves as test instructional
|
||||
* frame where the user follows the specified test instruction in order
|
||||
* to test the test case & mark the test pass or fail. If the expected
|
||||
* result is seen then the user click on the 'Pass' button else click
|
||||
* on the 'Fail' button and the reason for the failure should be
|
||||
* specified in the JDialog JTextArea.
|
||||
* <p>
|
||||
* The test instruction frame also provides a way for the tester to take
|
||||
* a screenshot (full screen or individual frame) if this feature
|
||||
* is enabled by passing {@code true} as {@code enableScreenCapture}
|
||||
* parameter.
|
||||
*
|
||||
* @param title title of the Frame.
|
||||
* @param instructions the instruction for the tester on how to test
|
||||
* and what is expected (pass) and what is not
|
||||
* expected (fail).
|
||||
* @param testTimeOut test timeout where time is specified in minutes.
|
||||
* @param rows number of visible rows of the JTextArea where the
|
||||
* instruction is show.
|
||||
* @param columns Number of columns of the instructional
|
||||
* JTextArea
|
||||
* @param enableScreenCapture if set to true, 'Capture Screen' button & its
|
||||
* associated UIs are added to test instruction
|
||||
* frame
|
||||
* @throws InterruptedException exception thrown when thread is
|
||||
* interrupted
|
||||
* @throws InvocationTargetException if an exception is thrown while
|
||||
* creating the test instruction frame on
|
||||
* EDT
|
||||
*/
|
||||
public PassFailJFrame(String title, String instructions, long testTimeOut,
|
||||
int rows, int columns,
|
||||
boolean enableScreenCapture) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
if (isEventDispatchThread()) {
|
||||
createUI(title, instructions, testTimeOut, rows, columns);
|
||||
createUI(title, instructions, testTimeOut, rows, columns,
|
||||
enableScreenCapture);
|
||||
} else {
|
||||
invokeAndWait(() -> createUI(title, instructions, testTimeOut,
|
||||
rows, columns));
|
||||
rows, columns, enableScreenCapture));
|
||||
}
|
||||
}
|
||||
|
||||
private PassFailJFrame(Builder builder) throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
this(builder.title, builder.instructions, builder.testTimeOut,
|
||||
builder.rows, builder.columns, builder.screenCapture);
|
||||
}
|
||||
|
||||
private static void createUI(String title, String instructions,
|
||||
long testTimeOut, int rows, int columns) {
|
||||
long testTimeOut, int rows, int columns,
|
||||
boolean enableScreenCapture) {
|
||||
frame = new JFrame(title);
|
||||
frame.setLayout(new BorderLayout());
|
||||
JTextArea instructionsText = new JTextArea(instructions, rows, columns);
|
||||
instructionsText.setEditable(false);
|
||||
instructionsText.setLineWrap(true);
|
||||
|
||||
JTextComponent text = instructions.startsWith("<html>")
|
||||
? configureHTML(instructions, rows, columns)
|
||||
: configurePlainText(instructions, rows, columns);
|
||||
text.setEditable(false);
|
||||
|
||||
long tTimeout = TimeUnit.MINUTES.toMillis(testTimeOut);
|
||||
|
||||
@@ -149,7 +219,7 @@ public class PassFailJFrame {
|
||||
});
|
||||
timer.start();
|
||||
frame.add(testTimeoutLabel, BorderLayout.NORTH);
|
||||
frame.add(new JScrollPane(instructionsText), BorderLayout.CENTER);
|
||||
frame.add(new JScrollPane(text), BorderLayout.CENTER);
|
||||
|
||||
JButton btnPass = new JButton("Pass");
|
||||
btnPass.addActionListener((e) -> {
|
||||
@@ -167,6 +237,10 @@ public class PassFailJFrame {
|
||||
buttonsPanel.add(btnPass);
|
||||
buttonsPanel.add(btnFail);
|
||||
|
||||
if (enableScreenCapture) {
|
||||
buttonsPanel.add(createCapturePanel());
|
||||
}
|
||||
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
@@ -184,6 +258,117 @@ public class PassFailJFrame {
|
||||
windowList.add(frame);
|
||||
}
|
||||
|
||||
private static JTextComponent configurePlainText(String instructions,
|
||||
int rows, int columns) {
|
||||
JTextArea text = new JTextArea(instructions, rows, columns);
|
||||
text.setLineWrap(true);
|
||||
text.setWrapStyleWord(true);
|
||||
return text;
|
||||
}
|
||||
|
||||
private static JTextComponent configureHTML(String instructions,
|
||||
int rows, int columns) {
|
||||
JEditorPane text = new JEditorPane("text/html", instructions);
|
||||
text.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,
|
||||
Boolean.TRUE);
|
||||
// Set preferred size as if it were JTextArea
|
||||
text.setPreferredSize(new JTextArea(rows, columns).getPreferredSize());
|
||||
|
||||
HTMLEditorKit kit = (HTMLEditorKit) text.getEditorKit();
|
||||
StyleSheet styles = kit.getStyleSheet();
|
||||
// Reduce the default margins
|
||||
styles.addRule("ol, ul { margin-left-ltr: 20; margin-left-rtl: 20 }");
|
||||
// Make the size of code blocks the same as other text
|
||||
styles.addRule("code { font-size: inherit }");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
private static JComponent createCapturePanel() {
|
||||
JComboBox<CaptureType> screenShortType = new JComboBox<>(CaptureType.values());
|
||||
|
||||
JButton capture = new JButton("ScreenShot");
|
||||
capture.addActionListener((e) ->
|
||||
captureScreen((CaptureType) screenShortType.getSelectedItem()));
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
panel.add(screenShortType);
|
||||
panel.add(capture);
|
||||
return panel;
|
||||
}
|
||||
|
||||
private enum CaptureType {
|
||||
FULL_SCREEN("Capture Full Screen"),
|
||||
WINDOWS("Capture Individual Frame");
|
||||
|
||||
private final String type;
|
||||
CaptureType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
private static Robot createRobot() {
|
||||
if (robot == null) {
|
||||
try {
|
||||
robot = new Robot();
|
||||
} catch (AWTException e) {
|
||||
String errorMsg = "Failed to create an instance of Robot.";
|
||||
JOptionPane.showMessageDialog(frame, errorMsg, "Failed",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
forceFail(errorMsg + e.getMessage());
|
||||
}
|
||||
}
|
||||
return robot;
|
||||
}
|
||||
|
||||
private static void captureScreen(Rectangle bounds) {
|
||||
Robot robot = createRobot();
|
||||
|
||||
List<Image> imageList = robot.createMultiResolutionScreenCapture(bounds)
|
||||
.getResolutionVariants();
|
||||
Image image = imageList.get(imageList.size() - 1);
|
||||
|
||||
File file = new File("CaptureScreen_"
|
||||
+ imgCounter.incrementAndGet() + ".png");
|
||||
try {
|
||||
ImageIO.write((RenderedImage) image, "png", file);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void captureScreen(CaptureType type) {
|
||||
switch (type) {
|
||||
case FULL_SCREEN:
|
||||
Arrays.stream(GraphicsEnvironment.getLocalGraphicsEnvironment()
|
||||
.getScreenDevices())
|
||||
.map(GraphicsDevice::getDefaultConfiguration)
|
||||
.map(GraphicsConfiguration::getBounds)
|
||||
.forEach(PassFailJFrame::captureScreen);
|
||||
break;
|
||||
|
||||
case WINDOWS:
|
||||
windowList.stream()
|
||||
.filter(Window::isShowing)
|
||||
.map(Window::getBounds)
|
||||
.forEach(PassFailJFrame::captureScreen);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value of capture type");
|
||||
}
|
||||
|
||||
JOptionPane.showMessageDialog(frame,
|
||||
"Screen Captured Successfully",
|
||||
"Screen Capture",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
|
||||
private static String convertMillisToTimeStr(long millis) {
|
||||
if (millis < 0) {
|
||||
return "00:00:00";
|
||||
@@ -421,4 +606,72 @@ public class PassFailJFrame {
|
||||
testFailedReason = FAILURE_REASON + reason;
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String title;
|
||||
private String instructions;
|
||||
private long testTimeOut;
|
||||
private int rows;
|
||||
private int columns;
|
||||
private boolean screenCapture = false;
|
||||
|
||||
public Builder title(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder instructions(String instructions) {
|
||||
this.instructions = instructions;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder testTimeOut(long testTimeOut) {
|
||||
this.testTimeOut = testTimeOut;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder rows(int rows) {
|
||||
this.rows = rows;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder columns(int columns) {
|
||||
this.columns = columns;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder screenCapture() {
|
||||
this.screenCapture = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PassFailJFrame build() throws InterruptedException,
|
||||
InvocationTargetException {
|
||||
validate();
|
||||
return new PassFailJFrame(this);
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
if (this.title == null) {
|
||||
this.title = TITLE;
|
||||
}
|
||||
|
||||
if (this.instructions == null || this.instructions.length() == 0) {
|
||||
throw new RuntimeException("Please provide the test " +
|
||||
"instruction for this manual test");
|
||||
}
|
||||
|
||||
if (this.testTimeOut == 0L) {
|
||||
this.testTimeOut = TEST_TIMEOUT;
|
||||
}
|
||||
|
||||
if (this.rows == 0) {
|
||||
this.rows = ROWS;
|
||||
}
|
||||
|
||||
if (this.columns == 0) {
|
||||
this.columns = COLUMNS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@@ -24,7 +24,11 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8013827 8011950 8017212 8025128
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.util
|
||||
* @summary Check whether File.createTempFile can handle special parameters
|
||||
* @build jdk.test.lib.OSVersion jdk.test.lib.Platform
|
||||
@run main SpecialTempFile
|
||||
* @author Dan Xu
|
||||
*/
|
||||
|
||||
@@ -32,10 +36,11 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import jdk.test.lib.Platform;
|
||||
import jdk.test.lib.OSVersion;
|
||||
|
||||
public class SpecialTempFile {
|
||||
|
||||
private static void test(String name, String[] prefix, String[] suffix,
|
||||
boolean exceptionExpected) throws IOException
|
||||
{
|
||||
@@ -48,7 +53,7 @@ public class SpecialTempFile {
|
||||
final String exceptionMsg = "Unable to create temporary file";
|
||||
String[] dirs = { null, "." };
|
||||
|
||||
Path testPath = Paths.get(System.getProperty("test.dir", "."));
|
||||
Path testPath = Path.of(System.getProperty("test.dir", "."));
|
||||
for (int i = 0; i < prefix.length; i++) {
|
||||
boolean exceptionThrown = false;
|
||||
File f = null;
|
||||
@@ -99,12 +104,15 @@ public class SpecialTempFile {
|
||||
test("SlashedName", slashPre, slashSuf, true);
|
||||
|
||||
// Windows tests
|
||||
if (!System.getProperty("os.name").startsWith("Windows"))
|
||||
if (!Platform.isWindows())
|
||||
return;
|
||||
|
||||
// Test JDK-8013827
|
||||
String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" };
|
||||
String[] resvSuf = { ".temp", ".temp" };
|
||||
test("ReservedName", resvPre, resvSuf, true);
|
||||
boolean exceptionExpected =
|
||||
!(System.getProperty("os.name").endsWith("11") ||
|
||||
new OSVersion(10, 0).compareTo(OSVersion.current()) > 0);
|
||||
test("ReservedName", resvPre, resvSuf, exceptionExpected);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user