use of org.apache.synapse.commons.evaluators.source.HeaderTextRetriever in project wso2-synapse by wso2.
the class MatchBuilderTest method testHeaderMatch.
public void testHeaderMatch() {
String input = "<match type=\"header\" source=\"" + SOURCE + "\" regex=\"" + REGEX + "\"/>";
try {
MatchEvaluator eval = (MatchEvaluator) fac.create(AXIOMUtil.stringToOM(input));
SourceTextRetriever txtRtvr = eval.getTextRetriever();
assertTrue(txtRtvr instanceof HeaderTextRetriever);
assertEquals(txtRtvr.getSource(), SOURCE);
assertEquals(eval.getRegex().pattern(), REGEX);
} catch (Exception e) {
fail("Error while parsing the input XML");
}
}
use of org.apache.synapse.commons.evaluators.source.HeaderTextRetriever in project wso2-synapse by wso2.
the class EqualBuilderTest method testHeaderEqual.
public void testHeaderEqual() {
String input = "<equal type=\"header\" source=\"" + SOURCE + "\" value=\"" + VALUE + "\"/>";
try {
EqualEvaluator eval = (EqualEvaluator) fac.create(AXIOMUtil.stringToOM(input));
SourceTextRetriever txtRtvr = eval.getTextRetriever();
assertTrue(txtRtvr instanceof HeaderTextRetriever);
assertEquals(txtRtvr.getSource(), SOURCE);
assertEquals(eval.getValue(), VALUE);
} catch (Exception e) {
fail("Error while parsing the input XML");
}
}
Aggregations