[jboss-svn-commits] JBL Code SVN: r15782 - labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 11 20:25:05 EDT 2007
Author: mark.proctor at jboss.com
Date: 2007-10-11 20:25:04 -0400 (Thu, 11 Oct 2007)
New Revision: 15782
Modified:
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
Log:
JBRULES-1268 Activation.remove() is removing the WRONG activation when used in events
-removed test, as it's not valid.
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-10-12 00:22:08 UTC (rev 15781)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-10-12 00:25:04 UTC (rev 15782)
@@ -3047,64 +3047,6 @@
}
- public void FIXME_testActivationCancellation() throws Exception {
- PackageBuilder builder = new PackageBuilder();
- builder.addPackageFromDrl( new InputStreamReader(this.getClass().getResourceAsStream( "test_ActivationCancellation.drl" )) );
-
- assertFalse(builder.getErrors().toString(), builder.hasErrors());
- RuleBase rb = RuleBaseFactory.newRuleBase();
- rb.addPackage( builder.getPackage() );
-
-
-
- StatefulSession session = rb.newStatefulSession();
- List list = new ArrayList();
-
- //lets just remove the rule3 activation..
- session.addEventListener(new AgendaEventListener() {
-
- public void activationCancelled(ActivationCancelledEvent event, WorkingMemory workingMemory) {
- }
-
- public void activationCreated(ActivationCreatedEvent event, WorkingMemory workingMemory) {
- }
-
- public void afterActivationFired(AfterActivationFiredEvent event, WorkingMemory workingMemory) {
- }
-
- public void agendaGroupPopped(AgendaGroupPoppedEvent event, WorkingMemory workingMemory) {
- }
-
- public void agendaGroupPushed(AgendaGroupPushedEvent event, WorkingMemory workingMemory) {
- }
-
- public void beforeActivationFired(BeforeActivationFiredEvent event, WorkingMemory workingMemory) {
- if (event.getActivation().getRule().getName().equals("rule3")) {
- event.getActivation().remove();
- }
- }
-
- });
-
- session.setGlobal("list", list);
-
- session.insert(new Cheese());
- session.fireAllRules();
-
-
-
-
- //WTF? rule2 was removed.
- assertTrue(list.contains("rule1"));
- assertTrue(list.contains("rule2"));
- assertFalse(list.contains("rule3"));
-
-
-
-
-
- }
-
public void testMatchesNotMatchesCheese() throws Exception {
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_MatchesNotMatches.drl" ) ) );
More information about the jboss-svn-commits
mailing list