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 CodelistTest 26 * @bug 8054889 27 * @library /testlibrary 28 * @modules java.base/sun.misc 29 * java.compiler 30 * java.management 31 * jdk.jvmstat/sun.jvmstat.monitor 32 * @build com.oracle.java.testlibrary.* 33 * @build com.oracle.java.testlibrary.dcmd.* 34 * @build MethodIdentifierParser 35 * @run testng CodelistTest 36 * @summary Test of diagnostic command Compiler.codelist 37 */ 38 39 import org.testng.annotations.Test; 40 import org.testng.Assert; 41 42 import com.oracle.java.testlibrary.OutputAnalyzer; 43 import com.oracle.java.testlibrary.dcmd.CommandExecutor; 44 import com.oracle.java.testlibrary.dcmd.JMXExecutor; 45 46 import java.lang.reflect.Method; 47 48 public class CodelistTest { 49 50 /** 51 * This test calls Jcmd (diagnostic command tool) Compiler.codelist and then parses the output, 52 * making sure that the first methods in the list is valid by reflection. 53 * 54 * Output example: 55 * 56 * 6 0 java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V [0x00007f7b49200910, 0x00007f7b49200aa0 - 0x00007f7b49200d30] 57 * 2 3 java.lang.String.indexOf(II)I [0x00007f7b49200d90, 0x00007f7b49200f60 - 0x00007f7b49201490] 58 * 7 3 java.lang.Math.min(II)I [0x00007f7b4922f010, 0x00007f7b4922f180 - 0x00007f7b4922f338] 59 * 8 3 java.lang.String.equals(Ljava/lang/Object;)Z [0x00007f7b4922fb10, 0x00007f7b4922fd40 - 0x00007f7b49230698] 60 * 9 3 java.lang.AbstractStringBuilder.ensureCapacityInternal(I)V [0x00007f7b49232010, 0x00007f7b492321a0 - 0x00007f7b49232510] 61 * 10 1 java.lang.Object.<init>()V [0x00007f7b49233e90, 0x00007f7b49233fe0 - 0x00007f7b49234118] 62 * 63 */ 64 | 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 CodelistTest 26 * @bug 8054889 27 * @library /testlibrary 28 * @modules java.base/sun.misc 29 * java.compiler 30 * java.management 31 * jdk.jvmstat/sun.jvmstat.monitor 32 * @build jdk.test.lib.* 33 * @build jdk.test.lib.dcmd.* 34 * @build MethodIdentifierParser 35 * @run testng CodelistTest 36 * @summary Test of diagnostic command Compiler.codelist 37 */ 38 39 import org.testng.annotations.Test; 40 import org.testng.Assert; 41 42 import jdk.test.lib.OutputAnalyzer; 43 import jdk.test.lib.dcmd.CommandExecutor; 44 import jdk.test.lib.dcmd.JMXExecutor; 45 46 import java.lang.reflect.Method; 47 48 public class CodelistTest { 49 50 /** 51 * This test calls Jcmd (diagnostic command tool) Compiler.codelist and then parses the output, 52 * making sure that the first methods in the list is valid by reflection. 53 * 54 * Output example: 55 * 56 * 6 0 java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V [0x00007f7b49200910, 0x00007f7b49200aa0 - 0x00007f7b49200d30] 57 * 2 3 java.lang.String.indexOf(II)I [0x00007f7b49200d90, 0x00007f7b49200f60 - 0x00007f7b49201490] 58 * 7 3 java.lang.Math.min(II)I [0x00007f7b4922f010, 0x00007f7b4922f180 - 0x00007f7b4922f338] 59 * 8 3 java.lang.String.equals(Ljava/lang/Object;)Z [0x00007f7b4922fb10, 0x00007f7b4922fd40 - 0x00007f7b49230698] 60 * 9 3 java.lang.AbstractStringBuilder.ensureCapacityInternal(I)V [0x00007f7b49232010, 0x00007f7b492321a0 - 0x00007f7b49232510] 61 * 10 1 java.lang.Object.<init>()V [0x00007f7b49233e90, 0x00007f7b49233fe0 - 0x00007f7b49234118] 62 * 63 */ 64 |