Skip to content

Commit 8a470e1

Browse files
committed
8209768: Refactor java/util/prefs/CheckUserPrefsStorage.sh to plain java test
Backport-of: f095a9e
1 parent 8738bb5 commit 8a470e1

File tree

4 files changed

+54
-75
lines changed

4 files changed

+54
-75
lines changed

test/jdk/java/util/prefs/CheckUserPrefFirst.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2018, 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
@@ -24,9 +24,7 @@
2424
import java.util.prefs.Preferences;
2525

2626
/**
27-
*
28-
* @author khazra
29-
* First class called by CheckUserPrefsStorage.sh to create and
27+
* First class called by CheckUserPrefsStorage.java to create and
3028
* store a user preference
3129
*/
3230

test/jdk/java/util/prefs/CheckUserPrefLater.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2018, 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
@@ -24,9 +24,8 @@
2424
import java.util.prefs.Preferences;
2525

2626
/**
27-
* CheckUserPrefsStorage.sh uses this to check that preferences stored
27+
* CheckUserPrefsStorage.java uses this to check that preferences stored
2828
* by CheckUserPrefFirst.java can be retrieved
29-
* @author khazra
3029
*/
3130

3231
public class CheckUserPrefLater {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2018, 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+
/*
25+
* @test
26+
* @bug 7198073 7197662
27+
* @summary Tests that user preferences are stored in the permanent storage
28+
* @library /test/lib
29+
* @build jdk.test.lib.process.* CheckUserPrefFirst CheckUserPrefLater
30+
* @run main CheckUserPrefsStorage
31+
*/
32+
33+
import jdk.test.lib.process.ProcessTools;
34+
35+
public class CheckUserPrefsStorage {
36+
37+
public static void main(String[] args) throws Throwable {
38+
// First to create and store a user preference
39+
run("CheckUserPrefFirst");
40+
// Then check that preferences stored by CheckUserPrefFirst can be retrieved
41+
run("CheckUserPrefLater");
42+
}
43+
44+
public static void run(String testName) throws Exception {
45+
ProcessTools.executeTestJvm("-Djava.util.prefs.userRoot=.", testName)
46+
.outputTo(System.out)
47+
.errorTo(System.out)
48+
.shouldHaveExitValue(0);
49+
}
50+
}

test/jdk/java/util/prefs/CheckUserPrefsStorage.sh

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)