Code Search for Developers
 
 
  

TimedActionFixture.java from MASE: Agile Software Engineering at Krugle


Show TimedActionFixture.java syntax highlighted

// Modified or written by Object Mentor, Inc. for inclusion with FitNesse.
// Copyright (c) 2002 Cunningham & Cunningham, Inc.
// Released under the terms of the GNU General Public License version 2 or later.
// Copyright (c) 2002 Cunningham & Cunningham, Inc.
// Released under the terms of the GNU General Public License version 2 or later.

package fit;

import java.util.Date;
import java.text.*;

public class TimedActionFixture extends ActionFixture
{
  private static SimpleDateFormat makeDateFormat()
  {
    //SimpleDateFormat is not thread safe, so we need to create each instance independently.    
    return new SimpleDateFormat("hh:mm:ss");
  }

  public void doTable(Parse table)
  {
    super.doTable(table);
    table.parts.parts.last().more = td("time");
    table.parts.parts.last().more = td("split");
  }

  public void doCells(Parse cells)
  {
    Date start = time();
    super.doCells(cells);
    long split = time().getTime() - start.getTime();
    cells.last().more = td(makeDateFormat().format(start));
    cells.last().more = td(split < 1000 ? "&nbsp;" : Double.toString((split) / 1000.0));
  }

  // Utility //////////////////////////////////

  public Date time()
  {
    return new Date();
  }

  public Parse td(String body)
  {
    return new Parse("td", gray(body), null, null);
  }

}




See more files for this project here

MASE: Agile Software Engineering

The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.

Project homepage: http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other

  exception/
    AmbiguousActionException.java
    AmbiguousNameFailureException.java
    BooleanMethodFitFailureException.java
    ClassIsNotFixtureException.java
    CouldNotLoadComponentFitFailureException.java
    CouldNotParseFitFailureException.java
    CycleException.java
    ExtraCellsFailureException.java
    FitFailureException.java
    FitFailureExceptionWithHelp.java
    FitMatcherException.java
    FitParseException.java
    FixtureException.java
    IgnoredException.java
    MissingCellsFailureException.java
    MissingFieldFitFailureException.java
    MissingMethodException.java
    MissingRowFailureException.java
    NestedTableExpected.java
    NoDefaultConstructorFixtureException.java
    NoSuchFieldFitFailureException.java
    NoSuchFixtureException.java
    NoSuchMethodFitFailureException.java
    RowWrongWidthException.java
    VoidMethodFitFailureException.java
  ActionFixture.java
  Binding.java
  ColumnFixture.java
  ColumnFixtureTest.java
  Comment.java
  Counts.java
  CountsTest.java
  FileRunner.java
  FitMatcher.java
  FitMatcherTest.java
  Fixture.java
  FixtureClass.java
  FixtureListener.java
  FixtureLoader.java
  FixtureLoaderTest.java
  FixtureName.java
  GracefulNamer.java
  GracefulNamerTest.java
  ImportFixture.java
  NullFixtureListener.java
  Parse.java
  ParseTest.java
  PrimitiveFixture.java
  RowFixture.java
  RowFixtureTest.java
  ScientificDouble.java
  ScientificDoubleTest.java
  SummaryFixture.java
  TestRunner.java
  TimedActionFixture.java
  TypeAdapter.java
  TypeAdapterTest.java
  WikiRunner.java