Package fit

Examples of fit.Parse.text()


    Parse args = cells.more;
    if (args == null) {
      throw new MissingCellsFailureException(cells.text()
          + " requires an argument");
    }
    String cmdString = args.text();
    connector = factory.createMongoSourceTargetConnector(cmdString);
    cmdString = parameters.replaceValuesIn(cmdString);
    args.addToBody("<hr/>" + label("Substituted Output") + "<hr/>");
    args.addToBody("<pre/>" + cmdString + "</pre>");
  }
View Full Code Here


    Parse command = cells.more;
    if (command == null) {
      throw new MissingCellsFailureException(cells.text()
          + " requires an argument");
    }
    String cmdString = command.text();
    CommandResult result = db.doEval(cmdString);
    if (result.ok()) {
      right(command);
    } else {
      wrong(command, result.getErrorMessage());
View Full Code Here

    Parse stream = cells.more;
    if (stream == null) {
      throw new MissingCellsFailureException(cells.text()
          + " requires an argument");
    }
    String consoleStream = stream.text();
    if (STDOUT.equalsIgnoreCase(consoleStream)) {
      stream.addToBody("<hr/>" + label("Console Output") + "<hr/>");
      stream.addToBody("<pre/>" + out.toString() + "</pre>");
    } else if (STDERR.equalsIgnoreCase(consoleStream)) {
      stream.addToBody("<hr/>" + label("Console Error") + "<hr/>");
View Full Code Here

    Parse expected = cells.more;
    if (expected == null) {
        throw new MissingCellsFailureException(cells.text()
        + " requires an argument");
    }
    String databaseName = expected.text();
    db = mongo.getDB(databaseName);
    String actual = db.getName();
    if (databaseName.equals(actual)) {
        right(expected);
    } else {
View Full Code Here

    Parse command = cells.more;
    if (command == null) {
        throw new MissingCellsFailureException(cells.text()
        + " requires an argument");
    }
    String cmdString = command.text();
    CommandResult result = db.doEval(cmdString);
    if (result.ok()) {
      right(command);
    } else {
      wrong(command, result.getErrorMessage());
View Full Code Here

    if (expected == null) {
      throw new MissingCellsFailureException(cells.text()
          + " requires an argument");
    }

    String databaseName = expected.text();
    db = mongo.getDB(databaseName);
    String actual = db.getName();
    if (databaseName.equals(actual)) {
      right(expected);
    } else {
View Full Code Here

  int columnNumberContainingText(String columnName, int headerRowIndex) throws InvalidInputException {
    int columnNumber = -1;
    Parse columns = table.at(0, headerRowIndex, 0);
    while (columns != null) {
      columnNumber++;
      if (columnName.equals(columns.text())) {
        return columnNumber;
      }
      columns = columns.more;
    }
    throw new InvalidInputException(errorMsg(columnName));
View Full Code Here

  void incrementColumnValues(String columnName, Delta delta, int headerRowIndex) throws InvalidInputException {
    int columnNumber = columnNumberContainingText(columnName, headerRowIndex);
    int totalNumberOfRows = numberOfRows();
    for (int i = headerRowIndex + 2; i < totalNumberOfRows; ++i) {
      Parse columnToBeUpdated = table.at(0, i, columnNumber);
      String value = columnToBeUpdated.text();
      value = delta.addTo(value, i - headerRowIndex - 1);
      columnToBeUpdated.body = value;
    }
  }
View Full Code Here

    if (table.parts.more == null) {
      return;
    }
    validateDecoratorInput(table);
    Parse actualHeader = table.parts.more.parts;
    String encapsulatedFixtureName = actualHeader.text();
    super.summary.put(ENCAPSULATED_FIXTURE_NAME, encapsulatedFixtureName);
    Fixture fixture = loadFixture(actualHeader, encapsulatedFixtureName);
    if (fixture != null) {
      execute(fixture, table);
      super.summary.putAll(fixture.summary);
View Full Code Here

import fit.Parse;

public class OutputWritingFixture extends Fixture {
  public void doTable(Parse parse) {
    Parse cell = parse.parts.more.parts;
    String value = cell.text();
    System.out.println(value);
    right(cell);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.