< prev index next >

test/jdk/jdk/jfr/api/recording/options/TestName.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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.options;
  27 
  28 import jdk.jfr.Recording;
  29 import jdk.test.lib.Asserts;
  30 import jdk.test.lib.jfr.CommonHelper;
  31 import jdk.test.lib.jfr.VoidFunction;
  32 
  33 /*
  34  * @test
  35  * @summary Test setName().
  36  * @key jfr

  37  * @library /test/lib
  38  * @run main/othervm jdk.jfr.api.recording.options.TestName
  39  */
  40 public class TestName {
  41 
  42     public static void main(String[] args) throws Throwable {
  43         Recording r = new Recording();
  44 
  45         Asserts.assertNotNull(r.getName(), "Default name should not be null");
  46         System.out.println("name=" + r.getName());
  47         Asserts.assertEquals(r.getName(), Long.toString(r.getId()), "Default name != id");
  48 
  49         testNames(r);
  50         r.start();
  51         testNames(r);
  52         r.stop();
  53         testNames(r);
  54         r.close();
  55     }
  56 




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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.options;
  27 
  28 import jdk.jfr.Recording;
  29 import jdk.test.lib.Asserts;
  30 import jdk.test.lib.jfr.CommonHelper;
  31 import jdk.test.lib.jfr.VoidFunction;
  32 
  33 /**
  34  * @test
  35  * @summary Test setName().
  36  * @key jfr
  37  * @requires vm.hasJFR
  38  * @library /test/lib
  39  * @run main/othervm jdk.jfr.api.recording.options.TestName
  40  */
  41 public class TestName {
  42 
  43     public static void main(String[] args) throws Throwable {
  44         Recording r = new Recording();
  45 
  46         Asserts.assertNotNull(r.getName(), "Default name should not be null");
  47         System.out.println("name=" + r.getName());
  48         Asserts.assertEquals(r.getName(), Long.toString(r.getId()), "Default name != id");
  49 
  50         testNames(r);
  51         r.start();
  52         testNames(r);
  53         r.stop();
  54         testNames(r);
  55         r.close();
  56     }
  57 


< prev index next >