Package com.crawljax.oraclecomparator.comparators

Examples of com.crawljax.oraclecomparator.comparators.EditDistanceComparator


            rules.addOracleComparator(new OracleComparator(c.getType().toString()
                    + c.getExpression(), new ScriptComparator()));
            break;
          case distance:
            rules.addOracleComparator(new OracleComparator(c.getType().toString()
                    + c.getExpression(), new EditDistanceComparator(Double
                    .parseDouble(c.getExpression()))));
            break;
          case simple:
            rules.addOracleComparator(new OracleComparator(c.getType().toString()
                    + c.getExpression(), new SimpleComparator()));
View Full Code Here


  @Test
  public void testEditDistanceComparator() {
    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));
    compareTwoDomsWithComparatorEqual(control, test, new EditDistanceComparator(0));
    compareTwoDomsWithComparatorEqual(control, test, new EditDistanceComparator(1));

    test = "TheIsAlotOfRubish";
    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.comparators.EditDistanceComparator

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.