"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdSelectorResolver.java" between
junit5-r5.3.2.tar.gz and junit5-r5.4.0.tar.gz

About: JUnit 5 is a unit testing framework for the Java programming language.

UniqueIdSelectorResolver.java  (junit5-r5.3.2):UniqueIdSelectorResolver.java  (junit5-r5.4.0)
/* /*
* Copyright 2015-2018 the original author or authors. * Copyright 2015-2019 the original author or authors.
* *
* All rights reserved. This program and the accompanying materials are * All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which * made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at * accompanies this distribution and is available at
* *
* http://www.eclipse.org/legal/epl-v20.html * http://www.eclipse.org/legal/epl-v20.html
*/ */
package org.junit.vintage.engine.discovery; package org.junit.vintage.engine.discovery;
skipping to change at line 74 skipping to change at line 74
TestClassCollector collector) { TestClassCollector collector) {
// @formatter:off // @formatter:off
determineTestClassName(uniqueId) determineTestClassName(uniqueId)
.flatMap(testClassName -> loadTestClass(testClass Name, uniqueId)) .flatMap(testClassName -> loadTestClass(testClass Name, uniqueId))
.filter(classFilter) .filter(classFilter)
.ifPresent(testClass -> collector.addFiltered(tes tClass, new UniqueIdFilter(uniqueId))); .ifPresent(testClass -> collector.addFiltered(tes tClass, new UniqueIdFilter(uniqueId)));
// @formatter:on // @formatter:on
} }
private Optional<Class<?>> loadTestClass(String className, UniqueId uniqu eId) { private Optional<Class<?>> loadTestClass(String className, UniqueId uniqu eId) {
Optional<Class<?>> testClass = ReflectionUtils.loadClass(classNam // @formatter:off
e); return ReflectionUtils.tryToLoadClass(className)
if (!testClass.isPresent()) { .ifFailure(cause -> logger.warn(cause, () ->
logger.warn(() -> format("Unresolvable Unique ID (%s): Un format("Unresolvable Unique ID (%
known class %s", uniqueId, className)); s): Unknown class %s", uniqueId, className)))
} .toOptional();
return testClass; // @formatter:on
} }
private Optional<String> determineTestClassName(UniqueId uniqueId) { private Optional<String> determineTestClassName(UniqueId uniqueId) {
Segment runnerSegment = uniqueId.getSegments().get(1); // skip en gine node Segment runnerSegment = uniqueId.getSegments().get(1); // skip en gine node
if (SEGMENT_TYPE_RUNNER.equals(runnerSegment.getType())) { if (SEGMENT_TYPE_RUNNER.equals(runnerSegment.getType())) {
return Optional.of(runnerSegment.getValue()); return Optional.of(runnerSegment.getValue());
} }
logger.warn( logger.warn(
() -> format("Unresolvable Unique ID (%s): Unique ID segm ent after engine segment must be of type \"" () -> format("Unresolvable Unique ID (%s): Unique ID segm ent after engine segment must be of type \""
+ SEGMENT_TYPE_RUNNER + "\"", + SEGMENT_TYPE_RUNNER + "\"",
 End of changes. 2 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)