Package fit

Examples of fit.Parse


  @Test
  public void testShouldBeAbleToFindEncapsulatedFixtureName() throws Exception {
    String fitPage = "<table>" + geDecoratorHTMLRow() + "<tr><td>eg.Division</td></tr></table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    String encapsulatedFixtureName = (String) decorator.summary.get(FixtureDecorator.ENCAPSULATED_FIXTURE_NAME);
    assertEquals("eg.Division", encapsulatedFixtureName);
  }
View Full Code Here


  @Test
  public void testShouldBeAbleToInstantiateEncapsulatedFixture() throws Exception {
    String fitPage = "<table>" + geDecoratorHTMLRow() + "<tr><td>" + TestFixture.class.getName()
      + "</td></tr></table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    String encapsulatedFixtureName = (String) decorator.summary.get(FixtureDecorator.ENCAPSULATED_FIXTURE_NAME);
    assertEquals("fit.decorator.TestFixture", encapsulatedFixtureName);
  }
View Full Code Here

  @Test
  public void testShouldDoNothingIfThereIsNoEncapsulatedFixturePresent() throws Exception {
    String fitPage = "<table>" + geDecoratorHTMLRow() + "</table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    assertNull(decorator.summary.get(FixtureDecorator.ENCAPSULATED_FIXTURE_NAME));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), decorator.counts);
  }
View Full Code Here

  @Test
  public void testShouldMarkExceptionIfEncapsulatingFixtureNameIsInvalid() throws Exception {
    String fitPage = "<table>" + geDecoratorHTMLRow() + "<tr><td>invalidClass</td></tr></table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    assertEquals(1, decorator.counts.exceptions);
    String encapsulatedFixtureName = (String) decorator.summary.get(FixtureDecorator.ENCAPSULATED_FIXTURE_NAME);
    assertEquals("invalidClass", encapsulatedFixtureName);
  }
View Full Code Here

  @Test
  public void testShouldStripFirstRowAndPassRestOfTheTableToEncapsulatedFixture() throws Exception {
    String fitPage = "<table>" + geDecoratorHTMLRow() + "<tr><td>" + TestFixture.class.getName()
      + "</td></tr></table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    String expectedTableContents = "<table><tr><td>" + TestFixture.class.getName() + "</td></tr></table>";
    assertEquals(expectedTableContents, decorator.summary.get(TestFixture.TABLE_CONTENTS));
  }
View Full Code Here

  @Test
  public void testShouldHandleInvalidInputExceptionIfThrownBySetUpMethod() throws Exception {
    String fitPage = "<table>" + geWrongDecoratorHTMLRow() + "<tr><td>" + TestFixture.class.getName()
      + "</td></tr></table>";
    Fixture decorator = new Fixture();
    decorator.doTables(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 1), decorator.counts);
  }
View Full Code Here

  @Test
  public void testSetAlternativeArgsShouldStoreOddNumberedColumnsToArgsVariable() throws Exception {
    String fitPage = "<table><tr><td>xyz</td><td>1</td><td>skip1</td><td>2</td><td>skip2</td>"
      + "<td>3</td><td>skip3</td></tr></table>";
    FixtureDecorator decorator = dummyFitDecorator();
    Parse table = new Parse(fitPage);
    decorator.setAlternativeArgs(table);
    assertArray(new String[]
      {"1", "2", "3"}, decorator.getArgs());
  }
View Full Code Here

  @Test
  public void testSetAlternativeArgsShouldIgnoreExpectedAndActualStrings() throws Exception {
    String fitPage = "<table><tr><td>xyz</td><td>1</td><td>skip1</td><td>2<hr>actual 4</td><td>skip2</td>"
      + "<td>3</td><td>skip3</td></tr></table>";
    FixtureDecorator decorator = dummyFitDecorator();
    Parse table = new Parse(fitPage);
    decorator.setAlternativeArgs(table);
    assertArray(new String[]
      {"1", "2", "3"}, decorator.getArgs());
  }
View Full Code Here

  protected abstract String geDecoratorHTMLRow();

  protected abstract int numberOfAssertionsOnDecorator();

  protected void executeAndAssert(Counts expected, String fitPage, Fixture fixture) throws ParseException {
    fixture.doTable(new Parse(fitPage));
    TestCaseHelper.assertCounts(expected, fixture.counts);
  }
View Full Code Here

  }

  @Test
  public void testShouldLeaveTableAsItIsIfCounterValueIsZero() throws Exception {
    String fitPage = "<table>" + FIRST_HTML_ROW + "<tr><td>fit.decorator.TestFixture</td></tr></table>";
    decorator.doTables(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), decorator.counts);
  }
View Full Code Here

TOP

Related Classes of fit.Parse

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.