[jboss-svn-commits] JBL Code SVN: r13496 - in labs/jbossrules/trunk: drools-compiler/src/test/resources/org/drools/integrationtests and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jul 14 09:45:04 EDT 2007
Author: tirelli
Date: 2007-07-14 09:45:03 -0400 (Sat, 14 Jul 2007)
New Revision: 13496
Modified:
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java
labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_AccumulateMVEL.drl
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
Log:
JBRULES-1002: adding more tests
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java 2007-07-14 13:21:02 UTC (rev 13495)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java 2007-07-14 13:45:03 UTC (rev 13496)
@@ -57,7 +57,7 @@
return ruleBase;
}
- public void xxxtestAccumulateModify() throws Exception {
+ public void testAccumulateModify() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateModify.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -125,7 +125,7 @@
}
- public void xxxtestAccumulate() throws Exception {
+ public void testAccumulate() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_Accumulate.drl" ) );
@@ -189,19 +189,19 @@
wm.fireAllRules();
-// Assert.assertEquals( new Integer( 165 ),
-// results.get( 0 ) );
-// Assert.assertEquals( new Integer( 10 ),
-// results.get( 1 ) );
+ Assert.assertEquals( new Integer( 165 ),
+ results.get( 0 ) );
+ Assert.assertEquals( new Integer( 10 ),
+ results.get( 1 ) );
Assert.assertEquals( new Integer( 150 ),
- results.get( 0 ) );
-// Assert.assertEquals( new Integer( 10 ),
-// results.get( 3 ) );
-// Assert.assertEquals( new Integer( 210 ),
-// results.get( 4 ) );
+ results.get( 2 ) );
+ Assert.assertEquals( new Integer( 10 ),
+ results.get( 3 ) );
+ Assert.assertEquals( new Integer( 210 ),
+ results.get( 4 ) );
}
- public void xxxtestAccumulateModifyMVEL() throws Exception {
+ public void testAccumulateModifyMVEL() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateModifyMVEL.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -269,7 +269,7 @@
}
- public void xxxtestAccumulateReverseModify() throws Exception {
+ public void testAccumulateReverseModify() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateReverseModify.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -337,7 +337,7 @@
}
- public void xxxtestAccumulateReverseModifyMVEL() throws Exception {
+ public void testAccumulateReverseModifyMVEL() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateReverseModifyMVEL.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -405,7 +405,7 @@
}
- public void xxxtestAccumulateAverage() throws Exception {
+ public void testAccumulateAverage() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateAverage.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -474,7 +474,7 @@
}
- public void xxxtestAccumulateMax() throws Exception {
+ public void testAccumulateMax() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateMax.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -543,7 +543,7 @@
}
- public void xxxtestAccumulateMin() throws Exception {
+ public void testAccumulateMin() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateMin.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -612,7 +612,7 @@
}
- public void xxxtestAccumulateCount() throws Exception {
+ public void testAccumulateCount() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateCount.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -682,7 +682,7 @@
}
- public void xxxtestAccumulateWithFromChaining() throws Exception {
+ public void testAccumulateWithFromChaining() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateWithFromChaining.drl" ) );
final RuleBase ruleBase = loadRuleBase( reader );
@@ -757,7 +757,7 @@
}
- public void xxxtestMVELAccumulate2WM() throws Exception {
+ public void testMVELAccumulate2WM() throws Exception {
// read in the source
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "test_AccumulateMVEL.drl" ) );
@@ -781,27 +781,27 @@
wm1.insert( new Person( "Mark",
"provolone" ) );
- // wm2.insert( new Person( "Bob",
- // "stilton",
- // 20 ) );
- // wm2.insert( new Person( "Mark",
- // "provolone" ) );
+ wm2.insert( new Person( "Bob",
+ "stilton",
+ 20 ) );
+ wm2.insert( new Person( "Mark",
+ "provolone" ) );
wm1.insert( new Cheese( "stilton",
10 ) );
wm1.insert( new Cheese( "brie",
5 ) );
- // wm2.insert( new Cheese( "stilton",
- // 10 ) );
+ wm2.insert( new Cheese( "stilton",
+ 10 ) );
wm1.insert( new Cheese( "provolone",
150 ) );
- // wm2.insert( new Cheese( "brie",
- // 5 ) );
- // wm2.insert( new Cheese( "provolone",
- // 150 ) );
+ wm2.insert( new Cheese( "brie",
+ 5 ) );
+ wm2.insert( new Cheese( "provolone",
+ 150 ) );
wm1.fireAllRules();
- // wm2.fireAllRules();
+ wm2.fireAllRules();
Assert.assertEquals( new Integer( 165 ),
results1.get( 0 ) );
Modified: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_AccumulateMVEL.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_AccumulateMVEL.drl 2007-07-14 13:21:02 UTC (rev 13495)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_AccumulateMVEL.drl 2007-07-14 13:45:03 UTC (rev 13496)
@@ -6,7 +6,7 @@
global java.util.List results;
-/*rule "AccumulateTest" salience 100
+rule "AccumulateTest" salience 100
dialect "mvel"
when
$totalAmount : Integer() from accumulate( $cheese : Cheese( ),
@@ -27,7 +27,7 @@
result( total ) )
then
results.add($totalAmount);
-end*/
+end
rule "Constraints everywhere" salience 80
dialect "mvel"
@@ -42,7 +42,7 @@
results.add($cheesery.getTotalAmount());
end
-/*rule "Source pattern binds" salience 70
+rule "Source pattern binds" salience 70
dialect "mvel"
when
$person : Person( name == "Bob", $likes : likes )
@@ -65,4 +65,4 @@
then
results.add($totalAmount);
end
-*/
+
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2007-07-14 13:21:02 UTC (rev 13495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2007-07-14 13:45:03 UTC (rev 13496)
@@ -881,7 +881,10 @@
this.addRemovePropertyChangeListenerArgs );
}
} catch ( final NoSuchMethodException e ) {
- throw new RuntimeDroolsException( "The removePropertyChangeListener method on the class was not found so Drools will be unable to stop processing JavaBean PropertyChangeEvents on the retracted Object." );
+ // The removePropertyChangeListener method on the class
+ // was not found so Drools will be unable to
+ // stop processing JavaBean PropertyChangeEvents
+ // on the retracted Object
} catch ( final IllegalArgumentException e ) {
throw new RuntimeDroolsException( "Warning: The removePropertyChangeListener method on the class " + object.getClass() + " does not take a simple PropertyChangeListener argument so Drools will be unable to stop processing JavaBean"
+ " PropertyChangeEvents on the retracted Object" );
More information about the jboss-svn-commits
mailing list