use of org.junit.platform.engine.EngineDiscoveryRequest in project junit5 by junit-team.
the class UniqueIdSelectorResolverTests method ignoresUniqueIdsOfOtherEngines.
@Test
void ignoresUniqueIdsOfOtherEngines(LogRecordListener listener) {
UniqueId uniqueId = UniqueId.forEngine("someEngine");
EngineDiscoveryRequest request = requestWithSelector(selectUniqueId(uniqueId));
new UniqueIdSelectorResolver().resolve(request, allClassesPredicate, collector);
assertNoRequests();
assertThat(listener.stream(UniqueIdSelectorResolver.class)).isEmpty();
}
use of org.junit.platform.engine.EngineDiscoveryRequest in project junit5 by junit-team.
the class UniqueIdSelectorResolverTests method logsWarningOnUnloadableTestClass.
@Test
void logsWarningOnUnloadableTestClass(LogRecordListener listener) {
UniqueId uniqueId = VintageUniqueIdBuilder.uniqueIdForClass("foo.bar.UnknownClass");
EngineDiscoveryRequest request = requestWithSelector(selectUniqueId(uniqueId));
new UniqueIdSelectorResolver().resolve(request, allClassesPredicate, collector);
assertNoRequests();
assertLoggedWarning(listener, "Unresolvable Unique ID (" + uniqueId + "): Unknown class foo.bar.UnknownClass");
}
use of org.junit.platform.engine.EngineDiscoveryRequest in project junit5 by junit-team.
the class VintageDiscovererTests method packageNameFilterExcludesClasses.
@Test
void packageNameFilterExcludesClasses() {
// @formatter:off
EngineDiscoveryRequest request = request().selectors(selectClass(Foo.class), selectClass(Bar.class)).filters(PackageNameFilter.excludePackageNames("org.junit.vintage.engine.discovery")).build();
// @formatter:on
VintageDiscoverer discoverer = new VintageDiscoverer();
TestDescriptor testDescriptor = discoverer.discover(request, engineId());
assertThat(testDescriptor.getChildren()).isEmpty();
}
use of org.junit.platform.engine.EngineDiscoveryRequest in project junit5 by junit-team.
the class UniqueIdSelectorResolverTests method logsWarningForEngineUniqueId.
@Test
void logsWarningForEngineUniqueId(LogRecordListener listener) {
String uniqueId = engineId().toString();
EngineDiscoveryRequest request = requestWithSelector(selectUniqueId(uniqueId));
new UniqueIdSelectorResolver().resolve(request, allClassesPredicate, collector);
assertNoRequests();
assertLoggedWarning(listener, "Unresolvable Unique ID (" + engineId() + "): Cannot resolve the engine's unique ID");
}
use of org.junit.platform.engine.EngineDiscoveryRequest in project junit5 by junit-team.
the class UniqueIdSelectorResolverTests method requestWithSelector.
private EngineDiscoveryRequest requestWithSelector(UniqueIdSelector selector) {
EngineDiscoveryRequest request = mock(EngineDiscoveryRequest.class);
when(request.getSelectorsByType(UniqueIdSelector.class)).thenReturn(Collections.singletonList(selector));
return request;
}
Aggregations