Polishing wording regarding JUnit Platform and JUnit Jupiter

This commit is contained in:
Sam Brannen 2017-07-07 16:11:52 +02:00
parent ad5f85f8d3
commit 2b03507894
18 changed files with 90 additions and 49 deletions

View File

@ -25,7 +25,7 @@ import org.junit.runner.RunWith;
/**
* JUnit 4 based test suite for tests that involve the Spring TestContext
* Framework and JUnit Jupiter (a.k.a., JUnit 5).
* Framework and JUnit Jupiter (i.e., JUnit 5's programming model).
*
* <p>This class intentionally does not reside in the "jupiter" package
* so that the entire "jupiter" package can be excluded from the Gradle

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -38,8 +38,8 @@ import static org.junit.jupiter.api.Assertions.*;
* with JUnit Jupiter's {@link ExtendWith @ExtendWith} <b>and</b> Spring's
* {@link ContextConfiguration @ContextConfiguration}.
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0

View File

@ -28,6 +28,7 @@ import org.junit.jupiter.api.extension.ExtensionContext.Store;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestContextManager;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.util.ReflectionUtils;
import static org.hamcrest.CoreMatchers.*;
@ -42,6 +43,9 @@ import static org.mockito.Mockito.*;
* results and exception handling; whereas, {@link DisabledIfTestCase} only tests
* the <em>happy paths</em>.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
* @see DisabledIfTestCase

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,14 +22,17 @@ import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.fail;
/**
* Integration tests which verify support for {@link DisabledIf @DisabledIf}
* in conjunction with the {@link SpringExtension} in a JUnit 5 (Jupiter)
* environment.
* in conjunction with the {@link SpringExtension} in a JUnit Jupiter environment.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Tadaya Tsuyukubo
* @author Sam Brannen

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ -29,8 +30,10 @@ import static org.junit.jupiter.api.Assertions.fail;
/**
* Integration tests which verify support for {@link EnabledIf @EnabledIf}
* in conjunction with the {@link SpringExtension} in a JUnit 5 (Jupiter)
* environment.
* in conjunction with the {@link SpringExtension} in a JUnit Jupiter environment.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Tadaya Tsuyukubo
* @author Sam Brannen

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,6 +42,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestExecutionListener;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.transaction.AfterTransaction;
import org.springframework.test.context.transaction.BeforeTransaction;
import org.springframework.transaction.PlatformTransactionManager;
@ -56,7 +57,7 @@ import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.*
* Integration tests which verify that '<i>before</i>' and '<i>after</i>'
* methods of {@link TestExecutionListener TestExecutionListeners} as well as
* {@code @BeforeTransaction} and {@code @AfterTransaction} methods can fail
* tests run via the {@link SpringExtension} in a JUnit 5 (Jupiter) environment.
* tests run via the {@link SpringExtension} in a JUnit Jupiter environment.
*
* <p>See: <a href="https://jira.spring.io/browse/SPR-3960" target="_blank">SPR-3960</a>
* and <a href="https://jira.spring.io/browse/SPR-4365" target="_blank">SPR-4365</a>.
@ -64,6 +65,9 @@ import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.*
* <p>Indirectly, this class also verifies that all {@code TestExecutionListener}
* lifecycle callbacks are called.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,8 +42,8 @@ import static org.junit.jupiter.api.Assertions.*;
* Integration tests which demonstrate that the Spring TestContext Framework can
* be used with JUnit Jupiter via the {@link SpringExtension}.
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -30,19 +30,19 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* Integration tests which demonstrate support for {@link Autowired @Autowired}
* test class constructors with the Spring TestContext Framework and JUnit 5.
* test class constructors with the Spring TestContext Framework and JUnit Jupiter.
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
* @see SpringExtension
* @see SpringJUnit5ConstructorInjectionTestCase
* @see SpringJUnitJupiterConstructorInjectionTestCase
*/
@SpringJUnitConfig(TestConfig.class)
@TestPropertySource(properties = "enigma = 42")
class SpringJUnit5AutowiredConstructorInjectionTestCase {
class SpringJUnitJupiterAutowiredConstructorInjectionTestCase {
final ApplicationContext applicationContext;
final Person dilbert;
@ -50,7 +50,7 @@ class SpringJUnit5AutowiredConstructorInjectionTestCase {
final Integer enigma;
@Autowired
SpringJUnit5AutowiredConstructorInjectionTestCase(ApplicationContext applicationContext, Person dilbert, Dog dog,
SpringJUnitJupiterAutowiredConstructorInjectionTestCase(ApplicationContext applicationContext, Person dilbert, Dog dog,
@Value("${enigma}") Integer enigma) {
this.applicationContext = applicationContext;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,19 +32,19 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* Integration tests which demonstrate support for autowiring individual
* parameters in test class constructors using {@link Autowired @Autowired}
* and {@link Value @Value} with the Spring TestContext Framework and JUnit 5.
* and {@link Value @Value} with the Spring TestContext Framework and JUnit Jupiter.
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
* @see SpringExtension
* @see SpringJUnit5AutowiredConstructorInjectionTestCase
* @see SpringJUnitJupiterAutowiredConstructorInjectionTestCase
*/
@SpringJUnitConfig(TestConfig.class)
@TestPropertySource(properties = "enigma = 42")
class SpringJUnit5ConstructorInjectionTestCase {
class SpringJUnitJupiterConstructorInjectionTestCase {
final ApplicationContext applicationContext;
final Person dilbert;
@ -52,7 +52,7 @@ class SpringJUnit5ConstructorInjectionTestCase {
final Integer enigma;
final TestInfo testInfo;
SpringJUnit5ConstructorInjectionTestCase(ApplicationContext applicationContext, @Autowired Person dilbert,
SpringJUnitJupiterConstructorInjectionTestCase(ApplicationContext applicationContext, @Autowired Person dilbert,
@Autowired Dog dog, @Value("${enigma}") Integer enigma, TestInfo testInfo) {
this.applicationContext = applicationContext;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,14 +16,18 @@
package org.springframework.test.context.junit.jupiter.defaultmethods;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.comics.Cat;
/**
* Parameterized test class for integration tests that demonstrate support for
* interface default methods and Java generics in JUnit 5 test classes when used
* interface default methods and Java generics in JUnit Jupiter test classes when used
* with the Spring TestContext Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,14 +16,18 @@
package org.springframework.test.context.junit.jupiter.defaultmethods;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.comics.Dog;
/**
* Parameterized test class for integration tests that demonstrate support for
* interface default methods and Java generics in JUnit 5 test classes when used
* interface default methods and Java generics in JUnit Jupiter test classes when used
* with the Spring TestContext Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,6 +21,7 @@ import java.util.List;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.context.junit.jupiter.TestConfig;
@ -33,6 +34,9 @@ import static org.junit.jupiter.api.Assertions.*;
* methods and Java generics in JUnit Jupiter test classes when used with the Spring
* TestContext Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,14 +16,18 @@
package org.springframework.test.context.junit.jupiter.generics;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.comics.Cat;
/**
* Parameterized test class for integration tests that demonstrate support for
* Java generics in JUnit 5 test classes when used with the Spring TestContext
* Java generics in JUnit Jupiter test classes when used with the Spring TestContext
* Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,14 +16,18 @@
package org.springframework.test.context.junit.jupiter.generics;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.comics.Dog;
/**
* Parameterized test class for integration tests that demonstrate support for
* Java generics in JUnit 5 test classes when used with the Spring TestContext
* Java generics in JUnit Jupiter test classes when used with the Spring TestContext
* Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,6 +23,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.TestConfig;
import org.springframework.test.context.junit.jupiter.comics.Character;
@ -31,9 +32,12 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* Abstract base class for integration tests that demonstrate support for
* Java generics in JUnit 5 test classes when used with the Spring TestContext
* Java generics in JUnit Jupiter test classes when used with the Spring TestContext
* Framework and the {@link SpringExtension}.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.context.junit.jupiter.nested.NestedTestsWithSpringAndJUnitJupiterTestCase.TopLevelConfig;
@ -30,8 +31,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Integration tests that verify support for {@code @Nested} test classes
* in conjunction with the {@link SpringExtension} in a JUnit 5 (Jupiter)
* environment.
* in conjunction with the {@link SpringExtension} in a JUnit Jupiter environment.
*
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -37,8 +37,8 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
* {@link SpringExtension} (registered via a custom
* {@link SpringJUnitWebConfig @SpringJUnitWebConfig} composed annotation).
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,8 +41,8 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
* This allows the {@link MockMvc} instance to be configured local to the
* test method without any fields in the test class.
*
* <p>To run these tests in an IDE, simply run {@link SpringJUnitJupiterTestSuite}
* as a JUnit 4 test.
* <p>To run these tests in an IDE that does not have built-in support for the JUnit
* Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test.
*
* @author Sam Brannen
* @since 5.0