}
@Test
public void testLoadDifferentFieldTypes() throws Exception {
SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n import org.drools.ide.common.server.rules.SomeFact",
new ArrayList(),
new ArrayList() );
assertNotNull( eng );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
eng.getFieldType( "SomeFact",
"age" ) );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
eng.getFieldType( "SomeFact",
"likes" ) );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
eng.getFieldType( "SomeFact",
"name" ) );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
eng.getFieldType( "SomeFact",
"bigDecimal" ) );
assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
eng.getFieldType( "SomeFact",
"alive" ) );
// assertEquals(SuggestionCompletionEngine.TYPE_COMPARABLE, eng.getFieldType( "SomeFact", "date"));
assertEquals( SuggestionCompletionEngine.TYPE_DATE,
eng.getFieldType( "SomeFact",
"date" ) );
assertEquals( "Cheese",
eng.getFieldType( "SomeFact",
"cheese" ) );
assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
eng.getFieldType( "SomeFact",
"dead" ) );
assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
eng.getFieldType( "SomeFact",
"alive" ) );
assertEquals( SuggestionCompletionEngine.TYPE_COLLECTION,
eng.getFieldType( "SomeFact",
"factList" ) );
assertEquals( "SomeFact",
eng.getParametricFieldType( "SomeFact",
"factList" ) );
assertEquals( SuggestionCompletionEngine.TYPE_COLLECTION,
eng.getFieldType( "SomeFact",
"factListString" ) );
assertEquals( "String",
eng.getParametricFieldType( "SomeFact",
"factListString" ) );
}