Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
454 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpmcArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTestMpmcArray; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpmcArray extends MpqSanityTestMpmcArray | ||
{ | ||
public AtomicMpqSanityTestMpmcArray(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 0, 2, Ordering.FIFO, null)); | ||
list.add(makeAtomic(0, 0, SIZE, Ordering.FIFO, null)); | ||
return list; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscArray; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscArray extends MpqSanityTestMpscArray | ||
{ | ||
public AtomicMpqSanityTestMpscArray(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, 1, Ordering.FIFO, null));// MPSC size 1 | ||
list.add(makeAtomic(0, 1, SIZE, Ordering.FIFO, null));// MPSC size SIZE | ||
return list; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscChunked.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscChunked; | ||
import org.jctools.queues.MpscChunkedArrayQueue; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscChunked extends MpqSanityTestMpscChunked | ||
{ | ||
public AtomicMpqSanityTestMpscChunked(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, 4, Ordering.FIFO, new MpscChunkedArrayQueue<>(2, 4)));// MPSC size 1 | ||
list.add(makeAtomic(0, 1, SIZE, Ordering.FIFO, new MpscChunkedArrayQueue<>(8, SIZE)));// MPSC size SIZE | ||
return list; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscCompound.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscCompound; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
import static org.jctools.util.PortableJvmInfo.CPUs; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscCompound extends MpqSanityTestMpscCompound | ||
{ | ||
public AtomicMpqSanityTestMpscCompound(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, CPUs, Ordering.NONE, null));// MPSC size 1 | ||
list.add(makeAtomic(0, 1, SIZE, Ordering.NONE, null));// MPSC size SIZE | ||
return list; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscGrowable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscGrowable; | ||
import org.jctools.queues.MpscGrowableArrayQueue; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscGrowable extends MpqSanityTestMpscGrowable | ||
{ | ||
public AtomicMpqSanityTestMpscGrowable(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, 4, Ordering.FIFO, new MpscGrowableArrayQueue<>(2, 4)));// MPSC size 1 | ||
list.add(makeAtomic(0, 1, SIZE, Ordering.FIFO, new MpscGrowableArrayQueue<>(8, SIZE)));// MPSC size SIZE | ||
return list; | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscLinked.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscLinked; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscLinked extends MpqSanityTestMpscLinked | ||
{ | ||
public AtomicMpqSanityTestMpscLinked(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, 0, Ordering.FIFO, null));// unbounded MPSC | ||
return list; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscUnbounded.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestMpscUnbounded; | ||
import org.jctools.queues.MpscUnboundedArrayQueue; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestMpscUnbounded extends MpqSanityTestMpscUnbounded | ||
{ | ||
public AtomicMpqSanityTestMpscUnbounded(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(0, 1, 0, Ordering.FIFO, new MpscUnboundedArrayQueue<>(2))); | ||
list.add(makeAtomic(0, 1, 0, Ordering.FIFO, new MpscUnboundedArrayQueue<>(64))); | ||
return list; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestSpmcArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestSpmcArray; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestSpmcArray extends MpqSanityTestSpmcArray | ||
{ | ||
public AtomicMpqSanityTestSpmcArray(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(1, 0, 1, Ordering.FIFO, null));// SPMC size 1 | ||
list.add(makeAtomic(1, 0, SIZE, Ordering.FIFO, null));// SPMC size SIZE | ||
return list; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestSpscArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestSpscArray; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestSpscArray extends MpqSanityTestSpscArray | ||
{ | ||
public AtomicMpqSanityTestSpscArray(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(1, 1, 4, Ordering.FIFO, null));// SPSC size 4 | ||
list.add(makeAtomic(1, 1, SIZE, Ordering.FIFO, null));// SPSC size SIZE | ||
return list; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestSpscChunked.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestSpscChunked; | ||
import org.jctools.queues.SpscChunkedArrayQueue; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestSpscChunked extends MpqSanityTestSpscChunked | ||
{ | ||
public AtomicMpqSanityTestSpscChunked(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(1, 1, 16, Ordering.FIFO, new SpscChunkedArrayQueue<>(8, 16)));// MPSC size 1 | ||
list.add(makeAtomic(1, 1, SIZE, Ordering.FIFO, new SpscChunkedArrayQueue<>(8, SIZE)));// MPSC size SIZE | ||
return list; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestSpscGrowable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.jctools.queues.atomic; | ||
|
||
import org.jctools.queues.MessagePassingQueue; | ||
import org.jctools.queues.MpqSanityTest; | ||
import org.jctools.queues.MpqSanityTestSpscGrowable; | ||
import org.jctools.queues.SpscGrowableArrayQueue; | ||
import org.jctools.queues.spec.ConcurrentQueueSpec; | ||
import org.jctools.queues.spec.Ordering; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
@RunWith(Parameterized.class) | ||
public class AtomicMpqSanityTestSpscGrowable extends MpqSanityTestSpscGrowable | ||
{ | ||
|
||
public AtomicMpqSanityTestSpscGrowable(ConcurrentQueueSpec spec, MessagePassingQueue<Integer> queue) | ||
{ | ||
super(spec, queue); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> parameters() | ||
{ | ||
ArrayList<Object[]> list = new ArrayList<Object[]>(); | ||
list.add(makeAtomic(1, 1, 16, Ordering.FIFO, new SpscGrowableArrayQueue<>(8, 16))); | ||
list.add(makeAtomic(1, 1, SIZE, Ordering.FIFO, new SpscGrowableArrayQueue<>(8, SIZE))); | ||
return list; | ||
} | ||
|
||
} |
Oops, something went wrong.