Section 37.3. doTable()


37.3. doTable()

When it calls the doTable() method of a new fixture object, the Fixture object passes the tree of Parse objects for that table. By default, as defined in class Fixture, the doTable() method of a fixture object in turn calls methods to process individual rows (doRow()) and cells (doCell()), as shown in Figure 37.4.

Figure 37.4. Method doTable()


A fixture class overrides some of this behavior. For example, ActionFixture overrides the doCells() method to carry out the action on each row in turn. The fixture object accesses the first cell in the row to find the action to be carried out, gathers up other data from the subsequent cells, and carries out the action.

ColumnFixture overrides the doRows() method to gather the labels in the first row and then calls doRow() on the rest of the rows. The ColumnFixture object also overrides the doCell() method to interpret the text value in the cell, depending on whether it is given or calculated.

RowFixture overrides the doRows() method completely, as it needs to collect up the rows as expected elements. For each surplus element, the RowFixture object adds a new row to the table by constructing extra TR and TD Parse objects and inserting them in the tree, to be reported.

See Section 28.6 for details on when the first table in a sequence is a DoFixture table.



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net