@Test
public void testMockDialect() {
InternalKnowledgePackage pkg = new KnowledgePackageImpl( "org.pkg1" );
KnowledgeBuilderConfigurationImpl cfg1 = new KnowledgeBuilderConfigurationImpl();
MockDialectConfiguration mockConf = new MockDialectConfiguration();
// cfg1.buildDialectRegistry().addDialect( "mock",
// mockConf.getDialect() );
cfg1.addDialect( "mock",
mockConf );
cfg1.setDefaultDialect( "mock" );
KnowledgeBuilderImpl builder = new KnowledgeBuilderImpl( pkg, cfg1 );
PackageRegistry pkgRegistry = builder.getPackageRegistry( pkg.getName() );
DialectCompiletimeRegistry dialectRegistry = pkgRegistry.getDialectCompiletimeRegistry();
MockDialect mockDialect2 = (MockDialect) dialectRegistry.getDialect( cfg1.getDefaultDialect() );
assertSame( pkg,
mockDialect2.getPkg() );
assertNull( mockDialect2.getRuleDescr() );