* These are the examples found in the JMS 1.1. specification
*/
public void testLikeOpWrapper() {
try {
String pattern = "12%3";
LikeOpWrapper wrapper = new LikeOpWrapper(this.glob, pattern);
assertEquals("wrong result with pattern '" + pattern + "' for '123'", true, wrapper.match("123"));
assertEquals("wrong result with pattern '" + pattern + "' for '12993'", true, wrapper.match("12993"));
assertEquals("wrong result with pattern '" + pattern + "' for '1234'", false, wrapper.match("1234"));
pattern = "l_se";
wrapper = new LikeOpWrapper(this.glob, pattern);
assertEquals("wrong result with pattern '" + pattern + "' for 'lose'", true, wrapper.match("lose"));
assertEquals("wrong result with pattern '" + pattern + "' for 'loose'", false, wrapper.match("loose"));
pattern = "\\_%";
wrapper = new LikeOpWrapper(this.glob, pattern, '\\');
assertEquals("wrong result with pattern '" + pattern + "' for '_foo'", true, wrapper.match("_foo"));
assertEquals("wrong result with pattern '" + pattern + "' for 'bar'", false, wrapper.match("bar"));
}
catch (XmlBlasterException ex) {
ex.printStackTrace();
assertTrue("an exception should not occur here " + ex.getMessage(), false);