[jboss-svn-commits] JBL Code SVN: r20766 - in labs/jbossesb/trunk/product/services/jbrules/src/test: resources and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jun 25 09:24:42 EDT 2008


Author: beve
Date: 2008-06-25 09:24:42 -0400 (Wed, 25 Jun 2008)
New Revision: 20766

Added:
   labs/jbossesb/trunk/product/services/jbrules/src/test/resources/5KB_message.xml
   labs/jbossesb/trunk/product/services/jbrules/src/test/resources/RulesWithDsl.drl
Modified:
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleServiceUnitTest.java
   labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml
Log:
Test for http://jira.jboss.com/jira/browse/JBESB-1504


Modified: labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleServiceUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleServiceUnitTest.java	2008-06-25 13:05:39 UTC (rev 20765)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleServiceUnitTest.java	2008-06-25 13:24:42 UTC (rev 20766)
@@ -24,15 +24,26 @@
 
 import static org.junit.Assert.*;
 
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.Date;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
 import junit.framework.JUnit4TestAdapter;
 import org.drools.RuleBase;
 import org.drools.agent.RuleAgent;
 import org.jboss.internal.soa.esb.services.routing.cbr.Order;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.actions.Counter;
 import org.jboss.soa.esb.lifecycle.LifecycleResourceException;
 import org.jboss.soa.esb.message.Message;
@@ -40,6 +51,7 @@
 import org.jboss.soa.esb.message.format.MessageType;
 import org.jboss.soa.esb.message.mapping.ObjectMapper;
 import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+import org.jboss.soa.esb.util.ClassUtil;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -129,6 +141,39 @@
 	}
 	
 	@Test
+	public void executeStatelessRulesDrlWithDsl() throws RuleServiceException, ConfigurationException, UnsupportedEncodingException
+	{
+		Message msg = MessageFactory.getInstance().getMessage();
+		InputStream resourceAsStream = ClassUtil.getResourceAsStream( "/" + "5KB_message.xml", getClass() );
+		String contents = StreamUtils.readStreamString( resourceAsStream, "UTF-8" );
+		msg.getBody().add( contents );
+		Map<String,Object> globals = getGlobalsWithDest();
+		boolean ruleReload = true;
+		
+		// first run
+		long startTime = System.nanoTime();
+		
+		message = ruleService.executeStatelessRules( "RulesWithDsl.drl", "XPathLanguage.dsl", ruleReload, msg, globals, null );
+		ArrayList<String> destinations = getDistinations( globals );
+		assertTrue( destinations.size() == 1 );
+		
+		long procTime = System.nanoTime() - startTime;
+		long firstRun = TimeUnit.NANOSECONDS.toMillis( procTime ) ;
+		System.out.println( "Timed First run : " +  firstRun + "ms" );
+		
+		// second run
+		startTime = System.nanoTime();
+		
+		message = ruleService.executeStatelessRules( "RulesWithDsl.drl", "XPathLanguage.dsl", ruleReload, msg, globals, null );
+		procTime = System.nanoTime() - startTime;
+		long secondRun = TimeUnit.NANOSECONDS.toMillis( procTime ) ;
+		System.out.println( "Timed Second run : " + secondRun + "ms" );
+		
+		destinations = getDistinations( globals );
+		assertTrue( destinations.size() == 2 );
+	}
+	
+	@Test
 	public void executeStatefulRulesContinueSession() throws RuleServiceException, ObjectMappingException
 	{
 		Message message = createMessageWithOrder( order );

Added: labs/jbossesb/trunk/product/services/jbrules/src/test/resources/5KB_message.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/resources/5KB_message.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/resources/5KB_message.xml	2008-06-25 13:24:42 UTC (rev 20766)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+	<Customer userName="user1" firstName="Harry" lastName="Fletcher" state="SD"/>
+	<OrderLines>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+	</OrderLines>
+</Order>

Added: labs/jbossesb/trunk/product/services/jbrules/src/test/resources/RulesWithDsl.drl
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/resources/RulesWithDsl.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/resources/RulesWithDsl.drl	2008-06-25 13:24:42 UTC (rev 20766)
@@ -0,0 +1,816 @@
+package com.jboss.soa.esb.routing.cbr
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import javax.xml.xpath.XPathExpression;
+
+expander XPathLanguage.dsl
+
+global java.util.List destinations;
+
+rule "ProductId1"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "1"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId2"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "2"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId3"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "3"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId4"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "4"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId5"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "5"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId6"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "6"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId7"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "7"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId8"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "8"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId9"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "9"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId10"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "10"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId11"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "11"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId12"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "12"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId13"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "13"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId14"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "14"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId15"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "15"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId16"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "16"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId17"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "17"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId18"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "18"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId19"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "19"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId20"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "20"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId21"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "21"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId22"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "22"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId23"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "23"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId24"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "24"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId25"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "25"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId26"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "26"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId27"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "27"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId28"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "28"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId29"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "29"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId30"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "30"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId31"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "31"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId32"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "32"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId33"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "33"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId34"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "34"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId35"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "35"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId36"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "36"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId37"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "37"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId38"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "38"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId39"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "39"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId40"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "40"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId41"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "41"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId42"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "42"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId43"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "43"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId44"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "44"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId45"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "45"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId46"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "46"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId47"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "47"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId48"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "48"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId49"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "49"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId50"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "50"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId51"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "51"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId52"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "52"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId53"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "53"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId54"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "54"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId55"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "55"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId56"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "56"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId57"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "57"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId58"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "58"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId59"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "59"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId60"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "60"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId61"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "61"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId62"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "62"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId63"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "63"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId64"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "64"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId65"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "65"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId66"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "66"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId67"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "67"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId68"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "68"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId69"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "69"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId70"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "70"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId71"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "71"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId72"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "72"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId73"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "73"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId74"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "74"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId75"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "75"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId76"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "76"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId77"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "77"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId78"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "78"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId79"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "79"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId80"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "80"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId81"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "81"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId82"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "82"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId83"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "83"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId84"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "84"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId85"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "85"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId86"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "86"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId87"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "87"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId88"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "88"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId89"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "89"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId90"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "90"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId91"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "91"
+	then
+		Destination : "regular1";
+end
+
+rule "ProductId92"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "92"
+	then
+		Destination : "regular2";
+end
+
+rule "ProductId93"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "93"
+	then
+		Destination : "regular3";
+end
+
+rule "ProductId94"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "94"
+	then
+		Destination : "regular4";
+end
+
+rule "ProductId95"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "95"
+	then
+		Destination : "regular5";
+end
+
+rule "ProductId96"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "96"
+	then
+		Destination : "regular6";
+end
+
+rule "ProductId97"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "97"
+	then
+		Destination : "regular7";
+end
+
+rule "ProductId98"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "98"
+	then
+		Destination : "regular8";
+end
+
+rule "ProductId99"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "99"
+	then
+		Destination : "regular9";
+end
+
+rule "ProductId299"
+	salience 100
+	when
+		xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "299"
+	then
+		Destination : "regular0";
+end
+
+rule "Default rule"
+	salience 1
+	when
+	then
+		Destination : "regular0";
+end

Modified: labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml	2008-06-25 13:05:39 UTC (rev 20765)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml	2008-06-25 13:24:42 UTC (rev 20766)
@@ -46,6 +46,11 @@
    <category name="org.jboss.soa.esb.actions">
       <priority value="ERROR"/>
    </category>
+   
+   <category name="org.jboss.internal.soa.esb.services.routing.cbr">
+      <priority value="info"/>
+   </category>
+   
    <category name="org.jboss.internal.soa.esb">
       <priority value="ERROR"/>
    </category>




More information about the jboss-svn-commits mailing list