Unit tests method names and class names modified as per the guidelines
This commit is contained in:
parent
9bc5b950f6
commit
3b0fef0266
@ -12,10 +12,10 @@ import static java.util.stream.IntStream.range;
|
|||||||
/**
|
/**
|
||||||
* Correctness tests for Stack in multi threaded environment.
|
* Correctness tests for Stack in multi threaded environment.
|
||||||
*/
|
*/
|
||||||
public class MultithreadingCorrectnessStackTests {
|
public class MultithreadingCorrectnessStackUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_multithreading_correctness_with_synchronized_deque() {
|
public void givenSynchronizedDeque_whenExecutedParallel_thenWorkRight() {
|
||||||
|
|
||||||
DequeBasedSynchronizedStack<Integer> deque = new DequeBasedSynchronizedStack<>();
|
DequeBasedSynchronizedStack<Integer> deque = new DequeBasedSynchronizedStack<>();
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ public class MultithreadingCorrectnessStackTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_multithreading_correctness_with_concurrent_linked_queue() {
|
public void givenConcurrentLinkedQueue_whenExecutedParallel_thenWorkRight() {
|
||||||
|
|
||||||
ConcurrentLinkedDeque<Integer> deque = new ConcurrentLinkedDeque<>();
|
ConcurrentLinkedDeque<Integer> deque = new ConcurrentLinkedDeque<>();
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class MultithreadingCorrectnessStackTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_multithreading_correctness_with_array_deque() {
|
public void givenArrayDeque_whenExecutedParallel_thenShouldFail() {
|
||||||
|
|
||||||
ArrayDeque<Integer> deque = new ArrayDeque<>();
|
ArrayDeque<Integer> deque = new ArrayDeque<>();
|
||||||
|
|
@ -17,10 +17,10 @@ import static java.util.stream.IntStream.range;
|
|||||||
/**
|
/**
|
||||||
* These tests are to understand the Stack implementation in Java Collections.
|
* These tests are to understand the Stack implementation in Java Collections.
|
||||||
*/
|
*/
|
||||||
public class StackTests {
|
public class StackUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_basic_with_stack() {
|
public void givenStack_whenPushPopPeek_thenWorkRight() {
|
||||||
Stack<String> namesStack = new Stack<>();
|
Stack<String> namesStack = new Stack<>();
|
||||||
|
|
||||||
namesStack.push("Bill Gates");
|
namesStack.push("Bill Gates");
|
||||||
@ -34,7 +34,7 @@ public class StackTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_basic_with_synchronized_deque() {
|
public void givenSynchronizedDeque_whenPushPopPeek_thenWorkRight() {
|
||||||
DequeBasedSynchronizedStack<String> namesStack = new DequeBasedSynchronizedStack<>();
|
DequeBasedSynchronizedStack<String> namesStack = new DequeBasedSynchronizedStack<>();
|
||||||
|
|
||||||
namesStack.push("Bill Gates");
|
namesStack.push("Bill Gates");
|
||||||
@ -48,7 +48,7 @@ public class StackTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_basic_with_concurrent_linked_queue() {
|
public void givenConcurrentLinkedDeque_whenPushPopPeek_thenWorkRight() {
|
||||||
ConcurrentLinkedDeque<String> namesStack = new ConcurrentLinkedDeque<>();
|
ConcurrentLinkedDeque<String> namesStack = new ConcurrentLinkedDeque<>();
|
||||||
|
|
||||||
namesStack.push("Bill Gates");
|
namesStack.push("Bill Gates");
|
Loading…
x
Reference in New Issue
Block a user