8341997: Tests create files in src tree instead of scratch dir

Reviewed-by: erikj, jpai
This commit is contained in:
Brian Burkhalter 2024-10-15 17:44:49 +00:00
parent 5eae20f73b
commit b9cabbecda
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
@ -45,7 +45,7 @@ public class ReadXBytes {
private static final Random RND = RandomFactory.getRandom();
public static void main(String args[]) throws IOException {
File dir = new File(System.getProperty("test.src", "."));
File dir = new File(".");
dir.deleteOnExit();
File empty = File.createTempFile("foo", "bar", dir);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
@ -40,7 +40,7 @@ public class ForceException {
int numberOfBlocks = 200;
int fileLength = numberOfBlocks * blockSize;
File file = new File(System.getProperty("test.src", "."), "test.dat");
File file = new File(".", "test.dat");
file.deleteOnExit();
try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
raf.setLength(fileLength);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
@ -51,7 +51,7 @@ public class ForceViews {
@BeforeTest(alwaysRun=true)
public void openChannel() throws IOException {
Path file = Path.of(System.getProperty("test.src", "."), "junk");
Path file = Path.of(".", "junk");
fc = FileChannel.open(file, CREATE_NEW, READ, WRITE, DELETE_ON_CLOSE);
ByteBuffer buf = ByteBuffer.wrap(new byte[1024]);
fc.write(buf);