Skip to content

Commit 5d13aae

Browse files
committed
merge with openjdk (fixed Logger in tests)
1 parent f2246bc commit 5d13aae

File tree

9 files changed

+439
-28
lines changed

9 files changed

+439
-28
lines changed

src/test/java/BlockFlagTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ public class BlockFlagTest {
4747

4848
static final boolean SAVE_IMAGE = false;
4949

50+
static final Logger log = Logger.getLogger("sun.java2d.marlin");
51+
5052
public static void main(String argv[]) {
5153
Locale.setDefault(Locale.US);
5254

5355
// initialize j.u.l Looger:
54-
final Logger log = Logger.getLogger("sun.java2d.marlin");
5556
log.addHandler(new Handler() {
5657
@Override
5758
public void publish(LogRecord record) {

src/test/java/Bug8341381.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ public final class Bug8341381 {
8989
static final AtomicBoolean isMarlin = new AtomicBoolean();
9090
static final CountDownLatch latch = new CountDownLatch(1);
9191

92+
// initialize j.u.l Logger:
93+
static final Logger log = Logger.getLogger("sun.java2d.marlin");
9294
public static void main(final String[] args) {
9395
Locale.setDefault(Locale.US);
9496

9597
// FIRST: Get Marlin runtime state from its log:
9698

97-
// initialize j.u.l Logger:
98-
final Logger log = Logger.getLogger("sun.java2d.marlin");
9999
log.addHandler(new Handler() {
100100
@Override
101101
public void publish(LogRecord record) {

src/test/java/ClipShapeTest.java

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,20 +52,43 @@
5252
import javax.imageio.ImageWriter;
5353
import javax.imageio.stream.ImageOutputStream;
5454

55-
/**
56-
* @test
55+
/*
56+
* @test id=Poly
5757
* @bug 8191814
58-
* @summary Verifies that Marlin rendering generates the same
59-
* images with and without clipping optimization with all possible
60-
* stroke (cap/join) and/or dashes or fill modes (EO rules)
61-
* for paths made of either 9 lines, 4 quads, 2 cubics (random)
62-
* Note: Use the argument -slow to run more intensive tests (too much time)
63-
*
58+
* @summary Runs the test with "-poly" option
6459
* @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly
60+
*/
61+
62+
/*
63+
* @test id=PolyDoDash
64+
* @bug 8191814
65+
* @summary Runs the test with "-poly -doDash" options
6566
* @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly -doDash
67+
*/
68+
69+
/*
70+
* @test id=Cubic
71+
* @bug 8191814
72+
* @summary Runs the test with "-cubic" option
6673
* @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic
74+
*/
75+
76+
/*
77+
* @test id=CubicDoDash
78+
* @bug 8191814
79+
* @summary Runs the test with "-cubic -doDash" options
6780
* @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic -doDash
68-
*/
81+
*/
82+
83+
/**
84+
* Verifies that Marlin rendering generates the same images with and without
85+
* clipping optimization with all possible stroke (cap/join) and/or dashes or
86+
* fill modes (EO rules) for paths made of either 9 lines, 4 quads, 2 cubics
87+
* (random).
88+
* <p>
89+
* Note: Use the argument {@code -slow} to run more intensive tests (too much
90+
* time).
91+
*/
6992
public final class ClipShapeTest {
7093

7194
// test options:
@@ -131,13 +154,12 @@ static enum ShapeMode {
131154
static final AtomicBoolean isMarlin = new AtomicBoolean();
132155
static final AtomicBoolean isClipRuntime = new AtomicBoolean();
133156

157+
static final Logger log = Logger.getLogger("sun.java2d.marlin");
158+
134159
static {
135160
Locale.setDefault(Locale.US);
136161

137162
// FIRST: Get Marlin runtime state from its log:
138-
139-
// initialize j.u.l Looger:
140-
final Logger log = Logger.getLogger("sun.java2d.marlin");
141163
log.addHandler(new Handler() {
142164
@Override
143165
public void publish(LogRecord record) {

src/test/java/CrashNaNTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,11 +54,12 @@ public class CrashNaNTest {
5454

5555
static final boolean SAVE_IMAGE = false;
5656

57+
// initialize j.u.l Looger:
58+
static final Logger log = Logger.getLogger("sun.java2d.marlin");
59+
5760
public static void main(String argv[]) {
5861
Locale.setDefault(Locale.US);
5962

60-
// initialize j.u.l Looger:
61-
final Logger log = Logger.getLogger("sun.java2d.marlin");
6263
log.addHandler(new Handler() {
6364
@Override
6465
public void publish(LogRecord record) {

src/test/java/CrashPaintTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -53,11 +53,12 @@ public class CrashPaintTest {
5353

5454
static final boolean SAVE_IMAGE = false;
5555

56+
// initialize j.u.l Looger:
57+
static final Logger log = Logger.getLogger("sun.java2d.marlin");
58+
5659
public static void main(String argv[]) {
5760
Locale.setDefault(Locale.US);
5861

59-
// initialize j.u.l Looger:
60-
final Logger log = Logger.getLogger("sun.java2d.marlin");
6162
log.addHandler(new Handler() {
6263
@Override
6364
public void publish(LogRecord record) {

src/test/java/CrashTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,9 +35,9 @@
3535
/**
3636
* @test
3737
* @summary Simple crash rendering test using huge GeneralPaths with the Marlin renderer
38-
* @run main/othervm -mx512m CrashTest
38+
* @run main/othervm -Xmx512m CrashTest
3939
* @ignore tests that take a long time and consumes 5Gb memory
40-
* @run main/othervm -ms4g -mx4g CrashTest -slow
40+
* @run main/othervm -Xms4g -Xmx4g CrashTest -slow
4141
*/
4242
public class CrashTest {
4343

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
import sun.java2d.pipe.RenderingEngine;
25+
26+
/**
27+
* @test
28+
* @bug 8241307
29+
* @summary Verifies that the Marlin renderer is the default RenderingEngine
30+
* @modules java.desktop/sun.java2d.pipe
31+
*/
32+
public final class DefaultRenderingEngine {
33+
34+
public static void main(String[] argv) {
35+
36+
final RenderingEngine engine = RenderingEngine.getInstance();
37+
38+
if (!engine.getClass().getSimpleName().contains("Marlin")) {
39+
throw new RuntimeException("Marlin must be the default RenderingEngine");
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)