Package fitnesse.util

Examples of fitnesse.util.TimeMeasurement


  public SuiteHistoryFormatter(FitNesseContext context, WikiPage page, TestXmlFormatter.WriterFactory source) {
    super(page);
    this.context = context;
    writerFactory = source;
    suiteExecutionReport = new SuiteExecutionReport(context.version, getPage().getPageCrawler().getFullPath().toString());
    totalTimeMeasurement = new TimeMeasurement().start();
  }
View Full Code Here


  }

  @Override
  public void testSystemStarted(TestSystem testSystem) {
    if (suiteTime == null)
      suiteTime = new TimeMeasurement().start();
  }
View Full Code Here

    assertEquals(original, report);
    assertEquals(42, report.getTotalRunTimeInMillis());
  }

  private TimeMeasurement totalTimeMeasurementWithElapsedMillis(final long millis) {
    return new TimeMeasurement() {
      @Override
      public long elapsed() {
        return millis;
      }
    };
View Full Code Here

  public TestXmlFormatter(FitNesseContext context, final WikiPage page, WriterFactory writerFactory) {
    super(page);
    this.context = context;
    this.writerFactory = writerFactory;
    totalTimeMeasurement = new TimeMeasurement().start();
    testResponse = new TestExecutionReport(context.version, page.getPageCrawler().getFullPath().toString());
    resetTimer();
  }
View Full Code Here

    setTotalRunTimeOnReport(totalTimeMeasurement);
    writeResults();
  }

  private void resetTimer() {
    currentTestStartTime = new TimeMeasurement().start();
  }
View Full Code Here

  }

  @Test
  public void testDoesntwaitForTimeoutOnBadCommand() throws Exception {
    CommandRunningFitClient.TIMEOUT = 5000;
    TimeMeasurement measurement = new TimeMeasurement().start();
    client = new CommandRunningFitClient(new CommandRunningFitClient.OutOfProcessCommandRunner(new String[] { "java", "blah" }, null,
            new CompositeExecutionLogListener()));
    client.addFitClientListener(this);
    client.start();
    Thread.sleep(50);
    client.join();
    assertTrue(exceptionOccurred);
    assertTrue(measurement.elapsed() < CommandRunningFitClient.TIMEOUT);
  }
View Full Code Here

  private int testCount = 0;
  private int failCount = 0;

  public TestTextFormatter(ChunkedResponse response) {
    this.response = response;
    this.totalTimeMeasurement = new TimeMeasurement().start();
  }
View Full Code Here

    response.add(String.format("\nStarting Test System: %s.\n", testSystem.getName()));
  }

  @Override
  public void testStarted(WikiTestPage page) {
    timeMeasurement = new TimeMeasurement().start();
  }
View Full Code Here

    assertSubString("<strong>Assertions:</strong> 1 right, 2 wrong, 3 ignored, 4 exceptions (0" + getDecimalSeparator() + "900 seconds)", pageBuffer.toString());
  }

  @Test
  public void testIndividualTestTimingsShouldAppearInSummary() throws Exception {
    TimeMeasurement totalTimeMeasurement = newConstantElapsedTimeMeasurement(900).start();
    formatter.announceNumberTestsToRun(2);
    WikiTestPage firstPage = new WikiTestPage(new WikiPageDummy("page1", "content", null), variableSource);
    WikiTestPage secondPage = new WikiTestPage(new WikiPageDummy("page2", "content", null), variableSource);
    formatter.testStarted(firstPage);
    clock.elapse(670);
View Full Code Here

    assertHasRegexp("<li.*\\(page1\\).*<span.*>\\(0(" + getDecimalSeparatorForRegExp() + "){1}670 seconds\\)</span>.*</li>", pageBuffer.toString());
    assertHasRegexp("<li.*\\(page2\\).*<span.*>\\(0(" + getDecimalSeparatorForRegExp() + "){1}890 seconds\\)</span>.*</li>", pageBuffer.toString());
  }

  private TimeMeasurement newConstantElapsedTimeMeasurement(final long theElapsedTime) {
    return new TimeMeasurement() {
      @Override
      public long elapsed() {
        return theElapsedTime;
      }
    };
View Full Code Here

TOP

Related Classes of fitnesse.util.TimeMeasurement

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.