"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.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.

TestTemplateInvocationTestDescriptor.java  (junit5-r5.3.2):TestTemplateInvocationTestDescriptor.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.jupiter.engine.descriptor; package org.junit.jupiter.engine.descriptor;
import static java.util.Collections.emptySet;
import static org.apiguardian.api.API.Status.INTERNAL; import static org.apiguardian.api.API.Status.INTERNAL;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Set;
import org.apiguardian.api.API; import org.apiguardian.api.API;
import org.junit.jupiter.api.extension.TestTemplateInvocationContext; import org.junit.jupiter.api.extension.TestTemplateInvocationContext;
import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.jupiter.engine.execution.JupiterEngineExecutionContext; import org.junit.jupiter.engine.execution.JupiterEngineExecutionContext;
import org.junit.jupiter.engine.extension.ExtensionRegistry; import org.junit.jupiter.engine.extension.ExtensionRegistry;
import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.UniqueId;
import org.junit.platform.engine.support.hierarchical.ExclusiveResource;
/** /**
* {@link TestDescriptor} for a {@link org.junit.jupiter.api.TestTemplate @TestT emplate} * {@link TestDescriptor} for a {@link org.junit.jupiter.api.TestTemplate @TestT emplate}
* invocation. * invocation.
* *
* @since 5.0 * @since 5.0
*/ */
@API(status = INTERNAL, since = "5.0") @API(status = INTERNAL, since = "5.0")
public class TestTemplateInvocationTestDescriptor extends TestMethodTestDescript or { public class TestTemplateInvocationTestDescriptor extends TestMethodTestDescript or {
public static final String SEGMENT_TYPE = "test-template-invocation"; public static final String SEGMENT_TYPE = "test-template-invocation";
private TestTemplateInvocationContext invocationContext; private TestTemplateInvocationContext invocationContext;
private final int index; private final int index;
TestTemplateInvocationTestDescriptor(UniqueId uniqueId, Class<?> testClas s, Method templateMethod, TestTemplateInvocationTestDescriptor(UniqueId uniqueId, Class<?> testClas s, Method templateMethod,
TestTemplateInvocationContext invocationContext, int inde TestTemplateInvocationContext invocationContext, int inde
x) { x, JupiterConfiguration configuration) {
super(uniqueId, invocationContext.getDisplayName(index), testClas super(uniqueId, invocationContext.getDisplayName(index), testClas
s, templateMethod); s, templateMethod, configuration);
this.invocationContext = invocationContext; this.invocationContext = invocationContext;
this.index = index; this.index = index;
} }
@Override @Override
public Set<ExclusiveResource> getExclusiveResources() {
// @ResourceLock annotations are already collected and returned b
y the enclosing container
return emptySet();
}
@Override
public String getLegacyReportingName() { public String getLegacyReportingName() {
return super.getLegacyReportingName() + "[" + index + "]"; return super.getLegacyReportingName() + "[" + index + "]";
} }
@Override @Override
protected ExtensionRegistry populateNewExtensionRegistry(JupiterEngineExe cutionContext context) { protected ExtensionRegistry populateNewExtensionRegistry(JupiterEngineExe cutionContext context) {
ExtensionRegistry registry = super.populateNewExtensionRegistry(c ontext); ExtensionRegistry registry = super.populateNewExtensionRegistry(c ontext);
invocationContext.getAdditionalExtensions().forEach( invocationContext.getAdditionalExtensions().forEach(
extension -> registry.registerExtension(extension, invoca tionContext)); extension -> registry.registerExtension(extension, invoca tionContext));
return registry; return registry;
 End of changes. 7 change blocks. 
5 lines changed or deleted 16 lines changed or added

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