"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.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.

VintageTestDescriptorTests.java  (junit5-r5.3.2):VintageTestDescriptorTests.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.descriptor; package org.junit.vintage.engine.descriptor;
skipping to change at line 29 skipping to change at line 29
import org.junit.platform.engine.TestSource; import org.junit.platform.engine.TestSource;
import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.UniqueId;
import org.junit.platform.engine.support.descriptor.MethodSource; import org.junit.platform.engine.support.descriptor.MethodSource;
import org.junit.runner.Description; import org.junit.runner.Description;
class VintageTestDescriptorTests { class VintageTestDescriptorTests {
private static final UniqueId uniqueId = UniqueId.forEngine("vintage"); private static final UniqueId uniqueId = UniqueId.forEngine("vintage");
@Test @Test
void constructFromInheritedMethod() throws Exception { void constructFromInheritedMethod() {
Description description = Description.createTestDescription(Concr eteTest.class, "theTest"); Description description = Description.createTestDescription(Concr eteTest.class, "theTest");
VintageTestDescriptor descriptor = new VintageTestDescriptor(uniq ueId, description); VintageTestDescriptor descriptor = new VintageTestDescriptor(uniq ueId, description);
Optional<TestSource> sourceOptional = descriptor.getSource(); Optional<TestSource> sourceOptional = descriptor.getSource();
assertThat(sourceOptional).containsInstanceOf(MethodSource.class) ; assertThat(sourceOptional).containsInstanceOf(MethodSource.class) ;
MethodSource methodSource = (MethodSource) sourceOptional.get(); MethodSource methodSource = (MethodSource) sourceOptional.get();
assertEquals(ConcreteTest.class.getName(), methodSource.getClassN ame()); assertEquals(ConcreteTest.class.getName(), methodSource.getClassN ame());
assertEquals("theTest", methodSource.getMethodName()); assertEquals("theTest", methodSource.getMethodName());
} }
@Test
void legacyReportingNameUsesClassName() {
Description description = Description.createSuiteDescription(Conc
reteTest.class);
VintageTestDescriptor testDescriptor = new VintageTestDescriptor(
uniqueId, description);
assertEquals("org.junit.vintage.engine.descriptor.VintageTestDesc
riptorTests$ConcreteTest",
testDescriptor.getLegacyReportingName());
}
@Test
void legacyReportingNameUsesMethodName() {
Description description = Description.createTestDescription(Concr
eteTest.class, "legacyTest");
VintageTestDescriptor testDescriptor = new VintageTestDescriptor(
uniqueId, description);
assertEquals("legacyTest", testDescriptor.getLegacyReportingName(
));
}
@Test
void legacyReportingNameFallbackToDisplayName() {
String suiteName = "Legacy Suite";
Description description = Description.createSuiteDescription(suit
eName);
VintageTestDescriptor testDescriptor = new VintageTestDescriptor(
uniqueId, description);
assertEquals(testDescriptor.getDisplayName(), testDescriptor.getL
egacyReportingName());
assertEquals(suiteName, testDescriptor.getLegacyReportingName());
}
private abstract static class AbstractTestBase { private abstract static class AbstractTestBase {
@Test @Test
public void theTest() { public void theTest() {
} }
} }
private static class ConcreteTest extends AbstractTestBase { private static class ConcreteTest extends AbstractTestBase {
} }
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 38 lines changed or added

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