-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathCheckerClass.template
33 lines (27 loc) · 1.03 KB
/
CheckerClass.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package %package%;
import net.egork.chelper.tester.Verdict;
import net.egork.chelper.checkers.Checker;
import %InputClassFQN%;
import java.io.StringBufferInputStream;
import java.util.InputMismatchException;
public class %CheckerClass% implements Checker {
public %CheckerClass%(String parameters) {
}
public Verdict check(String input, String expectedOutput, String actualOutput) {
%InputClass% in = new %InputClass%(new StringBufferInputStream(input));
%InputClass% expected;
if (expectedOutput == null)
expected = null;
else
expected = new %InputClass%(new StringBufferInputStream(expectedOutput));
%InputClass% actual = new %InputClass%(new StringBufferInputStream(actualOutput));
try {
return check(in, expected, actual);
} catch (InputMismatchException e) {
return new Verdict(Verdict.VerdictType.PE, e.getMessage());
}
}
public Verdict check(%InputClass% in, %InputClass% expected, %InputClass% actual) {
return Verdict.UNDECIDED;
}
}