Search in sources :

Example 1 with Parser

use of de.neemann.digital.testing.parser.Parser in project Digital by hneemann.

the class TestCaseDescription method setDataString.

/**
 * Sets the data and checks its validity
 *
 * @param data the data
 * @throws IOException     thrown if data is not valid
 * @throws ParserException thrown if data is not valid
 */
public void setDataString(String data) throws IOException, ParserException {
    if (!data.equals(dataString)) {
        Parser tdp = new Parser(data).parse();
        dataString = data;
        lines = tdp.getLines();
        names = tdp.getNames();
    }
}
Also used : Parser(de.neemann.digital.testing.parser.Parser)

Example 2 with Parser

use of de.neemann.digital.testing.parser.Parser in project Digital by hneemann.

the class TestCaseDescription method check.

private void check() throws TestingDataException {
    if (lines == null) {
        try {
            Parser tdp = new Parser(dataString).parse();
            lines = tdp.getLines();
            names = tdp.getNames();
        } catch (ParserException | IOException e) {
            throw new TestingDataException(Lang.get("err_errorParsingTestdata"), e);
        }
    }
}
Also used : ParserException(de.neemann.digital.testing.parser.ParserException) IOException(java.io.IOException) Parser(de.neemann.digital.testing.parser.Parser)

Aggregations

Parser (de.neemann.digital.testing.parser.Parser)2 ParserException (de.neemann.digital.testing.parser.ParserException)1 IOException (java.io.IOException)1