Package com.crawljax.oraclecomparator

Examples of com.crawljax.oraclecomparator.Comparator


  }

  @Test
  public void testDateOracle() {

    Comparator oracle = new DateComparator();

    /* dates with days */
    compareTwoDomsWithComparatorEqual("<HTML>Monday 15 march 1998</HTML>",
            "<HTML>Tuesday 13 december 2005</HTML>", oracle);
    compareTwoDomsWithComparatorEqual("<HTML>Monday 1 feb '98</HTML>",
View Full Code Here


  }

  @Test
  public void testStyleOracle() {

    Comparator oracle = new StyleComparator();
    /* IGNORE_TAGS */
    compareTwoDomsWithComparatorEqual("<HTML><B>foo</B></HTML>", "<HTML>foo</HTML>", oracle);
    compareTwoDomsWithComparatorEqual("<HTML><PRE>foo</PRE></HTML>",
            "<HTML><STRONG>foo</STRONG></HTML>", oracle);
    compareTwoDomsWithComparatorEqual("<HTML><FONT color=\"red\">foo</FONT> bar</HTML>",
View Full Code Here

            "<HTML><SPAN style=\"display:none; color:green;\">foo</SPAN></HTML>", oracle);
  }

  @Test
  public void testSimpleOracle() {
    Comparator oracle = new SimpleComparator();
    compareTwoDomsWithComparatorEqual("<HTML>\n\n<SPAN>\n    foo\n</SPAN></HTML>",
            "<HTML>\n<SPAN>\n    foo     \n\n</SPAN>\n</HTML>", oracle);
  }
View Full Code Here

            "<HTML>\n<SPAN>\n    foo     \n\n</SPAN>\n</HTML>", oracle);
  }

  @Test
  public void testRegexOracle() {
    Comparator oracle =
            new RegexComparator("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}");
    compareTwoDomsWithComparatorEqual("<HTML>192.168.1.1</HTML>", "<HTML>10.0.0.138</HTML>",
            oracle);
  }
View Full Code Here

    compareTwoDomsWithComparatorNotEqual(control, test, new EditDistanceComparator(1));
    compareTwoDomsWithComparatorEqual(control, test, new EditDistanceComparator(0));

    // We miss the title
    test = "<HTML><head></head><body>test</body><HTML>";
    Comparator oracle = new EditDistanceComparator(0.5);
    compareTwoDomsWithComparatorEqual(control, test, oracle);
    compareTwoDomsWithComparatorNotEqual(control, test, new EditDistanceComparator(1));
    compareTwoDomsWithComparatorEqual(control, test, new EditDistanceComparator(0));
  }
View Full Code Here

TOP

Related Classes of com.crawljax.oraclecomparator.Comparator

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.