mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8355445: [java.nio] Use @requires tag instead of exiting based on "os.name" property value
Reviewed-by: lancea, jpai, iris
This commit is contained in:
parent
4826a91e7a
commit
84f570c573
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2009, 2025, 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
|
||||
@ -26,6 +26,7 @@
|
||||
* @bug 6823609
|
||||
* @summary Selector.select can hangs on Windows for cases where a helper thread
|
||||
* becomes redudant but a new helper is immediately needed.
|
||||
* @requires (os.family == "windows")
|
||||
*/
|
||||
|
||||
import java.nio.channels.*;
|
||||
@ -37,11 +38,6 @@ public class HelperSlowToDie {
|
||||
private static volatile boolean done;
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
if (!System.getProperty("os.name").startsWith("Windows")) {
|
||||
System.out.println("Test skipped as it verifies a Windows specific bug");
|
||||
return;
|
||||
}
|
||||
|
||||
Selector sel = Selector.open();
|
||||
|
||||
// register channels
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2025, 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 @@
|
||||
/* @test
|
||||
* @bug 6285901 6501089
|
||||
* @summary Check no data is written to wrong socket channel during async closing.
|
||||
* @requires (os.family != "windows")
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
@ -44,10 +45,6 @@ public class AsyncCloseChannel {
|
||||
static int targetPort;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||
System.err.println("WARNING: Still does not work on Windows!");
|
||||
return;
|
||||
}
|
||||
Thread ss = new SensorServer(); ss.start();
|
||||
Thread ts = new TargetServer(); ts.start();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, 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 @@
|
||||
/*
|
||||
* @test
|
||||
* @summary Sockets shouldn't be inherited when creating a child process
|
||||
* @requires (os.family == "windows")
|
||||
*/
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.*;
|
||||
@ -138,9 +139,6 @@ public class SocketInheritance {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (!System.getProperty("os.name").startsWith("Windows"))
|
||||
return;
|
||||
|
||||
if (args.length == 0) {
|
||||
start();
|
||||
} else {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2025, 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
|
||||
@ -59,15 +59,9 @@ import static java.util.Arrays.asList;
|
||||
|
||||
public class InheritedChannelTest {
|
||||
|
||||
private static final String TEST_SRC = System.getProperty("test.src");
|
||||
private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
|
||||
private static final String TEST_CLASSES = System.getProperty("test.classes");
|
||||
|
||||
private static final String OS_NAME = System.getProperty("os.name").toLowerCase();
|
||||
|
||||
private static final String ARCH = System.getProperty("os.arch");
|
||||
private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
|
||||
|
||||
private static final Path libraryPath
|
||||
= Paths.get(System.getProperty("java.library.path"));
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2025, 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 @@
|
||||
/* @test
|
||||
@bug 6176819
|
||||
@summary Check if COMPUND_TEXT charset works as expected
|
||||
@requires (os.family != "windows")
|
||||
@run main/timeout=1200 TestCOMP
|
||||
*/
|
||||
|
||||
@ -35,9 +36,6 @@ import java.nio.*;
|
||||
|
||||
public class TestCOMP {
|
||||
public static void main(String[] argv) throws CharacterCodingException {
|
||||
String osName = System.getProperty("os.name");
|
||||
if (osName.startsWith("Windows"))
|
||||
return;
|
||||
try {
|
||||
String src =
|
||||
"JIS0208\u4eb0" +
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@ -25,6 +25,7 @@
|
||||
* @bug 6808647
|
||||
* @summary Checks that a DirectoryStream's iterator returns the expected
|
||||
* path when opening a directory by specifying only the drive letter.
|
||||
* @requires (os.family == "windows")
|
||||
* @library ..
|
||||
*/
|
||||
|
||||
@ -35,11 +36,6 @@ import java.io.IOException;
|
||||
public class DriveLetter {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
String os = System.getProperty("os.name");
|
||||
if (!os.startsWith("Windows")) {
|
||||
System.out.println("This is Windows specific test");
|
||||
return;
|
||||
}
|
||||
String here = System.getProperty("user.dir");
|
||||
if (here.length() < 2 || here.charAt(1) != ':')
|
||||
throw new RuntimeException("Unable to determine drive letter");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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 @@
|
||||
/* @test
|
||||
* @bug 4313887 6838333
|
||||
* @summary Sanity test for JDK-specific FILE_TREE watch event modifier
|
||||
* @requires (os.family == "windows")
|
||||
* @library ..
|
||||
* @modules jdk.unsupported
|
||||
*/
|
||||
@ -129,11 +130,6 @@ public class FileTreeModifier {
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
if (!System.getProperty("os.name").startsWith("Windows")) {
|
||||
System.out.println("This is Windows-only test at this time!");
|
||||
return;
|
||||
}
|
||||
|
||||
Path dir = TestUtil.createTemporaryDirectory();
|
||||
try {
|
||||
doTest(dir);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user