Skip to content

Commit d0b0deb

Browse files
committed
Exclude integration tests
1 parent cd08737 commit d0b0deb

12 files changed

Lines changed: 96 additions & 63 deletions

File tree

‎apache-poi/temp.xlsx‎

0 Bytes
Binary file not shown.

‎core-java/pom.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@
198198
<plugin>
199199
<groupId>org.apache.maven.plugins</groupId>
200200
<artifactId>maven-surefire-plugin</artifactId>
201-
<version>${maven-surefire-plugin.version}</version>
202201
<configuration>
203202
<excludes>
204203
<exclude>**/*IntegrationTest.java</exclude>

core-java/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchExampleTest.java renamed to core-java/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchExampleIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import static java.util.stream.Collectors.toList;
1313
import static org.assertj.core.api.Assertions.assertThat;
1414

15-
public class CountdownLatchExampleTest {
15+
public class CountdownLatchExampleIntegrationTest {
1616
@Test
1717
public void whenParallelProcessing_thenMainThreadWillBlockUntilCompletion() throws InterruptedException {
1818
// Given

core-java/src/test/java/org/baeldung/java/shell/JavaProcessUnitTest.java renamed to core-java/src/test/java/org/baeldung/java/shell/JavaProcessUnitIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.concurrent.Executors;
88
import java.util.function.Consumer;
99

10-
public class JavaProcessUnitTest {
10+
public class JavaProcessUnitIntegrationTest {
1111
private static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().startsWith("windows");
1212

1313
private static class StreamGobbler implements Runnable {

core-java/src/test/java/org/baeldung/java/streams/ThreadPoolInParallelStreamTest.java renamed to core-java/src/test/java/org/baeldung/java/streams/ThreadPoolInParallelStreamIntegrationTest.java

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
package org.baeldung.java.streams;
2-
3-
import org.junit.Test;
4-
5-
import java.util.ArrayList;
6-
import java.util.List;
7-
import java.util.concurrent.ExecutionException;
8-
import java.util.concurrent.ForkJoinPool;
9-
import java.util.stream.Collectors;
10-
import java.util.stream.LongStream;
11-
import java.util.stream.Stream;
12-
13-
import static org.junit.Assert.assertEquals;
14-
import static org.junit.Assert.assertTrue;
15-
16-
public class ThreadPoolInParallelStreamTest {
17-
18-
@Test
19-
public void giveRangeOfLongs_whenSummedInParallel_shouldBeEqualToExpectedTotal() throws InterruptedException, ExecutionException {
20-
long firstNum = 1;
21-
long lastNum = 1_000_000;
22-
23-
List<Long> aList = LongStream.rangeClosed(firstNum, lastNum).boxed().collect(Collectors.toList());
24-
25-
ForkJoinPool customThreadPool = new ForkJoinPool(4);
26-
long actualTotal = customThreadPool.submit(() -> aList.parallelStream().reduce(0L, Long::sum)).get();
27-
28-
assertEquals((lastNum + firstNum) * lastNum / 2, actualTotal);
29-
}
30-
31-
@Test
32-
public void givenList_whenCallingParallelStream_shouldBeParallelStream() {
33-
List<Long> aList = new ArrayList<>();
34-
Stream<Long> parallelStream = aList.parallelStream();
35-
36-
assertTrue(parallelStream.isParallel());
37-
}
38-
}
1+
package org.baeldung.java.streams;
2+
3+
import org.junit.Test;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
import java.util.concurrent.ExecutionException;
8+
import java.util.concurrent.ForkJoinPool;
9+
import java.util.stream.Collectors;
10+
import java.util.stream.LongStream;
11+
import java.util.stream.Stream;
12+
13+
import static org.junit.Assert.assertEquals;
14+
import static org.junit.Assert.assertTrue;
15+
16+
public class ThreadPoolInParallelStreamIntegrationTest {
17+
18+
@Test
19+
public void giveRangeOfLongs_whenSummedInParallel_shouldBeEqualToExpectedTotal() throws InterruptedException, ExecutionException {
20+
long firstNum = 1;
21+
long lastNum = 1_000_000;
22+
23+
List<Long> aList = LongStream.rangeClosed(firstNum, lastNum).boxed().collect(Collectors.toList());
24+
25+
ForkJoinPool customThreadPool = new ForkJoinPool(4);
26+
long actualTotal = customThreadPool.submit(() -> aList.parallelStream().reduce(0L, Long::sum)).get();
27+
28+
assertEquals((lastNum + firstNum) * lastNum / 2, actualTotal);
29+
}
30+
31+
@Test
32+
public void givenList_whenCallingParallelStream_shouldBeParallelStream() {
33+
List<Long> aList = new ArrayList<>();
34+
Stream<Long> parallelStream = aList.parallelStream();
35+
36+
assertTrue(parallelStream.isParallel());
37+
}
38+
}

spring-core/src/test/java/com/baeldung/applicationcontext/ClasspathXmlApplicationContextTest.java renamed to spring-core/src/test/java/com/baeldung/applicationcontext/ClasspathXmlApplicationContextIntegrationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package com.baeldung.applicationcontext;
22

3-
import static org.hamcrest.core.IsEqual.equalTo;
4-
import static org.junit.Assert.assertThat;
5-
6-
import java.util.List;
7-
import java.util.Locale;
8-
93
import org.junit.Test;
104
import org.springframework.context.ApplicationContext;
115
import org.springframework.context.ConfigurableApplicationContext;
126
import org.springframework.context.MessageSource;
137
import org.springframework.context.support.ClassPathXmlApplicationContext;
148

15-
public class ClasspathXmlApplicationContextTest {
9+
import java.util.List;
10+
import java.util.Locale;
11+
12+
import static org.hamcrest.core.IsEqual.equalTo;
13+
import static org.junit.Assert.assertThat;
14+
15+
public class ClasspathXmlApplicationContextIntegrationTest {
1616
@Test
1717
public void testBasicUsage() {
1818
ApplicationContext context = new ClassPathXmlApplicationContext("classpathxmlapplicationcontext-example.xml");

‎spring-data-rest/pom.xml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>com.baeldung</groupId>
7-
<artifactId>intro-spring-data-rest</artifactId>
7+
<artifactId>spring-data-rest</artifactId>
88
<version>1.0</version>
99
<packaging>jar</packaging>
1010

@@ -56,6 +56,17 @@
5656
<groupId>org.springframework.boot</groupId>
5757
<artifactId>spring-boot-maven-plugin</artifactId>
5858
</plugin>
59+
60+
<plugin>
61+
<groupId>org.apache.maven.plugins</groupId>
62+
<artifactId>maven-surefire-plugin</artifactId>
63+
<configuration>
64+
<excludes>
65+
<exclude>**/*IntegrationTest.java</exclude>
66+
<exclude>**/*LiveTest.java</exclude>
67+
</excludes>
68+
</configuration>
69+
</plugin>
5970
</plugins>
6071
</build>
6172

spring-data-rest/src/test/java/com/baeldung/relationships/SpringDataRelationshipsTest.java renamed to spring-data-rest/src/test/java/com/baeldung/relationships/SpringDataRelationshipsIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
@RunWith(SpringRunner.class)
2626
@SpringBootTest(classes = SpringDataRestApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT)
27-
public class SpringDataRelationshipsTest {
27+
public class SpringDataRelationshipsIntegrationTest {
2828

2929
@Autowired
3030
private TestRestTemplate template;

spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorTest.java renamed to spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorIntegrationTest.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package com.baeldung.validator;
22

3-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
4-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
5-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
6-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
7-
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;
8-
3+
import com.baeldung.SpringDataRestApplication;
4+
import com.baeldung.models.WebsiteUser;
5+
import com.fasterxml.jackson.databind.ObjectMapper;
96
import org.junit.Before;
107
import org.junit.Test;
118
import org.junit.runner.RunWith;
@@ -17,14 +14,16 @@
1714
import org.springframework.test.web.servlet.MockMvc;
1815
import org.springframework.web.context.WebApplicationContext;
1916

20-
import com.baeldung.SpringDataRestApplication;
21-
import com.baeldung.models.WebsiteUser;
22-
import com.fasterxml.jackson.databind.ObjectMapper;
17+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
18+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
19+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
20+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
21+
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;
2322

2423
@RunWith(SpringJUnit4ClassRunner.class)
2524
@SpringBootTest(classes = SpringDataRestApplication.class)
2625
@WebAppConfiguration
27-
public class SpringDataRestValidatorTest {
26+
public class SpringDataRestValidatorIntegrationTest {
2827
public static final String URL = "http://localhost";
2928

3029
private MockMvc mockMvc;

‎spring-security-cache-control/pom.xml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,20 @@
8585
<rest-assured.version>2.9.0</rest-assured.version>
8686
</properties>
8787

88+
<build>
89+
<plugins>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-surefire-plugin</artifactId>
93+
<configuration>
94+
<excludes>
95+
<exclude>**/*IntegrationTest.java</exclude>
96+
<exclude>**/*LiveTest.java</exclude>
97+
</excludes>
98+
</configuration>
99+
</plugin>
100+
101+
</plugins>
102+
</build>
103+
88104
</project>

0 commit comments

Comments
 (0)