package net.folab.fo.runtime;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import java.lang.reflect.Field;

import org.junit.Test;
import org.junit.Before;

public class GeneratedCodeTest {

    private Class<?> genClass;

    @Before
    public void setUp() throws ClassNotFoundException {
        genClass = Class.forName("net.folab.fo.runtime._");
    }

    @Test
    public void test() throws SecurityException, NoSuchFieldException,
            IllegalArgumentException, IllegalAccessException {

        test("_a", "1");
        test("_b", "2");
        test("_c", "3");
        test("_d", "4");
        test("_e", "5");
        test("_f", "false");
        test("_t", "true");

    }

    public void test(String name, String string) throws NoSuchFieldException,
            IllegalAccessException {
        Field field = genClass.getField(name);
        Evaluable<?> value = (Evaluable<?>) field.get(null);
        assertThat(value.evaluate().toString(), is(string));
    }

}

@@ -135,16 +135,111 @@
 Field;%0A%0A
+import net.folab.fo.runtime._fo._lang.Boolean;%0Aimport net.folab.fo.runtime._fo._lang.Integer;%0A%0A
 import o
@@ -648,11 +648,26 @@
 a%22, 
-%221%22
+Integer.valueOf(1)
 );%0A 
@@ -688,11 +688,26 @@
 b%22, 
-%222%22
+Integer.valueOf(2)
 );%0A 
@@ -728,11 +728,26 @@
 c%22, 
-%223%22
+Integer.valueOf(3)
 );%0A 
@@ -768,11 +768,26 @@
 d%22, 
-%224%22
+Integer.valueOf(4)
 );%0A 
@@ -808,11 +808,26 @@
 e%22, 
-%225%22
+Integer.valueOf(5)
 );%0A 
@@ -848,15 +848,21 @@
 f%22, 
-%22false%22
+Boolean.FALSE
 );%0A 
@@ -883,14 +883,20 @@
 t%22, 
-%22true%22
+Boolean.TRUE
 );%0A%0A
@@ -917,45 +917,90 @@
 lic 
-void test(String name, String string)
+%3CT extends Evaluable%3CT%3E%3E void test(String name, Evaluable%3CT%3E expected)%0A           
  thr
@@ -1020,36 +1020,24 @@
 ldException,
-%0A           
  IllegalAcce
@@ -1097,16 +1097,55 @@
 (name);%0A
+        @SuppressWarnings(%22unchecked%22)%0A
         
@@ -1154,17 +1154,17 @@
 aluable%3C
-?
+T
 %3E value 
@@ -1176,17 +1176,17 @@
 aluable%3C
-?
+T
 %3E) field
@@ -1236,30 +1236,21 @@
 te()
-.toString(), is(string
+, is(expected
 ));%0A

Update test code to compare with real type rather than string value.