parent
ac8700ff65
commit
5b5003b391
|
@ -1,22 +1,17 @@
|
|||
package com.baeldung.concurrent.future;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
public class SquareCalculatorUnitTest {
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SquareCalculatorIntegrationTest {
|
||||
|
||||
@Rule
|
||||
public TestName name = new TestName();
|
|
@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.util.Lists.newArrayList;
|
||||
|
||||
public class PriorityBlockingQueueUnitTest {
|
||||
public class PriorityBlockingQueueIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void givenUnorderedValues_whenPolling_thenShouldOrderQueue() throws InterruptedException {
|
|
@ -13,7 +13,7 @@ import java.util.stream.IntStream;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class ConcurrentSkipListSetTest {
|
||||
public class ConcurrentSkipListSetIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void givenThreadsProducingEvents_whenGetForEventsFromLastMinute_thenReturnThoseEventsInTheLockFreeWay() throws InterruptedException {
|
|
@ -7,7 +7,7 @@ import java.util.concurrent.ExecutionException;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class ThreadLocalTest {
|
||||
public class ThreadLocalIntegrationTest {
|
||||
@Test
|
||||
public void givenThreadThatStoresContextInAMap_whenStartThread_thenShouldSetContextForBothUsers() throws ExecutionException, InterruptedException {
|
||||
//when
|
|
@ -9,7 +9,7 @@ import java.util.concurrent.*;
|
|||
import static junit.framework.TestCase.assertEquals;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class TransferQueueTest {
|
||||
public class TransferQueueIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void whenMultipleConsumersAndProducers_thenProcessAllMessages() throws InterruptedException {
|
|
@ -1,16 +1,17 @@
|
|||
package com.baeldung.disruptor;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import com.lmax.disruptor.BusySpinWaitStrategy;
|
||||
import com.lmax.disruptor.RingBuffer;
|
||||
import com.lmax.disruptor.WaitStrategy;
|
||||
import com.lmax.disruptor.dsl.Disruptor;
|
||||
import com.lmax.disruptor.dsl.ProducerType;
|
||||
import com.lmax.disruptor.util.DaemonThreadFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class DisruptorTest {
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
public class DisruptorIntegrationTest {
|
||||
private Disruptor<ValueEvent> disruptor;
|
||||
private WaitStrategy waitStrategy;
|
||||
|
||||
|
@ -21,7 +22,7 @@ public class DisruptorTest {
|
|||
|
||||
private void createDisruptor(final ProducerType producerType, final EventConsumer eventConsumer) {
|
||||
final ThreadFactory threadFactory = DaemonThreadFactory.INSTANCE;
|
||||
disruptor = new Disruptor<ValueEvent>(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy);
|
||||
disruptor = new Disruptor<>(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy);
|
||||
disruptor.handleEventsWith(eventConsumer.getEventHandler());
|
||||
}
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
package org.baeldung.persistence.repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.baeldung.config.StudentJpaConfig;
|
||||
import org.baeldung.persistence.dao.StudentRepository;
|
||||
import org.baeldung.persistence.model.Student;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
@ -9,16 +10,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.baeldung.config.StudentJpaConfig;
|
||||
import org.baeldung.persistence.model.Student;
|
||||
import org.baeldung.persistence.dao.StudentRepository;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = { StudentJpaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||
@Transactional
|
||||
public class InMemoryDBTest {
|
||||
public class InMemoryDBIntegrationTest {
|
||||
|
||||
@Resource
|
||||
private StudentRepository studentRepository;
|
|
@ -26,7 +26,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = WebConfig.class)
|
||||
@WebAppConfiguration
|
||||
public class HeavyResourceControllerTest {
|
||||
public class HeavyResourceControllerIntegrationTest {
|
||||
|
||||
private MockMvc mockMvc;
|
||||
|
|
@ -18,7 +18,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = WebConfig.class)
|
||||
@WebAppConfiguration
|
||||
public class CustomMediaTypeControllerTest {
|
||||
public class CustomMediaTypeControllerIntegrationTest {
|
||||
|
||||
private MockMvc mockMvc;
|
||||
|
|
@ -1,15 +1,6 @@
|
|||
|
||||
package org.baeldung.web.test;
|
||||
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.config.WebConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -22,11 +13,17 @@ import org.springframework.test.web.servlet.MockMvc;
|
|||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = WebConfig.class)
|
||||
@WebAppConfiguration
|
||||
public class BazzNewMappingsExampleControllerTest {
|
||||
public class BazzNewMappingsExampleControllerIntegrationTest {
|
||||
|
||||
private MockMvc mockMvc;
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/*ControllerTest.java</exclude>
|
||||
<exclude>**/*IntegrationTest.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Set;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SessionControllerTest {
|
||||
public class SessionControllerIntegrationTest {
|
||||
|
||||
private Jedis jedis;
|
||||
private TestRestTemplate testRestTemplate;
|
Loading…
Reference in New Issue