Optimize build (#1592)

* Optimize build

* Optimize build
This commit is contained in:
Grzegorz Piwowarek 2017-04-05 09:20:39 +02:00 committed by GitHub
parent eb26f83cd1
commit cb9c16a533
23 changed files with 60 additions and 68 deletions

Binary file not shown.

View File

@ -40,6 +40,16 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -1,10 +1,8 @@
package com.mogronalol; package com.baeldung;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.annotation.PostConstruct;
@SpringBootApplication @SpringBootApplication
public class DemoApplication { public class DemoApplication {

View File

@ -1,6 +1,5 @@
package com.mogronalol; package com.baeldung;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;

View File

@ -1,11 +1,10 @@
package com.mogronalol; package com.baeldung;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.context.embedded.LocalServerPort; import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
@ -13,7 +12,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {DemoApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(classes = {DemoApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DemoApplicationTests { public class DemoApplicationIntegrationTest {
private RestTemplate restTemplate; private RestTemplate restTemplate;

View File

@ -35,7 +35,7 @@
<module>deltaspike</module> <module>deltaspike</module>
<module>dozer</module> <module>dozer</module>
<module>ejb</module> <!--<module>ejb</module>-->
<module>feign</module> <module>feign</module>
<module>flyway</module> <module>flyway</module>
@ -66,7 +66,7 @@
<module>javax-servlets</module> <module>javax-servlets</module>
<module>javaxval</module> <module>javaxval</module>
<module>jaxb</module> <module>jaxb</module>
<module>jee7</module> <!--<module>jee7</module>-->
<!-- <module>jhipster</module> --> <!-- <module>jhipster</module> -->
<module>jjwt</module> <module>jjwt</module>
<module>jooq</module> <module>jooq</module>

View File

@ -41,6 +41,16 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -2,10 +2,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>spring-custom-aop</artifactId> <artifactId>spring-aop</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>spring-custom-aop</name> <name>spring-aop</name>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -42,6 +42,18 @@
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -8,7 +8,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest @SpringBootTest
public class CustomAnnotationTest { public class CustomAnnotationIntegrationTest {
@Autowired @Autowired
private Service service; private Service service;

View File

@ -14,7 +14,7 @@ import static org.junit.Assert.assertEquals;
@JsonTest @JsonTest
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class UserJsonDeserializerTest { public class UserJsonDeserializerIntegrationTest {
@Autowired @Autowired
private ObjectMapper objectMapper; private ObjectMapper objectMapper;

View File

@ -14,7 +14,7 @@ import static org.junit.Assert.assertEquals;
@JsonTest @JsonTest
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class UserJsonSerializerTest { public class UserJsonSerializerIntegrationTest {
@Autowired @Autowired
private ObjectMapper objectMapper; private ObjectMapper objectMapper;

View File

@ -16,7 +16,7 @@ import static org.junit.Assert.*;
* Testing specific implementation details for different methods: * Testing specific implementation details for different methods:
* persist, save, merge, update, saveOrUpdate. * persist, save, merge, update, saveOrUpdate.
*/ */
public class SaveMethodsTest { public class SaveMethodsIntegrationTest {
private static SessionFactory sessionFactory; private static SessionFactory sessionFactory;

View File

@ -1,15 +0,0 @@
package com.baeldung.hibernate.criteria;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
public class HibernateCriteriaTestRunner {
public static void main(final String[] args) {
Result result = JUnitCore.runClasses(HibernateCriteriaTestSuite.class);
for (Failure failure : result.getFailures()) {
//
}
}
}

View File

@ -1,11 +0,0 @@
package com.baeldung.hibernate.criteria;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({ HibernateCriteriaIntegrationTest.class })
public class HibernateCriteriaTestSuite {
}

View File

@ -1,14 +1,6 @@
package com.baeldung.persistence.save; package com.baeldung.persistence.save;
import static org.junit.Assert.assertEquals; import com.baeldung.persistence.model.Person;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import javax.persistence.PersistenceException;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
@ -17,19 +9,17 @@ import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.HSQLDialect; import org.hibernate.dialect.HSQLDialect;
import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistry;
import org.junit.After; import org.junit.*;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.baeldung.persistence.model.Person; import javax.persistence.PersistenceException;
import static org.junit.Assert.*;
/** /**
* Testing specific implementation details for different methods: persist, save, * Testing specific implementation details for different methods: persist, save,
* merge, update, saveOrUpdate. * merge, update, saveOrUpdate.
*/ */
public class SaveMethodsTest { public class SaveMethodIntegrationTest {
private static SessionFactory sessionFactory; private static SessionFactory sessionFactory;

View File

@ -15,7 +15,7 @@ import com.baeldung.spring.web.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration @WebAppConfiguration
@ContextConfiguration(classes = WebConfig.class) @ContextConfiguration(classes = WebConfig.class)
public class EmployeeTestWithoutMockMvc { public class EmployeeIntegrationTest {
@Autowired @Autowired
private EmployeeController employeeController; private EmployeeController employeeController;

View File

@ -21,7 +21,7 @@ import com.baeldung.spring.web.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration @WebAppConfiguration
@ContextConfiguration(classes = WebConfig.class) @ContextConfiguration(classes = WebConfig.class)
public class RequestMapingShortcutsUnitTest { public class RequestMapingShortcutsIntegrationTest {
@Autowired @Autowired
private WebApplicationContext ctx; private WebApplicationContext ctx;

View File

@ -259,10 +259,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
<exclude>**/*IntegrationTest.java</exclude>
</excludes> </excludes>
<systemPropertyVariables> <systemPropertyVariables>
<!-- <provPersistenceTarget>h2</provPersistenceTarget> --> <!-- <provPersistenceTarget>h2</provPersistenceTarget> -->

View File

@ -1,7 +1,5 @@
package org.baeldung.web; package org.baeldung.web;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.baeldung.spring.ClientWebConfig; import org.baeldung.spring.ClientWebConfig;
import org.baeldung.spring.SecurityJavaConfig; import org.baeldung.spring.SecurityJavaConfig;
import org.baeldung.spring.WebConfig; import org.baeldung.spring.WebConfig;
@ -20,10 +18,12 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration @WebAppConfiguration
@ContextConfiguration(classes = { ClientWebConfig.class, SecurityJavaConfig.class, WebConfig.class }) @ContextConfiguration(classes = { ClientWebConfig.class, SecurityJavaConfig.class, WebConfig.class })
public class AsyncControllerTest { public class AsyncControllerIntegrationTest {
@Autowired @Autowired
WebApplicationContext wac; WebApplicationContext wac;

View File

@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = ForkJoinStateMachineConfiguration.class) @ContextConfiguration(classes = ForkJoinStateMachineConfiguration.class)
public class ForkJoinStateMachineTest { public class ForkJoinStateMachineIntegrationTest {
@Autowired @Autowired
private StateMachine<String, String> stateMachine; private StateMachine<String, String> stateMachine;

View File

@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = HierarchicalStateMachineConfiguration.class) @ContextConfiguration(classes = HierarchicalStateMachineConfiguration.class)
public class HierarchicalStateMachineTest { public class HierarchicalStateMachineIntegrationTest {
@Autowired @Autowired
private StateMachine<String, String> stateMachine; private StateMachine<String, String> stateMachine;

View File

@ -17,7 +17,7 @@ import javax.annotation.Resource;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = JunctionStateMachineConfiguration.class) @ContextConfiguration(classes = JunctionStateMachineConfiguration.class)
public class JunctionStateMachineTest { public class JunctionStateMachineIntegrationTest {
@Autowired @Autowired
private StateMachine<String, String> stateMachine; private StateMachine<String, String> stateMachine;

View File

@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SimpleEnumStateMachineConfiguration.class) @ContextConfiguration(classes = SimpleEnumStateMachineConfiguration.class)
public class StateEnumMachineTest { public class StateEnumMachineIntegrationTest {
@Autowired @Autowired
private StateMachine<ApplicationReviewStates, ApplicationReviewEvents> stateMachine; private StateMachine<ApplicationReviewStates, ApplicationReviewEvents> stateMachine;