null ) );
}
@Test
public void testSystemProperties() {
KnowledgeBuilderConfigurationImpl cfg;
JavaDialectConfiguration javaConf;
System.setProperty( "drools.dialect.java.compiler",
"JANINO" );
cfg = new KnowledgeBuilderConfigurationImpl();
javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
assertEquals( JavaDialectConfiguration.JANINO,
javaConf.getCompiler() );
KnowledgeBuilderConfigurationImpl cfg2 = new KnowledgeBuilderConfigurationImpl();
JavaDialectConfiguration javaConf2 = (JavaDialectConfiguration) cfg2.getDialectConfiguration( "java" );
assertEquals( javaConf.getCompiler(),
javaConf2.getCompiler() );
System.setProperty( "drools.dialect.java.compiler",
"ECLIPSE" );
cfg = new KnowledgeBuilderConfigurationImpl();
javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
assertEquals( JavaDialectConfiguration.ECLIPSE,
javaConf.getCompiler() );
javaConf2.setCompiler( JavaDialectConfiguration.ECLIPSE );
assertEquals( JavaDialectConfiguration.ECLIPSE,
javaConf2.getCompiler() );
javaConf2.setCompiler( JavaDialectConfiguration.JANINO );
assertEquals( JavaDialectConfiguration.JANINO,
javaConf2.getCompiler() );
final KnowledgeBuilderConfigurationImpl cfg3 = new KnowledgeBuilderConfigurationImpl();
JavaDialectConfiguration javaConf3 = (JavaDialectConfiguration) cfg3.getDialectConfiguration( "java" );
assertEquals( javaConf.getCompiler(),
javaConf3.getCompiler() );
}