Package org.allspice.structured.statement

Examples of org.allspice.structured.statement.ExprStatement


public class TestSetStaticField extends MyTestCase {
  public static interface BooleanSetFieldTest {
    public void meth(boolean arg1) ;
  }
  public void test0() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","boolean_field",null),ARG0,null),null) ;
    BooleanSetFieldTest obj = makeObject(BooleanSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(true) ;
    assertEquals(StaticFieldTestClass.boolean_field,true) ;
    obj.meth(false) ;
View Full Code Here


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

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

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

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

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

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

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

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

  }
  public static interface ArrSetFieldTest {
    public void meth(Object[] arg1) ;
  }
  public void test10() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","arr_field",null),ARG0,null),null) ;
    ObjectSetFieldTest obj = makeObject(ObjectSetFieldTest.class,st,new ReturnStatement(null)) ;
    Object[] arr = new Object[5] ;
    obj.meth(arr) ;
    assertEquals(StaticFieldTestClass.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.