Skip to content

Commit 250cb35

Browse files
committed
added debug prints to testcases
1 parent 7415d15 commit 250cb35

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/test/java/edu/kit/provideq/toolbox/api/ApiTestHelper.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,17 @@ public static <InputT, ResultT> ProblemDto<InputT, ResultT> trySolveFor(
153153
})
154154
.returnResult()
155155
.getResponseBody();
156-
builder.append("Fetched problem: " + problemDto + "\n");
157156

157+
if (problemDto == null) {
158+
System.out.println("Testcase with id " + problemId + " will terminate because problemDto is null");
159+
System.out.println("problemType: " + problemType);
160+
}
158161
assertNotNull(problemDto);
159162

163+
builder.append("Fetched problem: " + problemDto + "\n");
164+
160165
if (problemDto.getState() == ProblemState.SOLVED) {
166+
System.out.println(problemId + " solved successful.");
161167
break;
162168
}
163169

@@ -174,6 +180,11 @@ public static <InputT, ResultT> ProblemDto<InputT, ResultT> trySolveFor(
174180
.getResponseBody();
175181
builder.append("Fetched sub problem: " + subProblemDto + "\n");
176182

183+
if (subProblemDto == null) {
184+
System.out.println("Subproblem with id " + subProblemId + " will terminate because subProblemDto is null");
185+
System.out.println("subProblem: " + subProblem);
186+
System.out.println("Log: " + builder);
187+
}
177188
assertNotNull(subProblemDto);
178189
}
179190
}
@@ -187,6 +198,8 @@ public static <InputT, ResultT> ProblemDto<InputT, ResultT> trySolveFor(
187198
}
188199

189200
if (hasTimeout.get()) {
201+
System.out.print("Stopping testcase due to timeout.");
202+
System.out.println("log: " + builder);
190203
throw new IllegalStateException("Problem did not solve in time: " + problemDto);
191204
}
192205
}

0 commit comments

Comments
 (0)