18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.api.recording.settings;
27
28
29 import java.io.File;
30 import java.io.FileReader;
31 import java.io.Reader;
32 import java.util.Map;
33
34 import jdk.jfr.Configuration;
35 import jdk.test.lib.Asserts;
36 import jdk.test.lib.jfr.EventNames;
37
38 /*
39 * @test
40 * @summary Test setName().
41 * @key jfr
42 * @library /test/lib
43 * @run main/othervm jdk.jfr.api.recording.settings.TestCreateConfigFromReader
44 */
45 public class TestCreateConfigFromReader {
46
47 private static final String DIR = System.getProperty("test.src", ".");
48
49 public static void main(String[] args) throws Throwable {
50 testOkConfig();
51 testNullReader();
52 }
53
54 private static void testOkConfig() throws Exception {
55 File settingsFile = new File(DIR, "settings.jfc");
56 if(!settingsFile.exists()) throw new RuntimeException("File " + settingsFile.getAbsolutePath() + " not found ");
57
58 FileReader reader = new FileReader(settingsFile);
59
60 Configuration config = Configuration.create(reader);
61 Map<String, String> settings = config.getSettings();
|
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.api.recording.settings;
27
28
29 import java.io.File;
30 import java.io.FileReader;
31 import java.io.Reader;
32 import java.util.Map;
33
34 import jdk.jfr.Configuration;
35 import jdk.test.lib.Asserts;
36 import jdk.test.lib.jfr.EventNames;
37
38 /**
39 * @test
40 * @summary Test setName().
41 * @key jfr
42 * @requires vm.hasJFR
43 * @library /test/lib
44 * @run main/othervm jdk.jfr.api.recording.settings.TestCreateConfigFromReader
45 */
46 public class TestCreateConfigFromReader {
47
48 private static final String DIR = System.getProperty("test.src", ".");
49
50 public static void main(String[] args) throws Throwable {
51 testOkConfig();
52 testNullReader();
53 }
54
55 private static void testOkConfig() throws Exception {
56 File settingsFile = new File(DIR, "settings.jfc");
57 if(!settingsFile.exists()) throw new RuntimeException("File " + settingsFile.getAbsolutePath() + " not found ");
58
59 FileReader reader = new FileReader(settingsFile);
60
61 Configuration config = Configuration.create(reader);
62 Map<String, String> settings = config.getSettings();
|