Package com.crawljax.oraclecomparator.comparators

Examples of com.crawljax.oraclecomparator.comparators.XPathExpressionComparator


      if (regexs.size() > 0)
        rules.addOracleComparator(new OracleComparator("regex", new RegexComparator(
                regexs.toArray(new String[regexs.size()]))));
      if (xpaths.size() > 0)
        rules.addOracleComparator(new OracleComparator("xpath",
                new XPathExpressionComparator(xpaths.toArray(new String[xpaths.size()]))));
    }
View Full Code Here


  public void testXPathExpressionComparator() {
    String control = "<HTML><head><title>Test</title></head><body>test</body><HTML>";
    String test = "<HTML><head><title>Test</title></head><body>test</body><HTML>";
    assertTrue(control.equals(test));

    XPathExpressionComparator oracle = new XPathExpressionComparator();

    compareTwoDomsWithComparatorEqual(control, test, oracle);
    compareTwoDomsWithComparatorEqual(control, test, new XPathExpressionComparator());

    test =
            "<HTML><head><title>Test</title></head><body>test<div id='ignoreme'>"
                    + "ignoreme</div></body><HTML>";
    compareTwoDomsWithComparatorNotEqual(control, test, oracle);
    compareTwoDomsWithComparatorNotEqual(control, test, new XPathExpressionComparator());

    oracle = new XPathExpressionComparator("//*[@id='ignoreme']");
    compareTwoDomsWithComparatorEqual(control, test, oracle);
    compareTwoDomsWithComparatorEqual(test, control, oracle);

    control =
            "<HTML><head><title>Test</title></head><body>test<div id='ignoreme'>"
View Full Code Here

TOP

Related Classes of com.crawljax.oraclecomparator.comparators.XPathExpressionComparator

Copyright © 2018 www.massapicom. 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.