Examples of MatchExpressionParser


Examples of org.jpox.store.mapped.expression.MatchExpressionParser

{
    public void testParsePattern()
    {
        //testZZteteAAyyy.dede\--
        String str = "test.*tete.yyy\\.dede\\\\--";
        MatchExpressionParser parser = new MatchExpressionParser(str,'Z','A','\\');
        String parsed = parser.parsePattern();
        String str_correct = "testZteteAyyy.dede\\\\\\\\--";
        assertTrue("Parsing mised expression gave erroneous string : " + parsed + " but should have been " + str_correct,parsed.equals(str_correct));

        // Empty string
        MatchExpressionParser parser2 = new MatchExpressionParser("",'Z','A','\\');
        assertEquals("",parser2.parsePattern());

        // Any character
        str = ".output.";
        MatchExpressionParser parser3 = new MatchExpressionParser(".putput.",'Z','A','\\');
        parsed = parser3.parsePattern();
        str_correct = "AputputA";
        assertEquals(str_correct, parsed);

        // "slash\city"
        str = "\"slash\\city\"";
        MatchExpressionParser parser4 = new MatchExpressionParser(str,'Z','A','\\');
        parsed = parser4.parsePattern();
        str_correct = "\"slash\\\\city\"";
        assertEquals(str_correct, parsed);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.