< prev index next >

test/jdk/jdk/jfr/cmd/TestPrintXML.java

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


  35 import java.util.Iterator;
  36 import java.util.List;
  37 import java.util.Map;
  38 import java.util.Stack;
  39 
  40 import javax.xml.parsers.SAXParser;
  41 import javax.xml.parsers.SAXParserFactory;
  42 
  43 import jdk.jfr.ValueDescriptor;
  44 import jdk.jfr.consumer.RecordedEvent;
  45 import jdk.jfr.consumer.RecordedObject;
  46 import jdk.jfr.consumer.RecordingFile;
  47 import jdk.test.lib.process.OutputAnalyzer;
  48 
  49 import org.xml.sax.Attributes;
  50 import org.xml.sax.InputSource;
  51 import org.xml.sax.SAXException;
  52 import org.xml.sax.XMLReader;
  53 import org.xml.sax.helpers.DefaultHandler;
  54 
  55 /*
  56  * @test
  57  * @key jfr
  58  * @summary Tests print --xml

  59  *
  60  * @library /test/lib /test/jdk
  61  * @modules java.scripting
  62  *          java.xml
  63  *          jdk.jfr
  64  *
  65  * @run main/othervm jdk.jfr.cmd.TestPrintXML
  66  */
  67 public class TestPrintXML {
  68 
  69     public static void main(String... args) throws Exception {
  70 
  71         Path recordingFile = ExecuteHelper.createProfilingRecording().toAbsolutePath();
  72 
  73         OutputAnalyzer output = ExecuteHelper.run("print", "--xml", recordingFile.toString());
  74         String xml = output.getStdout();
  75         System.out.println(xml);
  76         // Parse XML string
  77         SAXParserFactory factory = SAXParserFactory.newInstance();
  78         SAXParser sp = factory.newSAXParser();




  35 import java.util.Iterator;
  36 import java.util.List;
  37 import java.util.Map;
  38 import java.util.Stack;
  39 
  40 import javax.xml.parsers.SAXParser;
  41 import javax.xml.parsers.SAXParserFactory;
  42 
  43 import jdk.jfr.ValueDescriptor;
  44 import jdk.jfr.consumer.RecordedEvent;
  45 import jdk.jfr.consumer.RecordedObject;
  46 import jdk.jfr.consumer.RecordingFile;
  47 import jdk.test.lib.process.OutputAnalyzer;
  48 
  49 import org.xml.sax.Attributes;
  50 import org.xml.sax.InputSource;
  51 import org.xml.sax.SAXException;
  52 import org.xml.sax.XMLReader;
  53 import org.xml.sax.helpers.DefaultHandler;
  54 
  55 /**
  56  * @test
  57  * @key jfr
  58  * @summary Tests print --xml
  59  * @requires vm.hasJFR
  60  *
  61  * @library /test/lib /test/jdk
  62  * @modules java.scripting
  63  *          java.xml
  64  *          jdk.jfr
  65  *
  66  * @run main/othervm jdk.jfr.cmd.TestPrintXML
  67  */
  68 public class TestPrintXML {
  69 
  70     public static void main(String... args) throws Exception {
  71 
  72         Path recordingFile = ExecuteHelper.createProfilingRecording().toAbsolutePath();
  73 
  74         OutputAnalyzer output = ExecuteHelper.run("print", "--xml", recordingFile.toString());
  75         String xml = output.getStdout();
  76         System.out.println(xml);
  77         // Parse XML string
  78         SAXParserFactory factory = SAXParserFactory.newInstance();
  79         SAXParser sp = factory.newSAXParser();


< prev index next >