Package org.springsource.loaded.test.infra

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


    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "(I)V", 1);
    assertEquals(
        "visitVarInsn(ALOAD,1) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,java/lang/Integer) visitMethodInsn(INVOKEVIRTUAL,java/lang/Integer,intValue,()I)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "(Ljava/lang/String;Ljava/lang/Integer;)V", 2);
    assertEquals(
        "visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,java/lang/String) visitVarInsn(ALOAD,2) visitLdcInsn(1) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,java/lang/Integer)",
        fmv.getEvents());
    fmv.clearEvents();
View Full Code Here


    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "(Ljava/lang/String;Ljava/lang/Integer;)V", 2);
    assertEquals(
        "visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,java/lang/String) visitVarInsn(ALOAD,2) visitLdcInsn(1) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,java/lang/Integer)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "([Ljava/lang/String;)V", 2);
    assertEquals("visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,[Ljava/lang/String;)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "([[I)V", 2);
View Full Code Here

        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "([Ljava/lang/String;)V", 2);
    assertEquals("visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,[Ljava/lang/String;)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "([[I)V", 2);
    assertEquals("visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,[[I)", fmv.getEvents());
    fmv.clearEvents();
    try {
      Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "(Y)V", 1);
View Full Code Here

    assertEquals("visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,[Ljava/lang/String;)",
        fmv.getEvents());
    fmv.clearEvents();
    Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "([[I)V", 2);
    assertEquals("visitVarInsn(ALOAD,2) visitLdcInsn(0) visitInsn(AALOAD) visitTypeInsn(CHECKCAST,[[I)", fmv.getEvents());
    fmv.clearEvents();
    try {
      Utils.generateInstructionsToUnpackArrayAccordingToDescriptor(fmv, "(Y)V", 1);
      fail();
    } catch (IllegalStateException ise) {
    }
View Full Code Here

  @Test
  public void testReturning() {
    FakeMethodVisitor fmv = new FakeMethodVisitor();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeVoid, true);
    assertEquals("visitInsn(RETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeFloat, true);
    assertEquals("visitInsn(FRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeBoolean, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
View Full Code Here

    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeVoid, true);
    assertEquals("visitInsn(RETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeFloat, true);
    assertEquals("visitInsn(FRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeBoolean, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeShort, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
View Full Code Here

    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeFloat, true);
    assertEquals("visitInsn(FRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeBoolean, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeShort, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeLong, true);
    assertEquals("visitInsn(LRETURN)", fmv.getEvents());
View Full Code Here

    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeBoolean, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeShort, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeLong, true);
    assertEquals("visitInsn(LRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeDouble, true);
    assertEquals("visitInsn(DRETURN)", fmv.getEvents());
View Full Code Here

    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeShort, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeLong, true);
    assertEquals("visitInsn(LRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeDouble, true);
    assertEquals("visitInsn(DRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeChar, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
View Full Code Here

    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeLong, true);
    assertEquals("visitInsn(LRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeDouble, true);
    assertEquals("visitInsn(DRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeChar, true);
    assertEquals("visitInsn(IRETURN)", fmv.getEvents());
    fmv.clearEvents();
    Utils.addCorrectReturnInstruction(fmv, ReturnType.ReturnTypeByte, true);
    assertEquals("visitInsn(IRETURN)", 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.