Code Search for Developers
 
 
  

ColumnFixture.java from MASE: Agile Software Engineering at Krugle


Show ColumnFixture.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.
package fit;

// Copyright (c) 2002 Cunningham & Cunningham, Inc.
// Released under the terms of the GNU General Public License version 2 or later.

public class ColumnFixture extends Fixture
{

  protected Binding columnBindings[];
  protected boolean hasExecuted = false;

  // Traversal ////////////////////////////////

  public void doRows(Parse rows)
  {
    bind(rows.parts);
    super.doRows(rows.more);
  }

  public void doRow(Parse row)
  {
    hasExecuted = false;
    try
    {
      reset();
      super.doRow(row);
      if(!hasExecuted)
      {
        execute();
      }
    }
    catch(Exception e)
    {
      exception(row.leaf(), e);
    }
  }

  public void doCell(Parse cell, int column)
  {
    try
    {
	    columnBindings[column].doCell(this, cell);
    }
    catch(Throwable e)
    {
      exception(cell, e);
    }
  }

  public void check(Parse cell, TypeAdapter a)
  {
		try
		{
	    executeIfNeeded();
		}
		catch(Exception e)
		{
			exception(cell, e);
		}
	  super.check(cell, a);
  }

	protected void executeIfNeeded() throws Exception
	{
		if(!hasExecuted)
		{
				hasExecuted = true;
				execute();
		}
	}

	public void reset() throws Exception
  {
    // about to process first cell of row
  }

  public void execute() throws Exception
  {
    // about to process first method call of row
  }

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

  protected void bind(Parse heads)
  {
	  try
	  {
		  columnBindings = new Binding[heads.size()];
		  for(int i = 0; heads != null; i++, heads = heads.more)
		  {
              columnBindings[i] = createBinding(i, heads);
		  }
	  }
	  catch(Throwable throwable)
	  {
		  exception(heads, throwable);
	  }
  }

  protected Binding createBinding(int column, Parse heads) throws Throwable
  {
      return Binding.create(this, heads.text());
  }

}




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