Package org.adoptopenjdk.jitwatch.model

Examples of org.adoptopenjdk.jitwatch.model.MemberSignatureParts


  public void testPackageConstructorNoParams() throws Exception
  {
    String sigBC = "java.lang.String();";
    String sigLog = "java.lang.String <init> ()V";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();
    assertEquals(0, modListBC.size());
    assertEquals(0, mspBC.getGenerics().size());
    assertEquals("void", mspBC.getReturnType());
View Full Code Here


  public void testPublicConstructorNoParams() throws Exception
  {
    String sigBC = "public java.lang.String()";
    String sigLog = "java.lang.String <init> ()V";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();

    assertEquals(1, modListBC.size());
    assertEquals("public", modListBC.get(0));
View Full Code Here

  public void testConstructorWithParams() throws Exception
  {
    String sigBC = "public java.lang.String(java.lang.String, int)";
    String sigLog = "java.lang.String <init> (Ljava.lang.String;I)V";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();

    assertEquals(1, modListBC.size());
    assertEquals("public", modListBC.get(0));
View Full Code Here

  public void testSimpleMethodNoParams() throws Exception
  {
    String sigBC = "public void gc()";
    String sigLog = "java.lang.System gc ()V";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();

    assertEquals(1, modListBC.size());
    assertEquals("public", modListBC.get(0));
View Full Code Here

  public void testSimpleMethodWithParams() throws Exception
  {
    String sigBC = "public boolean matches(java.lang.String)";
    String sigLog = "java.lang.String matches (Ljava.lang.String;)Z";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();
    assertEquals(1, modListBC.size());
    assertEquals("public", modListBC.get(0));
    assertEquals(0, mspBC.getGenerics().size());
View Full Code Here

  public void testSimpleMethodWithParamsAndParamNames() throws Exception
  {
    String sigBC = "public boolean startsWith(java.lang.String foo, int bar)";
    String sigLog = "java.lang.String startsWith (Ljava.lang.String;I)Z";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);
    MemberSignatureParts mspLog = MemberSignatureParts.fromLogCompilationSignature(sigLog);

    List<String> modListBC = mspBC.getModifiers();

    assertEquals(1, modListBC.size());
    assertEquals("public", modListBC.get(0));
View Full Code Here

  @Test
  public void testSimpleGenericMethod()
  {
    String sig = "public Map<String,String> copy(Map<String,String>)";
    MemberSignatureParts msp = MemberSignatureParts.fromBytecodeSignature("com.chrisnewland.Test", sig);

    List<String> modList = msp.getModifiers();

    assertEquals(1, modList.size());
    assertEquals("public", modList.get(0));

    assertEquals(0, msp.getGenerics().size());

    assertEquals("Map<String,String>", msp.getReturnType());

    assertEquals("copy", msp.getMemberName());

    assertEquals(1, msp.getParamTypes().size());

    List<String> paramTypeList = msp.getParamTypes();
    assertEquals("Map<String,String>", paramTypeList.get(0));
  }
View Full Code Here

  @Test
  public void testSignatureWithGenericExtends()
  {
    String sig = "public static <T extends java.lang.Object, U extends java.lang.Object> T[] copyOf(U[], int, java.lang.Class<? extends T[]>)";
    MemberSignatureParts msp = MemberSignatureParts.fromBytecodeSignature("java.util.Arrays", sig);

    List<String> modList = msp.getModifiers();

    assertEquals(2, modList.size());
    assertEquals("public", modList.get(0));
    assertEquals("static", modList.get(1));

    Map<String, String> genMap = msp.getGenerics();

    assertEquals(2, genMap.size());
    assertEquals(true, genMap.containsKey("T"));
    assertEquals(true, genMap.containsKey("U"));
    assertEquals("java.lang.Object", genMap.get("T"));
    assertEquals("java.lang.Object", genMap.get("U"));

    assertEquals("T[]", msp.getReturnType());

    assertEquals("copyOf", msp.getMemberName());

    List<String> paramTypes = msp.getParamTypes();

    assertEquals(3, paramTypes.size());
    assertEquals("U[]", paramTypes.get(0));
    assertEquals("int", paramTypes.get(1));
    assertEquals("java.lang.Class<? extends T[]>", paramTypes.get(2));
View Full Code Here

  @Test
  public void testSignatureWithGenericNoExtends()
  {
    String sig = "public static <T,U> T[] copyOf(U[], int, java.lang.Class<? extends T[]>)";

    MemberSignatureParts msp = MemberSignatureParts.fromBytecodeSignature("java.util.Arrays", sig);

    List<String> modList = msp.getModifiers();

    assertEquals(2, modList.size());
    assertEquals("public", modList.get(0));
    assertEquals("static", modList.get(1));

    Map<String, String> genMap = msp.getGenerics();

    assertEquals(2, genMap.size());
    assertEquals(true, genMap.containsKey("T"));
    assertEquals(true, genMap.containsKey("U"));
    assertEquals(null, genMap.get("T"));
    assertEquals(null, genMap.get("U"));

    assertEquals("T[]", msp.getReturnType());

    assertEquals("copyOf", msp.getMemberName());

    List<String> paramTypes = msp.getParamTypes();

    assertEquals(3, paramTypes.size());
    assertEquals("U[]", paramTypes.get(0));
    assertEquals("int", paramTypes.get(1));
    assertEquals("java.lang.Class<? extends T[]>", paramTypes.get(2));
View Full Code Here

  @Test
  public void testStaticInitialiserBytecode() throws Exception
  {
    String sigBC = "static {}";

    MemberSignatureParts mspBC = MemberSignatureParts.fromBytecodeSignature("java.lang.String", sigBC);

    List<String> modListBC = mspBC.getModifiers();
    assertEquals(0, modListBC.size());
    assertEquals(0, mspBC.getGenerics().size());
    assertEquals("void", mspBC.getReturnType());
    assertEquals(ParseUtil.STATIC_INIT, mspBC.getMemberName());
    assertEquals(0, mspBC.getParamTypes().size());
  }
View Full Code Here

TOP

Related Classes of org.adoptopenjdk.jitwatch.model.MemberSignatureParts

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.