Package org.allspice.structured.statement

Examples of org.allspice.structured.statement.ExprStatement


public class TestSetField extends MyTestCase {
  public static interface BooleanSetFieldTest {
    public void meth(FieldTestClass arg0,boolean arg1) ;
  }
  public void test0() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"boolean_field",null),ARG1,null),null) ;
    BooleanSetFieldTest obj = makeObject(BooleanSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, true) ;
    assertEquals(o2.boolean_field,true) ;
    obj.meth(o2, false) ;
View Full Code Here


  }
  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

TOP

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

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.