Author: scabanovich
Date: 2011-03-25 13:22:53 -0400 (Fri, 25 Mar 2011)
New Revision: 30038
Modified:
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/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
JBIDE-8466
https://issues.jboss.org/browse/JBIDE-8466
Modified:
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 2011-03-25
17:20:59 UTC (rev 30037)
+++
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.3/jboss-esb-cbr.xml 2011-03-25
17:22:53 UTC (rev 30038)
@@ -19,6 +19,34 @@
<object-path
esb="body.'org.jboss.soa.esb.message.defaultEntry'" />
</property>
</action>
+ <action class="org.jboss.soa.esb.actions.MessageFilter"
name="message-filter">
+ <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>
+ <action class="org.jboss.soa.esb.actions.ContentBasedWiretap"
name="cb-wiretap">
+ <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>
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-25
17:20:59 UTC (rev 30037)
+++
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2011-03-25
17:22:53 UTC (rev 30038)
@@ -454,6 +454,40 @@
assertTrue(errorList.toString(), errorList.length() == 0);
}
+ public void testContentBasedWiretap() {
+ //Check that ContentBasedWiretap is treated in the same way as ContentBasedRouter
+ XModelObject object = getFileObject("esb-1.3", "jboss-esb-cbr.xml",
ESBConstants.ENT_ESB_FILE_130);
+
+ StringBuffer errorList = new StringBuffer();
+
+ String cbrWiretapPath = "Services/s/Actions/cb-wiretap";
+
+ String[][] orderDiscountRuleServiceAttrValues = {
+ {"cbr alias", "Drools"},
+ {"rule set", "/META-INF/drools/airport-code.drl"},
+ };
+ checkAttributes(object, cbrWiretapPath, orderDiscountRuleServiceAttrValues,
errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
+ public void testMessageFilter() {
+ //Check that MessageFilter is treated in the same way as ContentBasedRouter
+ XModelObject object = getFileObject("esb-1.3", "jboss-esb-cbr.xml",
ESBConstants.ENT_ESB_FILE_130);
+
+ StringBuffer errorList = new StringBuffer();
+
+ String cbrWiretapPath = "Services/s/Actions/message-filter";
+
+ String[][] orderDiscountRuleServiceAttrValues = {
+ {"cbr alias", "Drools"},
+ {"rule set", "/META-INF/drools/airport-code.drl"},
+ };
+ checkAttributes(object, cbrWiretapPath, orderDiscountRuleServiceAttrValues,
errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
XModelObject getFileObject(String parentPath, String xmlname) {
return getFileObject(parentPath, xmlname, ESBConstants.ENT_ESB_FILE_101);
}