add integration test profile

This commit is contained in:
DOHA 2016-10-20 14:14:55 +02:00
parent a4f8b50c4f
commit 5a0c407987
28 changed files with 63 additions and 49 deletions

View File

@ -224,7 +224,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<!-- <exclude>**/*ProductionTest.java</exclude> -->
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
<systemPropertyVariables>
<!-- <provPersistenceTarget>h2</provPersistenceTarget> -->
@ -232,31 +232,45 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>${cargo-maven2-plugin.version}</version>
<configuration>
<wait>true</wait>
<container>
<containerId>jetty8x</containerId>
<type>embedded</type>
<systemProperties>
<!-- <provPersistenceTarget>cargo</provPersistenceTarget> -->
</systemProperties>
</container>
<configuration>
<properties>
<cargo.servlet.port>8082</cargo.servlet.port>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*LiveTest.java</exclude>
</excludes>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<test.mime>json</test.mime>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<!-- Spring -->
<org.springframework.version>4.3.1.RELEASE</org.springframework.version>

View File

@ -13,7 +13,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringAsyncConfig.class }, loader = AnnotationConfigContextLoader.class)
public class AsyncAnnotationExampleTest {
public class AsyncAnnotationExampleIntegrationTest {
@Autowired
private AsyncComponent asyncAnnotationExample;

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:springAsync-config.xml")
public class AsyncWithXMLTest {
public class AsyncWithXMLIntegrationTest {
@Autowired
private AsyncComponent asyncAnnotationExample;

View File

@ -21,7 +21,7 @@ import org.springframework.web.servlet.ModelAndView;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = { WebConfig.class }, loader = AnnotationConfigWebContextLoader.class)
public class ControllerAnnotationTest {
public class ControllerAnnotationIntegrationTest {
private MockMvc mockMvc;

View File

@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration({ "classpath:test-mvc.xml" })
public class ControllerTest {
public class ControllerIntegrationTest {
private MockMvc mockMvc;

View File

@ -14,7 +14,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { CustomAnnotationConfiguration.class })
public class DataAccessAnnotationTest {
public class DataAccessAnnotationIntegrationTest {
@DataAccess(entity = Person.class)
private GenericDAO<Person> personGenericDAO;

View File

@ -17,7 +17,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { CustomAnnotationConfiguration.class })
public class DataAccessFieldCallbackTest {
public class DataAccessFieldCallbackIntegrationTest {
@Autowired
private ConfigurableListableBeanFactory configurableListableBeanFactory;

View File

@ -15,7 +15,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringJdbcConfig.class }, loader = AnnotationConfigContextLoader.class)
public class EmployeeDAOTest {
public class EmployeeDAOIntegrationTest {
@Autowired
private EmployeeDAO employeeDao;

View File

@ -12,7 +12,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("dev")
@ContextConfiguration(classes = { SpringProfilesConfig.class }, loader = AnnotationConfigContextLoader.class)
public class DevProfileWithAnnotationTest {
public class DevProfileWithAnnotationIntegrationTest {
@Autowired
DatasourceConfig datasourceConfig;

View File

@ -13,7 +13,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("production")
@ContextConfiguration(classes = { SpringProfilesConfig.class }, loader = AnnotationConfigContextLoader.class)
public class ProductionProfileWithAnnotationTest {
public class ProductionProfileWithAnnotationIntegrationTest {
@Autowired
DatasourceConfig datasourceConfig;

View File

@ -18,7 +18,7 @@ import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextHierarchy({ @ContextConfiguration(classes = ParentConfig2.class), @ContextConfiguration(classes = ChildConfig2.class) })
public class ParentChildPropertyPlaceHolderPropertiesTest {
public class ParentChildPropertyPlaceHolderPropertiesIntegrationTest {
@Autowired
private WebApplicationContext wac;

View File

@ -18,7 +18,7 @@ import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextHierarchy({ @ContextConfiguration(classes = ParentConfig.class), @ContextConfiguration(classes = ChildConfig.class) })
public class ParentChildPropertySourcePropertiesTest {
public class ParentChildPropertySourcePropertiesIntegrationTest {
@Autowired
private WebApplicationContext wac;

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringSchedulingConfig.class }, loader = AnnotationConfigContextLoader.class)
public class ScheduledAnnotationExampleTest {
public class ScheduledAnnotationExampleIntegrationTest {
@Test
public void testScheduledAnnotation() throws InterruptedException {

View File

@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:springScheduled-config.xml")
public class SchedulingWithXmlConfigTest {
public class SchedulingWithXmlConfigIntegrationTest {
@Test
public void testXmlBasedScheduling() throws InterruptedException {

View File

@ -17,7 +17,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@ContextConfiguration(classes = AttributeAnnotationConfiguration.class)
@WebAppConfiguration
public class AttributeAnnotationTest extends AbstractJUnit4SpringContextTests {
public class AttributeAnnotationIntegrationTest extends AbstractJUnit4SpringContextTests {
private MockMvc mockMvc;

View File

@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static org.junit.Assert.assertEquals;
@ContextConfiguration(classes = CacheRefinementsConfiguration.class)
public class CacheRefinementsTest extends AbstractJUnit4SpringContextTests {
public class CacheRefinementsIntegrationTest extends AbstractJUnit4SpringContextTests {
private ExecutorService executorService = Executors.newFixedThreadPool(10);

View File

@ -17,7 +17,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@ContextConfiguration(classes = ComposedMappingConfiguration.class)
@WebAppConfiguration
public class ComposedMappingTest extends AbstractJUnit4SpringContextTests {
public class ComposedMappingIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
private AppointmentService appointmentService;

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static org.junit.Assert.assertNotNull;
@ContextConfiguration(classes = { FooRepositoryConfiguration.class, FooServiceConfiguration.class })
public class ConfigurationConstructorInjectionTest extends AbstractJUnit4SpringContextTests {
public class ConfigurationConstructorInjectionIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
public FooService fooService;

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static org.junit.Assert.assertNotNull;
@ContextConfiguration("classpath:implicit-ctor-context.xml")
public class ImplicitConstructorTest extends AbstractJUnit4SpringContextTests {
public class ImplicitConstructorIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
private FooService fooService;

View File

@ -10,7 +10,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static org.junit.Assert.assertEquals;
@ContextConfiguration("classpath:defaultmethods-context.xml")
public class DefaultMethodsInjectionTest extends AbstractJUnit4SpringContextTests {
public class DefaultMethodsInjectionIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
private IDateHolder dateHolder;

View File

@ -5,7 +5,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
@ContextConfiguration(classes = TransactionalTestConfiguration.class)
public class TransactionalTest extends AbstractTransactionalJUnit4SpringContextTests implements ITransactionalTest {
public class TransactionalIntegrationTest extends AbstractTransactionalJUnit4SpringContextTests implements ITransactionalTest {
@Test
public void whenDefaultMethodAnnotatedWithBeforeTransaction_thenDefaultMethodIsExecuted() {

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static org.junit.Assert.assertNotNull;
@ContextConfiguration(classes = ObjectProviderConfiguration.class)
public class ObjectProviderTest extends AbstractJUnit4SpringContextTests {
public class ObjectProviderIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired
private FooService fooService;

View File

@ -19,7 +19,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@ContextConfiguration(classes = ScopeAnnotationsConfiguration.class)
@WebAppConfiguration
public class ScopeAnnotationsTest extends AbstractJUnit4SpringContextTests {
public class ScopeAnnotationsIntegrationTest extends AbstractJUnit4SpringContextTests {
private MockMvc mockMvc;

View File

@ -10,7 +10,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { AsynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class)
public class AsynchronousCustomSpringEventsTest {
public class AsynchronousCustomSpringEventsIntegrationTest {
@Autowired
private CustomSpringEventPublisher publisher;

View File

@ -9,7 +9,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class)
public class ContextRefreshedListenerTest {
public class ContextRefreshedListenerIntegrationTest {
@Test
public void testContextRefreshedListener() throws InterruptedException {

View File

@ -9,7 +9,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class)
public class SynchronousCustomSpringEventsTest {
public class SynchronousCustomSpringEventsIntegrationTest {
@Autowired
private CustomSpringEventPublisher publisher;

View File

@ -12,7 +12,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringStartupConfig.class }, loader = AnnotationConfigContextLoader.class)
public class SpringStartupTest {
public class SpringStartupIntegrationTest {
@Autowired
private ApplicationContext ctx;

View File

@ -9,7 +9,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:startupConfig.xml")
public class SpringStartupXMLConfigTest {
public class SpringStartupXMLConfigIntegrationTest {
@Autowired
private ApplicationContext ctx;