Author: scabanovich
Date: 2011-03-22 19:56:50 -0400 (Tue, 22 Mar 2011)
New Revision: 29961
Modified:
branches/jbosstools-3.2.x/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
Modified:
branches/jbosstools-3.2.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
---
branches/jbosstools-3.2.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2011-03-22
23:45:42 UTC (rev 29960)
+++
branches/jbosstools-3.2.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2011-03-22
23:56:50 UTC (rev 29961)
@@ -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);
}