# Byteman Rule for # org.drools.compiler.kie.builder.KieModuleRepoTest.artifactMapTest RULE store: 1rst thread set artifactMap wait CLASS org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo METHOD store AT WRITE $artifactMap 1 BIND threadName = Thread.currentThread().getName(); IF flag("first artifactMap check") DO # traceln(">>>> " + threadName + ": wait [after set artifactMap]"); waitFor("after set artifactMap"); flag("1"); ENDRULE RULE store: 2nd thread set ArtifactMap signal CLASS org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo METHOD store AFTER READ org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo.kieModules 2 BIND threadName = Thread.currentThread().getName(); IF flag("first kieModules.put") DO # traceln(">>>> " + threadName + ": signal [after set artifactMap]"); signalWake("after set artifactMap"); flag("2"); ENDRULE # -- # Check rules # -- RULE check thread actions CLASS org.drools.compiler.kie.builder.impl.KieModuleRepoTest METHOD checkRules AT ENTRY BIND threadName = Thread.currentThread().getName(); IF NOT ( flagged("0") || flagged("1") || flagged("2") ) DO throw new IllegalStateException("Not all rules were activated: " + flagged("1") + ", " + flagged("2") ); ENDRULE