示例#1
0
  // test 13
  @Test
  public void testCounterSpeed() throws Exception {
    WC counter =
        new WC(new String[] {"java", "WC", "src" + File.separator + "test01.txt", "-D", "#$"});

    Long startTime = new Long(System.currentTimeMillis());
    counter.count();
    Long endTime = new Long(System.currentTimeMillis());
    double time_taken = (endTime - startTime) / (double) 1000;
    assertTrue(
        "Expected to finish the test in less than " + counter.getWords() / 5000 + " seconds",
        time_taken < (double) counter.getWords() / 5000);
  }