14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
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.state;
27
28 import java.time.Duration;
29 import java.util.function.Consumer;
30
31 import jdk.jfr.Recording;
32 import jdk.test.lib.Asserts;
33
34 /*
35 * @test
36 * @key jfr
37 * @summary Test options in different states
38 * @library /test/lib
39 * @run main/othervm jdk.jfr.api.recording.state.TestOptionState
40 */
41 public class TestOptionState {
42
43 // Name Age Size Dur. Dest. Disk
44 static boolean[] NEW = arrayOf(true, true, true, true, true, true);
45 static boolean[] DELAYED = arrayOf(true, true, true, true, true, true);
46 static boolean[] RUNNING = arrayOf(true, true, true, true, true, false);
47 static boolean[] STOPPED = arrayOf(true, true, true, false, false, false);
48 static boolean[] CLOSED = arrayOf(false, false, false, false, false, false);
49
50 public static void main(String[] args) throws Throwable {
51 Recording r = new Recording();
52 assertRecordingState(r, NEW);
53 r.scheduleStart(Duration.ofHours(2));
54 assertRecordingState(r, DELAYED);
55 r.start();
56 assertRecordingState(r, RUNNING);
57 r.stop();
|
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
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.state;
27
28 import java.time.Duration;
29 import java.util.function.Consumer;
30
31 import jdk.jfr.Recording;
32 import jdk.test.lib.Asserts;
33
34 /**
35 * @test
36 * @key jfr
37 * @summary Test options in different states
38 * @requires vm.hasJFR
39 * @library /test/lib
40 * @run main/othervm jdk.jfr.api.recording.state.TestOptionState
41 */
42 public class TestOptionState {
43
44 // Name Age Size Dur. Dest. Disk
45 static boolean[] NEW = arrayOf(true, true, true, true, true, true);
46 static boolean[] DELAYED = arrayOf(true, true, true, true, true, true);
47 static boolean[] RUNNING = arrayOf(true, true, true, true, true, false);
48 static boolean[] STOPPED = arrayOf(true, true, true, false, false, false);
49 static boolean[] CLOSED = arrayOf(false, false, false, false, false, false);
50
51 public static void main(String[] args) throws Throwable {
52 Recording r = new Recording();
53 assertRecordingState(r, NEW);
54 r.scheduleStart(Duration.ofHours(2));
55 assertRecordingState(r, DELAYED);
56 r.start();
57 assertRecordingState(r, RUNNING);
58 r.stop();
|