use of org.apache.cayenne.exp.parser.PatternMatchNode in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_TwoChars_Mix.
@Test
public void testEscape_TwoChars_Mix() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "ab%c_");
LikeExpressionHelper.escape(node);
assertEquals("ab!%c!_", node.getOperand(1));
assertEquals('!', node.getEscapeChar());
}
use of org.apache.cayenne.exp.parser.PatternMatchNode in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_AltEscapeChar2.
@Test
public void testEscape_AltEscapeChar2() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "a!%c#_");
LikeExpressionHelper.escape(node);
assertEquals("a!$%c#$_", node.getOperand(1));
assertEquals('$', node.getEscapeChar());
}
use of org.apache.cayenne.exp.parser.PatternMatchNode in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_OneChar.
@Test
public void testEscape_OneChar() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "ab_c");
LikeExpressionHelper.escape(node);
assertEquals("ab!_c", node.getOperand(1));
assertEquals('!', node.getEscapeChar());
}
use of org.apache.cayenne.exp.parser.PatternMatchNode in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_NoEscapeChars.
@Test
public void testEscape_NoEscapeChars() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "abc");
LikeExpressionHelper.escape(node);
assertEquals("abc", node.getOperand(1));
assertEquals(0, node.getEscapeChar());
}
use of org.apache.cayenne.exp.parser.PatternMatchNode in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_TwoChars.
@Test
public void testEscape_TwoChars() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "ab_c_");
LikeExpressionHelper.escape(node);
assertEquals("ab!_c!_", node.getOperand(1));
assertEquals('!', node.getEscapeChar());
}
Aggregations