[rules-users] Guvnor Test Scenario - value equality

Libor Nenadál libor.nenadal at gmail.com
Fri Nov 13 09:18:56 EST 2009


OK, below is the rule source. But it seems that rule is ok, because it does
copy field values. But when I try to compare them to the expected values
then the test fails.

when
	$tr : TransactionRecord( $accNum : otherPartyAccountNumber,
	                         $accSuffix : otherPartyAccountSuffix,
	not TransactionBatch( otherPartyAccountNumber == ( $accNum ),
	                      otherPartyAccountSuffix == ( $accSuffix ) )
then
	TransactionBatch fact0 = new TransactionBatch();
	fact0.setOtherPartyAccountNumber( $accNum );
	fact0.setOtherPartyAccountSuffix( $accSuffix );

	insert(fact0 );


Anstis, Michael (M.) wrote:
> 
> Please attach your (rule) source.
>  
> You don't provide much for the community to go on.
> 
> 
> ________________________________
> 
> 	From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Libor Nenadál
> 	Sent: 13 November 2009 13:59
> 	To: rules-users at lists.jboss.org
> 	Subject: [rules-users] Guvnor Test Scenario - value equality
> 	
> 	
> 	Hello, I came to a problem when scenario fails because field values do
> not equal to those expected although they actually do. Here is the result
> after scenario run: 
> 	[TransactionBatch] field [otherPartyAccountNumber] was [12345678]
> expected [12345678].
> 	[TransactionBatch] field [otherPartyAccountSuffix] was [1234].
> 	Both fields are of int type and the first does not match although it
> should. Can you please point me to where the problem can be? Thank you,
> Libor 
> 	
> ________________________________
> 
> 	View this message in context: Guvnor Test Scenario - value equality
> <http://old.nabble.com/Guvnor-Test-Scenario---value-equality-tp26336990p26336990.html> 
> 	Sent from the drools - user mailing list archive
> <http://old.nabble.com/drools---user-f11823.html>  at Nabble.com.
> 	
> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://old.nabble.com/Guvnor-Test-Scenario---value-equality-tp26336990p26337293.html
Sent from the drools - user mailing list archive at Nabble.com.





More information about the rules-users mailing list