[jboss-svn-commits] JBL Code SVN: r14724 - labs/jbossrules/trunk/experimental/drools-insurance/src/main/java/org/acme/insurance/base.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Aug 29 06:34:47 EDT 2007
Author: michael.neale at jboss.com
Date: 2007-08-29 06:34:46 -0400 (Wed, 29 Aug 2007)
New Revision: 14724
Modified:
labs/jbossrules/trunk/experimental/drools-insurance/src/main/java/org/acme/insurance/base/MVELTest.java
Log:
showing how to reproduce problem with MVEL
Modified: labs/jbossrules/trunk/experimental/drools-insurance/src/main/java/org/acme/insurance/base/MVELTest.java
===================================================================
--- labs/jbossrules/trunk/experimental/drools-insurance/src/main/java/org/acme/insurance/base/MVELTest.java 2007-08-29 10:12:03 UTC (rev 14723)
+++ labs/jbossrules/trunk/experimental/drools-insurance/src/main/java/org/acme/insurance/base/MVELTest.java 2007-08-29 10:34:46 UTC (rev 14724)
@@ -1,5 +1,6 @@
package org.acme.insurance.base;
+import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
@@ -23,23 +24,29 @@
public class MVELTest extends TestCase {
public void testHelloWorld() throws Exception {
+
+ String tempFile = "/Users/michaelneale/foo3.pkg";
+
// read in the source
+
final Reader reader = new InputStreamReader( getClass().getResourceAsStream( "mvel_test.drl" ) );
-// /* uncomment the block below to create a binary package to use the next time you run it */
+
+
+ /* uncomment the block below to create a binary package to use the next time you run it */
// Package pkg = loadPackage( reader );
//
//
//
-// FileOutputStream out = new FileOutputStream("/Users/michaelneale/foo2.pkg");
+// FileOutputStream out = new FileOutputStream(tempFile);
// ObjectOutputStream obj = new ObjectOutputStream( out );
// obj.writeObject( pkg );
// obj.close();
- ObjectInputStream in = new ObjectInputStream( new FileInputStream("/Users/michaelneale/foo2.pkg") );
+ ObjectInputStream in = new ObjectInputStream( new FileInputStream(tempFile) );
Package pkg2 = (Package) in.readObject();
// end of serialization block
@@ -59,19 +66,13 @@
workingMemory.insert( new Driver() );
workingMemory.fireAllRules();
-// assertEquals( 2, list.size() );
-// assertEquals( new Integer(30), list.get(0));
-// assertEquals( new Integer(22), list.get(1));
}
- public Object compiledExecute(String ex) {
- Serializable compiled = MVEL.compileExpression(ex);
- return MVEL.executeExpression(compiled, new Object(), new HashMap());
- }
+
private Package loadPackage(final Reader reader) throws DroolsParserException, Exception {
PackageBuilder builder = new PackageBuilder();
More information about the jboss-svn-commits
mailing list