Ensure all tests are executed in the Gradle build

Prior to this commit several test classes named "*Test" were not
recognized as tests by the Gradle build. This is due to the configured
inclusion of '**/*Tests.*' which follows Spring's naming convention for
test classes.

This commit addresses this issue by:

 - Renaming real test classes consistently to "*Tests".
 - Renaming internal test classes to "*TestCase".
 - Renaming @WebTest to @WebTestStereotype.
 - Disabling broken tests in AnnoDrivenStaticEntityMockingControlTest.
 - Modifying the Gradle build configuration so that classes ending in
   either "*Tests" or "*Test" are considered test classes.

Issue: SPR-11384
This commit is contained in:
Sam Brannen
2014-02-03 23:16:47 +01:00
parent 1c5cab2a40
commit b8ed2f4967
18 changed files with 198 additions and 187 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 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,24 +16,20 @@
package org.springframework.context.support;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
/**
* @author Arjen Poutsma
* @author Sam Brannen
*/
public class SimpleThreadScopeTest {
public class SimpleThreadScopeTests {
private ApplicationContext applicationContext;
@Before
public void setUp() {
applicationContext = new ClassPathXmlApplicationContext("simpleThreadScopeTests.xml", getClass());
}
private ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"simpleThreadScopeTests.xml", getClass());
@Test
public void getFromScope() throws Exception {
@@ -49,15 +45,19 @@ public class SimpleThreadScopeTest {
public void getMultipleInstances() throws Exception {
final TestBean[] beans = new TestBean[2];
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
beans[0] = applicationContext.getBean("threadScopedObject", TestBean.class);
beans[0] = applicationContext.getBean("threadScopedObject",
TestBean.class);
}
});
Thread thread2 = new Thread(new Runnable() {
@Override
public void run() {
beans[1] = applicationContext.getBean("threadScopedObject", TestBean.class);
beans[1] = applicationContext.getBean("threadScopedObject",
TestBean.class);
}
});
thread1.start();