Author: scabanovich
Date: 2011-03-22 19:30:59 -0400 (Tue, 22 Mar 2011)
New Revision: 29958
Added:
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml
Modified:
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
JBIDE-8608
https://issues.jboss.org/browse/JBIDE-8608
Added:
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml
(rev 0)
+++
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml 2011-03-22
23:30:59 UTC (rev 29958)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<jbossesb
+
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trun...
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schem...
+ <services>
+ <service category="c" description="d" name="s">
+ <actions>
+ <action class="org.jboss.soa.esb.actions.ContentBasedRouter"
name="cbr-router">
+ <property name="cbrAlias" value="Drools"/>
+ <property name="ruleSet"
value="/META-INF/drools/airport-code.drl"/>
+ <property name="ruleLanguage"/>
+ <property name="destinations">
+ <route-to destination-name="ERROR"
+ service-category="com.example.soa"
service-name="error-service"/>
+ <route-to destination-name="SUCCESS"
+ service-category="com.example.soa"
service-name="successful-record"/>
+ </property>
+ <property name="object-paths">
+ <object-path
esb="body.'org.jboss.soa.esb.message.defaultEntry'" />
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Property changes on:
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
---
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2011-03-22
23:30:11 UTC (rev 29957)
+++
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2011-03-22
23:30:59 UTC (rev 29958)
@@ -423,6 +423,37 @@
assertTrue(errorList.toString(), errorList.length() == 0);
}
+ public void testContentBasedRouter() {
+ XModelObject object = getFileObject("esb-1.3", "jboss-esb-cbr.xml",
ESBConstants.ENT_ESB_FILE_130);
+
+ StringBuffer errorList = new StringBuffer();
+
+ // 1. Drools
+ String cbrRouterPath = "Services/s/Actions/cbr-router";
+
+ String[][] orderDiscountRuleServiceAttrValues = {
+ {"cbr alias", "Drools"},
+ {"rule set", "/META-INF/drools/airport-code.drl"},
+ };
+ checkAttributes(object, cbrRouterPath, orderDiscountRuleServiceAttrValues, errorList);
+
+ String objectPath = cbrRouterPath +
"/body.'org.jboss.soa.esb.message.defaultEntry'";
+ String[][] objectAttrValues = {
+ {"esb", "body.'org.jboss.soa.esb.message.defaultEntry'"},
+ };
+ checkAttributes(object, objectPath, objectAttrValues, errorList);
+
+ String routePath = cbrRouterPath + "/error-service";
+ String[][] routeAttrValues = {
+ {"service name", "error-service"},
+ {"service category", "com.example.soa"},
+ {"destination name", "ERROR"},
+ };
+ checkAttributes(object, routePath, routeAttrValues, errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
XModelObject getFileObject(String parentPath, String xmlname) {
return getFileObject(parentPath, xmlname, ESBConstants.ENT_ESB_FILE_101);
}