Skip to content

Commit

Permalink
8341997: Tests create files in src tree instead of scratch dir
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, jpai
  • Loading branch information
Brian Burkhalter committed Oct 15, 2024
1 parent 5eae20f commit b9cabbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/jdk/java/io/FileInputStream/ReadXBytes.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/java/nio/MappedByteBuffer/ForceException.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -40,7 +40,7 @@ public static void main(String[] args) throws IOException {
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);
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/java/nio/MappedByteBuffer/ForceViews.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -51,7 +51,7 @@ static record Segment(int position, int length) {}

@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);
Expand Down

3 comments on commit b9cabbe

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sendaoYan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk23u

@openjdk
Copy link

@openjdk openjdk bot commented on b9cabbe Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sendaoYan the backport was successfully created on the branch backport-sendaoYan-b9cabbec-master in my personal fork of openjdk/jdk23u. To create a pull request with this backport targeting openjdk/jdk23u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit b9cabbec from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 15 Oct 2024 and was reviewed by Erik Joelsson and Jaikiran Pai.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk23u:

$ git fetch https://github.com/openjdk-bots/jdk23u.git backport-sendaoYan-b9cabbec-master:backport-sendaoYan-b9cabbec-master
$ git checkout backport-sendaoYan-b9cabbec-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk23u.git backport-sendaoYan-b9cabbec-master

Please sign in to comment.