Package org.springsource.loaded.test.infra

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


    FakeMethodVisitor fmv = new FakeMethodVisitor();
    // First variant checks passing string rather than just one char
    Utils.insertUnboxInsnsIfNecessary(fmv, "F", true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Float) visitMethodInsn(INVOKEVIRTUAL,java/lang/Float,floatValue,()F)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'F', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Float) visitMethodInsn(INVOKEVIRTUAL,java/lang/Float,floatValue,()F)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'Z', true);
View Full Code Here


        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'F', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Float) visitMethodInsn(INVOKEVIRTUAL,java/lang/Float,floatValue,()F)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'Z', true);
    assertEquals(
        "visitTypeInsn(CHECKCAST,java/lang/Boolean) visitMethodInsn(INVOKEVIRTUAL,java/lang/Boolean,booleanValue,()Z)",
        fmv.getEvents());
    fmv.clearEvents();
View Full Code Here

    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'Z', true);
    assertEquals(
        "visitTypeInsn(CHECKCAST,java/lang/Boolean) visitMethodInsn(INVOKEVIRTUAL,java/lang/Boolean,booleanValue,()Z)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'S', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Short) visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', true);
View Full Code Here

        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'S', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Short) visitMethodInsn(INVOKEVIRTUAL,java/lang/Short,shortValue,()S)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Long) visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', true);
View Full Code Here

        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'J', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Long) visitMethodInsn(INVOKEVIRTUAL,java/lang/Long,longValue,()J)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Double) visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'C', true);
View Full Code Here

        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'D', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Double) visitMethodInsn(INVOKEVIRTUAL,java/lang/Double,doubleValue,()D)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'C', true);
    assertEquals(
        "visitTypeInsn(CHECKCAST,java/lang/Character) visitMethodInsn(INVOKEVIRTUAL,java/lang/Character,charValue,()C)",
        fmv.getEvents());
    fmv.clearEvents();
View Full Code Here

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

        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'B', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Byte) visitMethodInsn(INVOKEVIRTUAL,java/lang/Byte,byteValue,()B)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'I', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Integer) visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)",
        fmv.getEvents());
    fmv.clearEvents();
View Full Code Here

        fmv.getEvents());
    fmv.clearEvents();
    Utils.insertUnboxInsns(fmv, 'I', true);
    assertEquals("visitTypeInsn(CHECKCAST,java/lang/Integer) visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)",
        fmv.getEvents());
    fmv.clearEvents();

    Utils.insertUnboxInsnsIfNecessary(fmv, "Rubbish", true);
    // should be a nop as nothing to do
    assertEquals(0, fmv.getEvents().length());
    fmv.clearEvents();
View Full Code Here

    fmv.clearEvents();

    Utils.insertUnboxInsnsIfNecessary(fmv, "Rubbish", true);
    // should be a nop as nothing to do
    assertEquals(0, fmv.getEvents().length());
    fmv.clearEvents();

    try {
      Utils.insertUnboxInsns(fmv, '[', true);
      Assert.fail("Should have blown up due to invalid primitive being passed in");
    } catch (IllegalArgumentException iae) {
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.