[jboss-svn-commits] JBL Code SVN: r10323 - in labs/jbossrules/trunk/drools-compiler/src/test: resources/org/drools/integrationtests and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Mar 18 20:40:45 EDT 2007


Author: michael.neale at jboss.com
Date: 2007-03-18 20:40:45 -0400 (Sun, 18 Mar 2007)
New Revision: 10323

Modified:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_NullHandling.drl
Log:
slight improved test coverage for nulls

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java	2007-03-18 23:39:42 UTC (rev 10322)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java	2007-03-19 00:40:45 UTC (rev 10323)
@@ -184,14 +184,20 @@
         Cheese nullCheese = new Cheese(null, 2);
         workingMemory.assertObject( nullCheese );
 
-        Person nullPerson = new Person("shoes butt back");
-        nullPerson.setBigDecimal( new BigDecimal("42.42") );
+        Person notNullPerson = new Person("shoes butt back");
+        notNullPerson.setBigDecimal( new BigDecimal("42.42") );
         
+        workingMemory.assertObject( notNullPerson );
+        
+        Person nullPerson = new Person("whee");
+        nullPerson.setBigDecimal( null );
+        
         workingMemory.assertObject( nullPerson );
         
+        
         workingMemory.fireAllRules();
         System.out.println(list.get( 0 ));
-        assertEquals( 2, list.size() );
+        assertEquals( 3, list.size() );
         
         
     }

Modified: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_NullHandling.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_NullHandling.drl	2007-03-18 23:39:42 UTC (rev 10322)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_NullHandling.drl	2007-03-19 00:40:45 UTC (rev 10323)
@@ -17,4 +17,11 @@
 		Person( bigDecimal != null )
     then 
     	list.add( new Integer(6) );
-end    	
\ No newline at end of file
+end   
+
+rule "number not null"
+    when
+     	Person( name== "whee", bigDecimal != 3 )
+    then
+    	list.add( new Integer(7) );
+end     	
\ No newline at end of file




More information about the jboss-svn-commits mailing list