Back to project page BehatReporter.
The source code is released under:
Copyright (C) 2013 Fabian Kiss <headrevision@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
If you think the Android project BehatReporter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package headrevision.BehatReporter.report; /*from w w w . ja v a2s. com*/ import headrevision.BehatReporter.json.ParserException; import com.fasterxml.jackson.databind.JsonNode; public class StepParser extends ItemParser { public StepParser(JsonNode item) { super(item, null); } public boolean isStep() throws ParserException { return has("text") && has("type"); } public boolean isBackground() throws ParserException { return has("isBackground") && parseBoolean("isBackground"); } @Override public boolean hasTitle() throws ParserException { return false; } public String parseText() throws ParserException { try { return parseRawText()[0]; } catch (ArrayIndexOutOfBoundsException e) { throw (new ParserException(e)); } } public boolean hasMultilineArgs() throws ParserException { return parseRawText().length == 2; } public String parseMultilineArgs() throws ParserException { try { return parseRawText()[1]; } catch (ArrayIndexOutOfBoundsException e) { throw (new ParserException(e)); } } public String parseType() throws ParserException { return parseText("type"); } private String[] parseRawText() throws ParserException { return parseText("text").split("\n", 2); } }