Package org.allspice.structured.statement

Examples of org.allspice.structured.statement.ReturnStatement


  public static interface ByteSetFieldTest {
    public void meth(FieldTestClass arg0,byte arg1) ;
  }
  public void test1() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"byte_field",null),ARG1,null),null) ;
    ByteSetFieldTest obj = makeObject(ByteSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, (byte)45) ;
    assertEquals(o2.byte_field,(byte)45) ;
  }
View Full Code Here


  public static interface ShortSetFieldTest {
    public void meth(FieldTestClass arg0,short arg1) ;
  }
  public void test2() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"short_field",null),ARG1,null),null) ;
    ShortSetFieldTest obj = makeObject(ShortSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, (short)45) ;
    assertEquals(o2.short_field,(short)45) ;
  }
View Full Code Here

  public static interface CharSetFieldTest {
    public void meth(FieldTestClass arg0,char arg1) ;
  }
  public void test3() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"char_field",null),ARG1,null),null) ;
    CharSetFieldTest obj = makeObject(CharSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, (char)45) ;
    assertEquals(o2.char_field,(char)45) ;
  }
View Full Code Here

  public static interface IntSetFieldTest {
    public void meth(FieldTestClass arg0,int arg1) ;
  }
  public void test5() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"int_field",null),ARG1,null),null) ;
    IntSetFieldTest obj = makeObject(IntSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5) ;
    assertEquals(o2.int_field,5) ;
  }
View Full Code Here

  public static interface FloatSetFieldTest {
    public void meth(FieldTestClass arg0,float arg1) ;
  }
  public void test6() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"float_field",null),ARG1,null),null) ;
    FloatSetFieldTest obj = makeObject(FloatSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5F) ;
    assertTrue(o2.float_field == 5F) ;
  }
View Full Code Here

  public static interface LongSetFieldTest {
    public void meth(FieldTestClass arg0,long arg1) ;
  }
  public void test7() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"long_field",null),ARG1,null),null) ;
    LongSetFieldTest obj = makeObject(LongSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5L) ;
    assertEquals(o2.long_field,5L) ;
  }
View Full Code Here

  public static interface DoubleSetFieldTest {
    public void meth(FieldTestClass arg0,double arg1) ;
  }
  public void test8() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"double_field",null),ARG1,null),null) ;
    DoubleSetFieldTest obj = makeObject(DoubleSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5D) ;
    assertTrue(o2.double_field == 5D) ;
  }
View Full Code Here

  public static interface ObjectSetFieldTest {
    public void meth(FieldTestClass arg0,Object arg1) ;
  }
  public void test9() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"obj_field",null),ARG1,null),null) ;
    ObjectSetFieldTest obj = makeObject(ObjectSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, "abc") ;
    assertEquals(o2.obj_field,"abc") ;
  }
View Full Code Here

  public static interface ArrSetFieldTest {
    public void meth(FieldTestClass arg0,Object[] arg1) ;
  }
  public void test10() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"arr_field",null),ARG1,null),null) ;
    ObjectSetFieldTest obj = makeObject(ObjectSetFieldTest.class,st,new ReturnStatement(null)) ;
    Object[] arr = new Object[5] ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, arr) ;
    assertEquals(o2.arr_field,arr) ;
  }
View Full Code Here

    public void meth(byte[] arg0,int arg1,byte arg2) ;
    public void meth(short[] arg0,int arg1,short arg2) ;
  }
  public void test0() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new ArrVarExpr(ARG0,ARG1,null),ARG2,null),null) ;
    SetArrTestInt obj = makeObject(SetArrTestInt.class,st,new ReturnStatement(null)) ;
    {
      int[] arr = new int[4] ;
      obj.meth(arr,2,42) ;
      assertTrue(arr[2] == 42) ;
    }
View Full Code Here

TOP

Related Classes of org.allspice.structured.statement.ReturnStatement

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.