Created
May 17, 2014 06:08
-
-
Save riking/1e4496e2a6d52abf1440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while ((line = fileReader.readLine()) != null) { | |
if (line.isEmpty()) continue; | |
String[] args = new StrTokenizer(line, StrMatcher.splitMatcher()) | |
.setTrimmerMatcher(StrMatcher.trimMatcher()) | |
.getTokenArray(); | |
ActionHandler.ActionResult actionResult; | |
try { | |
actionResult = handler.doAction(this, args, line); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public ActionResult doAction(Tester tester, String[] args, String fullLine) throws Exception { | |
String command = args[0]; | |
if (command.equals("O")) { | |
System.err.println("HISAFDSALJFJKEW"); | |
String required = "\"" + fullLine.substring(fullLine.indexOf(' ')) + "\""; | |
System.out.println(required); | |
String line; | |
Matcher matcher; | |
do { | |
line = tester.getLine(); | |
matcher = messagePattern.matcher(line); | |
} while (!matcher.matches() && outputSkipAllowed); | |
outputSkipAllowed = false; | |
if (!matcher.matches()) { | |
fail(tester, line + " is not a proper message"); | |
} | |
// String level = matcher.group(1); | |
String message = matcher.group(2); | |
System.out.println(message); | |
message = message.replaceAll(colorPattern, ""); | |
System.out.println(message); | |
if (!required.equals(message)) { | |
fail(tester, "Expected " + required + ", got " + message); | |
} | |
return ActionResult.NORMAL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment