Skip to content

Commit 78b4e4d

Browse files
committed
Fixing comments
1 parent a30d0af commit 78b4e4d

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/main/java/com/pdsl/executors/DefaultPolymorphicDslTestExecutor.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ public MetadataTestRunResults runTestsWithMetadata(Collection<SharedTestCase> sh
192192
List<TestCase> listOfTestCases = sharedTestCase.getSharedTestCaseWithInterpreters().stream()
193193
.map(SharedTestCaseWithInterpreter::getTestCase).toList();
194194
int size = listOfTestCases.getFirst().getUnfilteredPhraseBody().size();
195-
// The first phrase in a test case has metadata (arbitrarilly decided by standard implementation,
196-
// not because it necessarily should be that way)
197-
TestCase testCase = listOfTestCases.stream().findFirst().orElseThrow();
195+
198196
notifyBeforeTestCase(sharedTestCase);
199197
// Create each visitor/listener one time per test case
200198
Map<InterpreterObj, ParseTreeListener> suppliedListeneres = new HashMap<>();
@@ -258,22 +256,22 @@ public MetadataTestRunResults runTestsWithMetadata(Collection<SharedTestCase> sh
258256
}
259257
phraseIndex++;
260258
}
261-
notifyTestCaseSuccess(testCase);
259+
notifyTestCaseSuccess(sharedTestCase);
262260
} catch (Throwable e) {
263261
if (interpreterObj.isPresent() && phrase.isPresent()) {
264262
if (interpreterObj.get().getParseTreeListener().isPresent()) {
265263
notifyOnListenerException(interpreterObj.get().getParseTreeListener().get(),
266-
testSection, testCase, e);
264+
testSection, sharedTestCase, e);
267265
} else if (interpreterObj.get().getParseTreeVisitor().isPresent()) {
268266
notifyOnVisitorException(interpreterObj.get().getParseTreeVisitor().get(),
269-
testSection, testCase, e);
267+
testSection, sharedTestCase, e);
270268
}
271269
}
272-
results.addTestResult(DefaultTestResult.failedTest(testCase, null, e, phraseIndex,
270+
results.addTestResult(DefaultTestResult.failedTest(sharedTestCase, null, e, phraseIndex,
273271
size - phraseIndex));
274272
}
275-
results.addTestResult(DefaultTestResult.passingTest(testCase));
276-
notifyAfterTestCase(testCase);
273+
results.addTestResult(DefaultTestResult.passingTest(sharedTestCase));
274+
notifyAfterTestCase(sharedTestCase);
277275
}
278276
notifyAfterTestSuite(sharedTestCases, results, context);
279277
return results;
@@ -298,7 +296,7 @@ public MetadataTestRunResults runTestsWithMetadata(Collection<SharedTestCase> sh
298296
* be called
299297
* testCaseSuccess - Called once after each test case only if it had no
300298
* phrase failures
301-
* @param observer
299+
* @param observer an observer to notify during test execution events
302300
*/
303301
@Override
304302
public void registerObserver(ExecutorObserver observer) {

src/main/java/com/pdsl/testcases/TestSection.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ public interface TestSection {
2323
/**
2424
* Provides additional information associated with this test section if found.
2525
* @return optional of type input stream representing the metadata
26+
* @deprecated use getSectionMetadata instead
2627
*/
2728
@Deprecated
2829
Optional<InputStream> getMetaData();
2930

31+
/**
32+
* Provides additional information associated with this test section.
33+
* <p>
34+
* The use of this information, if any, is up to the underlying implementation.
35+
* @return map containing arbitrary objects
36+
*/
3037
Optional<Map<String, Object>> getSectionMetadata();
3138

3239
/**
@@ -57,5 +64,4 @@ static List<TestSection> convertBodyFragment(TestBodyFragment testBodyFragment)
5764
}
5865
return testSections;
5966
}
60-
6167
}

0 commit comments

Comments
 (0)