Unit tests method names and class names modified as per the guidelines

This commit is contained in:
Karthikeyan Subbaraj 2018-07-30 15:17:41 +05:30 committed by José Carlos Valero Sánchez
parent 9bc5b950f6
commit 3b0fef0266
2 changed files with 8 additions and 8 deletions

View File

@ -12,10 +12,10 @@ import static java.util.stream.IntStream.range;
/**
* Correctness tests for Stack in multi threaded environment.
*/
public class MultithreadingCorrectnessStackTests {
public class MultithreadingCorrectnessStackUnitTest {
@Test
public void test_multithreading_correctness_with_synchronized_deque() {
public void givenSynchronizedDeque_whenExecutedParallel_thenWorkRight() {
DequeBasedSynchronizedStack<Integer> deque = new DequeBasedSynchronizedStack<>();
@ -41,7 +41,7 @@ public class MultithreadingCorrectnessStackTests {
}
@Test
public void test_multithreading_correctness_with_concurrent_linked_queue() {
public void givenConcurrentLinkedQueue_whenExecutedParallel_thenWorkRight() {
ConcurrentLinkedDeque<Integer> deque = new ConcurrentLinkedDeque<>();
@ -67,7 +67,7 @@ public class MultithreadingCorrectnessStackTests {
}
@Test
public void test_multithreading_correctness_with_array_deque() {
public void givenArrayDeque_whenExecutedParallel_thenShouldFail() {
ArrayDeque<Integer> deque = new ArrayDeque<>();

View File

@ -17,10 +17,10 @@ import static java.util.stream.IntStream.range;
/**
* These tests are to understand the Stack implementation in Java Collections.
*/
public class StackTests {
public class StackUnitTest {
@Test
public void test_basic_with_stack() {
public void givenStack_whenPushPopPeek_thenWorkRight() {
Stack<String> namesStack = new Stack<>();
namesStack.push("Bill Gates");
@ -34,7 +34,7 @@ public class StackTests {
}
@Test
public void test_basic_with_synchronized_deque() {
public void givenSynchronizedDeque_whenPushPopPeek_thenWorkRight() {
DequeBasedSynchronizedStack<String> namesStack = new DequeBasedSynchronizedStack<>();
namesStack.push("Bill Gates");
@ -48,7 +48,7 @@ public class StackTests {
}
@Test
public void test_basic_with_concurrent_linked_queue() {
public void givenConcurrentLinkedDeque_whenPushPopPeek_thenWorkRight() {
ConcurrentLinkedDeque<String> namesStack = new ConcurrentLinkedDeque<>();
namesStack.push("Bill Gates");