Package org.springsource.loaded.test.infra

Examples of org.springsource.loaded.test.infra.FakeMethodVisitor.clearEvents()


  @Test
  public void testUnboxingNoCast() {
    FakeMethodVisitor fmv = new FakeMethodVisitor();
    Utils.insertUnboxInsns(fmv, 'F', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Float,floatValue,()F)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'Z', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Boolean,booleanValue,()Z)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'S', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)", fmv.getEvents());
View Full Code Here


    Utils.insertUnboxInsns(fmv, 'F', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Float,floatValue,()F)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'Z', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Boolean,booleanValue,()Z)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'S', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)", fmv.getEvents());
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'Z', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Boolean,booleanValue,()Z)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'S', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)", fmv.getEvents());
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'S', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'C', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Character,charValue,()C)", fmv.getEvents());
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'J', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'C', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Character,charValue,()C)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'B', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Byte,byteValue,()B)", fmv.getEvents());
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'D', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'C', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Character,charValue,()C)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'B', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Byte,byteValue,()B)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'I', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)", fmv.getEvents());
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'C', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Character,charValue,()C)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'B', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Byte,byteValue,()B)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'I', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)", fmv.getEvents());
    fmv.clearEvents();
  }
View Full Code Here

    Utils.insertUnboxInsns(fmv, 'B', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Byte,byteValue,()B)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'I', false);
    assertEquals("visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)", fmv.getEvents());
    fmv.clearEvents();
  }

  /**
   * Check the sequence of instructions created for an unbox (no cast)
   */
 
View Full Code Here

  @Test
  public void testBoxing() {
    FakeMethodVisitor fmv = new FakeMethodVisitor();
    Utils.insertBoxInsns(fmv, 'F');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Float,valueOf,(F)Ljava/lang/Float;)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertBoxInsns(fmv, 'Z');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Boolean,valueOf,(Z)Ljava/lang/Boolean;)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertBoxInsns(fmv, 'S');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Short,valueOf,(S)Ljava/lang/Short;)", fmv.getEvents());
View Full Code Here

    Utils.insertBoxInsns(fmv, 'F');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Float,valueOf,(F)Ljava/lang/Float;)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertBoxInsns(fmv, 'Z');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Boolean,valueOf,(Z)Ljava/lang/Boolean;)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertBoxInsns(fmv, 'S');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Short,valueOf,(S)Ljava/lang/Short;)", fmv.getEvents());
    fmv.clearEvents();
    Utils.insertBoxInsns(fmv, 'J');
    assertEquals("visitMethodInsn(INVOKESTATIC,java/lang/Long,valueOf,(J)Ljava/lang/Long;)", fmv.getEvents());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.