Skip to content

Commit 5b5003b

Browse files
authored
Build optimization (eugenp#1746)
* Build optimization * Build optimization
1 parent ac8700f commit 5b5003b

12 files changed

Lines changed: 33 additions & 41 deletions

File tree

core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorUnitTest.java renamed to core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
package com.baeldung.concurrent.future;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertTrue;
5-
6-
import java.util.concurrent.CancellationException;
7-
import java.util.concurrent.ExecutionException;
8-
import java.util.concurrent.Executors;
9-
import java.util.concurrent.Future;
10-
import java.util.concurrent.TimeUnit;
11-
import java.util.concurrent.TimeoutException;
12-
133
import org.junit.After;
144
import org.junit.Before;
155
import org.junit.Rule;
166
import org.junit.Test;
177
import org.junit.rules.TestName;
188

19-
public class SquareCalculatorUnitTest {
9+
import java.util.concurrent.*;
10+
11+
import static org.junit.Assert.assertEquals;
12+
import static org.junit.Assert.assertTrue;
13+
14+
public class SquareCalculatorIntegrationTest {
2015

2116
@Rule
2217
public TestName name = new TestName();

core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueUnitTest.java renamed to core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import static org.assertj.core.api.Assertions.assertThat;
1010
import static org.assertj.core.util.Lists.newArrayList;
1111

12-
public class PriorityBlockingQueueUnitTest {
12+
public class PriorityBlockingQueueIntegrationTest {
1313

1414
@Test
1515
public void givenUnorderedValues_whenPolling_thenShouldOrderQueue() throws InterruptedException {

core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetTest.java renamed to core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import static org.junit.Assert.assertEquals;
1414
import static org.junit.Assert.assertTrue;
1515

16-
public class ConcurrentSkipListSetTest {
16+
public class ConcurrentSkipListSetIntegrationTest {
1717

1818
@Test
1919
public void givenThreadsProducingEvents_whenGetForEventsFromLastMinute_thenReturnThoseEventsInTheLockFreeWay() throws InterruptedException {

core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalTest.java renamed to core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalIntegrationTest.java

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

88
import static org.junit.Assert.assertEquals;
99

10-
public class ThreadLocalTest {
10+
public class ThreadLocalIntegrationTest {
1111
@Test
1212
public void givenThreadThatStoresContextInAMap_whenStartThread_thenShouldSetContextForBothUsers() throws ExecutionException, InterruptedException {
1313
//when

core-java/src/test/java/com/baeldung/transferqueue/TransferQueueTest.java renamed to core-java/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import static junit.framework.TestCase.assertEquals;
1010

1111
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
12-
public class TransferQueueTest {
12+
public class TransferQueueIntegrationTest {
1313

1414
@Test
1515
public void whenMultipleConsumersAndProducers_thenProcessAllMessages() throws InterruptedException {

disruptor/src/test/java/com/baeldung/disruptor/DisruptorTest.java renamed to disruptor/src/test/java/com/baeldung/disruptor/DisruptorIntegrationTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package com.baeldung.disruptor;
22

3-
import java.util.concurrent.ThreadFactory;
4-
import org.junit.Before;
5-
import org.junit.Test;
63
import com.lmax.disruptor.BusySpinWaitStrategy;
74
import com.lmax.disruptor.RingBuffer;
85
import com.lmax.disruptor.WaitStrategy;
96
import com.lmax.disruptor.dsl.Disruptor;
107
import com.lmax.disruptor.dsl.ProducerType;
118
import com.lmax.disruptor.util.DaemonThreadFactory;
9+
import org.junit.Before;
10+
import org.junit.Test;
11+
12+
import java.util.concurrent.ThreadFactory;
1213

13-
public class DisruptorTest {
14+
public class DisruptorIntegrationTest {
1415
private Disruptor<ValueEvent> disruptor;
1516
private WaitStrategy waitStrategy;
1617

@@ -21,7 +22,7 @@ public void setUp() throws Exception {
2122

2223
private void createDisruptor(final ProducerType producerType, final EventConsumer eventConsumer) {
2324
final ThreadFactory threadFactory = DaemonThreadFactory.INSTANCE;
24-
disruptor = new Disruptor<ValueEvent>(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy);
25+
disruptor = new Disruptor<>(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy);
2526
disruptor.handleEventsWith(eventConsumer.getEventHandler());
2627
}
2728

spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBTest.java renamed to spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBIntegrationTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
package org.baeldung.persistence.repository;
22

3-
import javax.annotation.Resource;
4-
3+
import org.baeldung.config.StudentJpaConfig;
4+
import org.baeldung.persistence.dao.StudentRepository;
5+
import org.baeldung.persistence.model.Student;
56
import org.junit.Test;
67
import org.junit.runner.RunWith;
78
import org.springframework.test.context.ContextConfiguration;
89
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
910
import org.springframework.test.context.support.AnnotationConfigContextLoader;
1011
import org.springframework.transaction.annotation.Transactional;
1112

12-
import org.baeldung.config.StudentJpaConfig;
13-
import org.baeldung.persistence.model.Student;
14-
import org.baeldung.persistence.dao.StudentRepository;
13+
import javax.annotation.Resource;
1514

16-
import static org.junit.Assert.*;
15+
import static org.junit.Assert.assertEquals;
1716

1817
@RunWith(SpringJUnit4ClassRunner.class)
1918
@ContextConfiguration(classes = { StudentJpaConfig.class }, loader = AnnotationConfigContextLoader.class)
2019
@Transactional
21-
public class InMemoryDBTest {
20+
public class InMemoryDBIntegrationTest {
2221

2322
@Resource
2423
private StudentRepository studentRepository;

spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerTest.java renamed to spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@RunWith(SpringJUnit4ClassRunner.class)
2727
@ContextConfiguration(classes = WebConfig.class)
2828
@WebAppConfiguration
29-
public class HeavyResourceControllerTest {
29+
public class HeavyResourceControllerIntegrationTest {
3030

3131
private MockMvc mockMvc;
3232

spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerTest.java renamed to spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@RunWith(SpringJUnit4ClassRunner.class)
1919
@ContextConfiguration(classes = WebConfig.class)
2020
@WebAppConfiguration
21-
public class CustomMediaTypeControllerTest {
21+
public class CustomMediaTypeControllerIntegrationTest {
2222

2323
private MockMvc mockMvc;
2424

spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerTest.java renamed to spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerIntegrationTest.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11

22
package org.baeldung.web.test;
33

4-
import static org.hamcrest.Matchers.hasSize;
5-
import static org.hamcrest.Matchers.is;
6-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
7-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
8-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
9-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
10-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
11-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
12-
134
import org.baeldung.config.WebConfig;
145
import org.junit.Before;
156
import org.junit.Test;
@@ -22,11 +13,17 @@
2213
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
2314
import org.springframework.web.context.WebApplicationContext;
2415

16+
import static org.hamcrest.Matchers.hasSize;
17+
import static org.hamcrest.Matchers.is;
18+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
19+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
20+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
21+
2522

2623
@RunWith(SpringJUnit4ClassRunner.class)
2724
@ContextConfiguration(classes = WebConfig.class)
2825
@WebAppConfiguration
29-
public class BazzNewMappingsExampleControllerTest {
26+
public class BazzNewMappingsExampleControllerIntegrationTest {
3027

3128
private MockMvc mockMvc;
3229

0 commit comments

Comments
 (0)