Skip to content

Commit

Permalink
#58 Added test to check discovering by unique id of dynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Mar 4, 2016
1 parent 8624c1d commit fe79eb8
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@ public void testTwoMethodResolutionsByUniqueId() {
assertSame(classFromMethod1, classFromMethod2);
}

@Test
public void testDynamicTestByUniqueIdWillOnlyResolveUpToParent() {
UniqueIdSelector selector = UniqueIdSelector.forUniqueId(
"ENGINE_ID:org.junit.gen5.engine.junit5.discovery.MyTestClass#dynamicTest()%1");

resolver.resolveSelectors(request().select(selector).build());

assertEquals(2, engineDescriptor.allDescendants().size());
List<String> uniqueIds = uniqueIds();
assertTrue(uniqueIds.contains("ENGINE_ID:org.junit.gen5.engine.junit5.discovery.MyTestClass"));
assertTrue(uniqueIds.contains("ENGINE_ID:org.junit.gen5.engine.junit5.discovery.MyTestClass#dynamicTest()"));
}

@Test
public void testPackageResolution() {
PackageSelector selector = PackageSelector.forPackageName("org.junit.gen5.engine.junit5.descriptor.subpackage");
Expand Down

0 comments on commit fe79eb8

Please sign in to comment.