Hi Hui Onn,

You are right! I just downloaded 5.1.0 final. The test case passed without any problem when it run with 5.1.0 final.

Thank you.

Regards,
Chee Kin


On Mon, Aug 16, 2010 at 11:25 PM, Tan Hui Onn <huionn@gmail.com> wrote:
Are the test cases failed because of
java.lang.NullPointerException
       at org.drools.command.runtime.BatchExecutionCommand.execute(BatchExecutionCommand.java:142)
       at org.drools.command.runtime.BatchExecutionCommand.execute(BatchExecutionCommand.java:1)
       at org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:239)
       at droolsbook.bank.service.impl.ValidationTest.assertReportContains(ValidationTest.java:97)
       at droolsbook.bank.service.impl.ValidationTest.studentAccountCustomerAgeLessThan(ValidationTest.java:219)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       ......
?

I checked the source of CommandFactoryProviderImpl (5.1.0.CR1) and found this
       public Command newInsertElements(Iterable objects) {
//              TODO: FIX THIS
//              return new InsertElementsCommand(objects);
               return null;
       }

But it has been fixed in 5.1 FINAL.


2010/8/16 Chee Kin Lim <limcheekin@vobject.com>:
> Hi,
>
> I am new to Drools and learning it by reading "Drools JBoss Rules 5.0
> Developer's Guide" at the moment.
>
> However, the test cases of chapter 3 was failed when execute with Drools
> 5.1.0.CR1.
>
> I suspect the test is broken due to the sequential option enabled with code
> block below:
>     KnowledgeBaseConfiguration configuration =
>       KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
>     configuration.setOption(SequentialOption.YES);
> You can view the complete code at
> http://code.google.com/p/droolsbook/source/browse/trunk/droolsBookParent/validation/src/test/java/droolsbook/bank/service/impl/ValidationTest.java
>
> Is this code block compatible with Drools 5.1? As it is working without any
> problem in 5.0.1.
>
> If it is incompatible, I would like to know how to migrate it to Drools
> 5.1.0.
>
> Please advice.
>
> Thanks,
> Chee Kin
>
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users