}
@Test
public void testSystemProperties() {
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration();
JavaDialectConfiguration javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
assertEquals( JavaDialectConfiguration.ECLIPSE,
javaConf.getCompiler() );
System.setProperty( "drools.dialect.java.compiler",
"JANINO" );
cfg = new PackageBuilderConfiguration();
javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
assertEquals( JavaDialectConfiguration.JANINO,
javaConf.getCompiler() );
PackageBuilderConfiguration cfg2 = new PackageBuilderConfiguration();
JavaDialectConfiguration javaConf2 = (JavaDialectConfiguration) cfg2.getDialectConfiguration( "java" );
assertEquals( javaConf.getCompiler(),
javaConf2.getCompiler() );
System.setProperty( "drools.dialect.java.compiler",
"ECLIPSE" );
cfg = new PackageBuilderConfiguration();
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 PackageBuilderConfiguration cfg3 = new PackageBuilderConfiguration();
JavaDialectConfiguration javaConf3 = (JavaDialectConfiguration) cfg3.getDialectConfiguration( "java" );
assertEquals( javaConf.getCompiler(),
javaConf3.getCompiler() );
}