All tests are executing again

Following the upgrade to JUnit 5 in gh-99, only the few remaining older
style tests extending from TestCase were being executed. This change
ensures JUnit 5 tests are executing as well.
This commit is contained in:
Rossen Stoyanchev
2020-04-28 18:12:59 +01:00
parent fabf1ea7b4
commit 84170260ef
4 changed files with 11 additions and 7 deletions

View File

@@ -89,9 +89,11 @@ configure(subprojects.findAll {
testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
}
tasks.withType(Test).all {
test {
useJUnitPlatform()
include(["**/*Tests.class", "**/*Test.class"])
systemProperty("java.awt.headless", "true")
include "**/*Tests.class"
systemProperty("testGroups", project.properties.get("testGroups"))
}
javadoc {

View File

@@ -19,7 +19,7 @@ import org.apache.myfaces.test.mock.MockFacesContextFactory;
import org.apache.myfaces.test.mock.MockRenderKitFactory;
import org.apache.myfaces.test.mock.lifecycle.MockLifecycle;
import org.apache.myfaces.test.mock.lifecycle.MockLifecycleFactory;
import org.junit.jupiter.api.Test;
import org.junit.Test;
public class JsfUtilsTests extends AbstractJsfTestCase {

View File

@@ -1,15 +1,14 @@
package org.springframework.webflow.expression.el;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.List;
import javax.el.ELContext;
import javax.el.ELResolver;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.binding.expression.el.DefaultELContext;
import org.springframework.binding.expression.el.DefaultELResolver;
import org.springframework.webflow.engine.ViewState;
@@ -17,12 +16,16 @@ import org.springframework.webflow.execution.RequestContextHolder;
import org.springframework.webflow.test.MockFlowSession;
import org.springframework.webflow.test.MockRequestContext;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
public abstract class FlowDependentELResolverTestCase {
protected ELContext context;
@BeforeEach
public void setUp() {
RequestContextHolder.setRequestContext(null);
context = new DefaultELContext(new DefaultELResolver(getCustomResolvers()), null, null);
}

View File

@@ -23,7 +23,6 @@ import org.springframework.webflow.test.MockRequestContext;
public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase {
@Override
@AfterEach
public void tearDown() {
RequestContextHolder.setRequestContext(null);