http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioFutureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioFutureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioFutureSelfTest.java index 44a1eff..86f19eb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioFutureSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioFutureSelfTest.java @@ -30,14 +30,19 @@ import org.apache.ignite.internal.util.nio.GridNioFutureImpl; import org.apache.ignite.internal.util.typedef.CI1; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for NIO future. */ +@RunWith(JUnit4.class) public class GridNioFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOnDone() throws Exception { GridNioFutureImpl<String> fut = new GridNioFutureImpl<>(null); @@ -87,6 +92,7 @@ public class GridNioFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOnCancelled() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -114,6 +120,7 @@ public class GridNioFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testListenSyncNotify() throws Exception { GridNioFutureImpl<String> fut = new GridNioFutureImpl<>(null); @@ -165,6 +172,7 @@ public class GridNioFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { GridNioFutureImpl<Object> unfinished = new GridNioFutureImpl<>(null); GridNioFutureImpl<Object> finished = new GridNioFutureImpl<>(null); @@ -210,4 +218,4 @@ public class GridNioFutureSelfTest extends GridCommonAbstractTest { } } -} \ No newline at end of file +}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataInputOutputByteOrderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataInputOutputByteOrderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataInputOutputByteOrderSelfTest.java index f3ff781..34a7816 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataInputOutputByteOrderSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataInputOutputByteOrderSelfTest.java @@ -20,6 +20,11 @@ package org.apache.ignite.internal.util.io; import java.io.ByteArrayInputStream; import java.util.Random; import junit.framework.TestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.GridTestIoUtils.getCharByByteLE; import static org.apache.ignite.GridTestIoUtils.getDoubleByByteLE; @@ -32,6 +37,7 @@ import static org.junit.Assert.assertArrayEquals; /** * Grid unsafe data input/output byte order sanity tests. */ +@RunWith(JUnit4.class) public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** Array length. */ private static final int ARR_LEN = 16; @@ -49,13 +55,15 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { private GridUnsafeDataInput in; /** {@inheritDoc} */ - @Override protected void setUp() throws Exception { + @Before + @Override public void setUp() throws Exception { out = new GridUnsafeDataOutput(16 * 8+ LEN_BYTES); in = new GridUnsafeDataInput(); in.inputStream(new ByteArrayInputStream(out.internalArray())); } /** {@inheritDoc} */ + @After @Override public void tearDown() throws Exception { in.close(); out.close(); @@ -64,6 +72,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testShort() throws Exception { short val = (short)RND.nextLong(); @@ -76,6 +85,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testShortArray() throws Exception { short[] arr = new short[ARR_LEN]; @@ -95,6 +105,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testChar() throws Exception { char val = (char)RND.nextLong(); @@ -107,6 +118,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testCharArray() throws Exception { char[] arr = new char[ARR_LEN]; @@ -126,6 +138,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testInt() throws Exception { int val = RND.nextInt(); @@ -138,6 +151,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testIntArray() throws Exception { int[] arr = new int[ARR_LEN]; @@ -157,6 +171,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testLong() throws Exception { long val = RND.nextLong(); @@ -169,6 +184,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testLongArray() throws Exception { long[] arr = new long[ARR_LEN]; @@ -188,6 +204,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testFloat() throws Exception { float val = RND.nextFloat(); @@ -200,6 +217,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testFloatArray() throws Exception { float[] arr = new float[ARR_LEN]; @@ -219,6 +237,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testDouble() throws Exception { double val = RND.nextDouble(); @@ -231,6 +250,7 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testDoubleArray() throws Exception { double[] arr = new double[ARR_LEN]; @@ -246,4 +266,4 @@ public class GridUnsafeDataInputOutputByteOrderSelfTest extends TestCase { assertArrayEquals(arr, in.readDoubleArray(), 0); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataOutputArraySizingSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataOutputArraySizingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataOutputArraySizingSelfTest.java index bfde5ac..4254620 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataOutputArraySizingSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/io/GridUnsafeDataOutputArraySizingSelfTest.java @@ -20,12 +20,16 @@ package org.apache.ignite.internal.util.io; import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHAL_BUFFERS_RECHECK; /** * Test for {@link GridUnsafeDataOutput}. */ +@RunWith(JUnit4.class) public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractTest { /** Small array. */ private static final byte[] SMALL = new byte[32]; @@ -49,6 +53,7 @@ public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testSmall() throws Exception { final GridUnsafeDataOutput out = new GridUnsafeDataOutput(512); @@ -62,6 +67,7 @@ public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testBig() throws Exception { GridUnsafeDataOutput out = new GridUnsafeDataOutput(512); @@ -75,6 +81,7 @@ public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractT * @throws Exception If failed. */ @SuppressWarnings("BusyWait") + @Test public void testChanged1() throws Exception { GridUnsafeDataOutput out = new GridUnsafeDataOutput(512); @@ -93,6 +100,7 @@ public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testChanged2() throws Exception { final GridUnsafeDataOutput out = new GridUnsafeDataOutput(512); @@ -146,4 +154,4 @@ public class GridUnsafeDataOutputArraySizingSelfTest extends GridCommonAbstractT } } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java index 0c5f564..4ed1937 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java @@ -36,10 +36,14 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.junits.IgniteTestResources; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test shared memory endpoints crash detection. */ +@RunWith(JUnit4.class) public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTest { /** Timeout in ms between read/write attempts in busy-wait loops. */ public static final int RW_SLEEP_TIMEOUT = 50; @@ -70,6 +74,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ + @Test public void testIgfsServerClientInteractionsUponClientKilling() throws Exception { // Run server endpoint. IpcSharedMemoryServerEndpoint srv = new IpcSharedMemoryServerEndpoint(U.defaultWorkDirectory()); @@ -112,6 +117,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ + @Test public void testIgfsClientServerInteractionsUponServerKilling() throws Exception { fail("https://issues.apache.org/jira/browse/IGNITE-1386"); @@ -163,6 +169,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ + @Test public void testClientThrowsCorrectExceptionUponServerKilling() throws Exception { info("Shared memory IDs before starting server-client interactions: " + IpcSharedMemoryUtils.sharedMemoryIds()); @@ -520,4 +527,4 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes }); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoaderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoaderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoaderSelfTest.java index bca9401..060d72d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoaderSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoaderSelfTest.java @@ -24,10 +24,14 @@ import java.util.Collections; import junit.framework.TestCase; import org.apache.ignite.internal.util.GridJavaProcess; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test shared memory native loader. */ +@RunWith(JUnit4.class) public class IpcSharedMemoryNativeLoaderSelfTest extends TestCase { /** @@ -36,6 +40,7 @@ public class IpcSharedMemoryNativeLoaderSelfTest extends TestCase { * * @throws Exception If failed. */ + @Test public void testLoadWithCorruptedLibFile() throws Exception { if (U.isWindows()) return; @@ -76,4 +81,4 @@ public class IpcSharedMemoryNativeLoaderSelfTest extends TestCase { while ((s = errOut.readLine()) != null) System.out.println("ERR>>>>>> " + s); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java index 0bbbe3c..7405da1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java @@ -30,10 +30,14 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { /** */ public static final int DATA_LEN = 1024 * 1024; @@ -59,6 +63,7 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBasicOperations() throws Exception { File tokFile = new File(IgniteSystemProperties.getString("java.io.tmpdir"), UUID.randomUUID().toString()); @@ -155,6 +160,7 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testForceClose() throws Exception { File tokFile = new File(IgniteSystemProperties.getString("java.io.tmpdir"), getTestIgniteInstanceName()); @@ -196,6 +202,7 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testReadAfterClose() throws Exception { File tokFile = new File(IgniteSystemProperties.getString("java.io.tmpdir"), getTestIgniteInstanceName()); @@ -234,6 +241,7 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWriteAfterClose() throws Exception { File tokFile = new File(IgniteSystemProperties.getString("java.io.tmpdir"), getTestIgniteInstanceName()); @@ -266,4 +274,4 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest { assert !tokFile.exists(); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java index 8b2aa41..1b031e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java @@ -21,10 +21,14 @@ import java.io.File; import java.util.Collection; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class IpcSharedMemoryUtilsSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { @@ -36,6 +40,7 @@ public class IpcSharedMemoryUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPid() throws Exception { int pid = IpcSharedMemoryUtils.pid(); @@ -50,6 +55,7 @@ public class IpcSharedMemoryUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIdsGet() throws Exception { File tokFile = new File(IgniteSystemProperties.getString("java.io.tmpdir"), getTestIgniteInstanceName()); @@ -80,4 +86,4 @@ public class IpcSharedMemoryUtilsSelfTest extends GridCommonAbstractTest { assertFalse(IpcSharedMemoryUtils.sharedMemoryIds().contains(shmemId)); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferSelfTest.java index 03b5169..a483f1b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferSelfTest.java @@ -23,10 +23,14 @@ import java.util.Arrays; import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link GridNioDelimitedBuffer}. */ +@RunWith(JUnit4.class) public class GridNioDelimitedBufferSelfTest extends TestCase { /** */ private static final String ASCII = "ASCII"; @@ -34,6 +38,7 @@ public class GridNioDelimitedBufferSelfTest extends TestCase { /** * Tests simple delimiter (excluded from alphabet) */ + @Test public void testReadZString() throws Exception { Random rnd = new Random(); @@ -81,6 +86,7 @@ public class GridNioDelimitedBufferSelfTest extends TestCase { /** * Tests compound delimiter (included to alphabet) */ + @Test public void testDelim() throws Exception { byte[] delim = "aabb".getBytes(ASCII); @@ -111,4 +117,4 @@ public class GridNioDelimitedBufferSelfTest extends TestCase { assertEquals(strs, res); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java index e623467..d406590 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java @@ -52,12 +52,16 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.marshaller.Marshaller; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.util.concurrent.TimeUnit.SECONDS; /** * Tests for new NIO server. */ +@RunWith(JUnit4.class) public class GridNioSelfTest extends GridCommonAbstractTest { /** Message count in test without reconnect. */ private static final int MSG_CNT = 2000; @@ -103,6 +107,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSimpleMessages() throws Exception { final Collection<GridNioSession> sesSet = new GridConcurrentHashSet<>(); @@ -159,6 +164,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { * * @throws Exception if failed. */ + @Test public void testServerShutdown() throws Exception { GridNioServerListener lsnr = new GridNioServerListenerAdapter() { @Override public void onConnected(GridNioSession ses) { @@ -214,6 +220,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCorrectSocketClose() throws Exception { final AtomicReference<Exception> err = new AtomicReference<>(); @@ -259,6 +266,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testThroughput() throws Exception { GridNioServerListener lsnr = new GridNioServerListenerAdapter() { @Override public void onConnected(GridNioSession ses) { @@ -339,6 +347,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCloseSession() throws Exception { final AtomicReference<Exception> err = new AtomicReference<>(); @@ -414,6 +423,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSendAfterServerStop() throws Exception { final AtomicReference<GridNioSession> sesRef = new AtomicReference<>(); @@ -631,6 +641,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testSendReceive() throws Exception { CountDownLatch latch = new CountDownLatch(10); @@ -665,6 +676,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testAsyncSendReceive() throws Exception { CountDownLatch latch = new CountDownLatch(10); @@ -703,6 +715,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testMultiThreadedSendReceive() throws Exception { CountDownLatch latch = new CountDownLatch(MSG_CNT * THREAD_CNT); @@ -749,6 +762,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConcurrentConnects() throws Exception { final CyclicBarrier barrier = new CyclicBarrier(THREAD_CNT); @@ -846,6 +860,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception if test failed. */ + @Test public void testDeliveryDuration() throws Exception { idProvider.set(1); @@ -913,6 +928,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSessionIdleTimeout() throws Exception { final int sesCnt = 20; @@ -975,6 +991,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWriteTimeout() throws Exception { final int sesCnt = 20; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKeySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKeySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKeySelfTest.java index 71950ee..d825ae8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKeySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKeySelfTest.java @@ -22,14 +22,19 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for {@link GridNioSessionMetaKey}. */ +@RunWith(JUnit4.class) public class GridNioSessionMetaKeySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNextRandomKey() throws Exception { AtomicInteger keyGen = U.staticField(GridNioSessionMetaKey.class, "keyGen"); @@ -54,4 +59,4 @@ public class GridNioSessionMetaKeySelfTest extends GridCommonAbstractTest { keyGen.set(initVal); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java index 1c4aa27..034beb0 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java @@ -24,10 +24,14 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.util.nio.ssl.GridNioSslFilter; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for new NIO server with SSL enabled. */ +@RunWith(JUnit4.class) public class GridNioSslSelfTest extends GridNioSelfTest { /** Test SSL context. */ private static SSLContext sslCtx; @@ -75,13 +79,15 @@ public class GridNioSslSelfTest extends GridNioSelfTest { } /** {@inheritDoc} */ + @Test @Override public void testWriteTimeout() throws Exception { // Skip base test because it enables "skipWrite" mode in the GridNioServer // which makes SSL handshake impossible. } /** {@inheritDoc} */ + @Test @Override public void testAsyncSendReceive() throws Exception { // No-op, do not want to mess with SSL channel. } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridRoundTripTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridRoundTripTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridRoundTripTest.java index d83fde66..3d5b23e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridRoundTripTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridRoundTripTest.java @@ -28,10 +28,14 @@ import java.net.Socket; import java.util.Random; import junit.framework.TestCase; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests pure round trip time on network. */ +@RunWith(JUnit4.class) public class GridRoundTripTest extends TestCase { /** Communication port. */ public static final int PORT = 47600; @@ -43,6 +47,7 @@ public class GridRoundTripTest extends TestCase { * @throws IOException If error occurs. * @throws InterruptedException If interrupted */ + @Test public void testRunServer() throws IOException, InterruptedException { final ServerSocket sock = new ServerSocket(); @@ -74,6 +79,7 @@ public class GridRoundTripTest extends TestCase { * Runs client test */ @SuppressWarnings("InfiniteLoopStatement") + @Test public void testRunClient() { Socket sock = new Socket(); @@ -228,4 +234,4 @@ public class GridRoundTripTest extends TestCase { return res; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/IgniteExceptionInNioWorkerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/IgniteExceptionInNioWorkerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/IgniteExceptionInNioWorkerSelfTest.java index 9af3f8c..a5ba3c5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/IgniteExceptionInNioWorkerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/IgniteExceptionInNioWorkerSelfTest.java @@ -28,10 +28,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class IgniteExceptionInNioWorkerSelfTest extends GridCommonAbstractTest { /** */ private static final int GRID_CNT = 4; @@ -65,6 +69,7 @@ public class IgniteExceptionInNioWorkerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBrokenMessage() throws Exception { startGrids(GRID_CNT); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java index 5888575..7563b33 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java @@ -34,10 +34,14 @@ import org.apache.ignite.internal.util.nio.GridNioSession; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests filter chain event processing. */ +@RunWith(JUnit4.class) public class GridNioFilterChainSelfTest extends GridCommonAbstractTest { /** Session opened event meta name. */ private static final int OPENED_META_NAME = 11; @@ -66,6 +70,7 @@ public class GridNioFilterChainSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChainEvents() throws Exception { final AtomicReference<String> connectedEvt = new AtomicReference<>(); final AtomicReference<String> disconnectedEvt = new AtomicReference<>(); @@ -400,4 +405,4 @@ public class GridNioFilterChainSelfTest extends GridCommonAbstractTest { // No-op. } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapAbstractSelfTest.java index b0c6037..6c9518f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapAbstractSelfTest.java @@ -33,10 +33,14 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import java.util.concurrent.ConcurrentHashMap; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests off-heap map. */ +@RunWith(JUnit4.class) public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractTest { /** Random. */ private static final Random RAND = new Random(); @@ -140,6 +144,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testInsert() throws Exception { map = newMap(); @@ -160,6 +165,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testRehash() throws Exception { initCap = 10; @@ -197,6 +203,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { map = newMap(); @@ -217,6 +224,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testPut1() throws Exception { map = newMap(); @@ -237,6 +245,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testPut2() throws Exception { map = newMap(); @@ -265,6 +274,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testRemove() throws Exception { map = newMap(); @@ -294,6 +304,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testRemovex() throws Exception { map = newMap(); @@ -322,6 +333,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testIterator() throws Exception { initCap = 10; @@ -394,6 +406,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testIteratorMultithreaded() throws Exception { initCap = 10; @@ -468,6 +481,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * */ + @Test public void testInsertLoad() { map = newMap(); @@ -502,6 +516,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * */ + @Test public void testPutLoad() { map = newMap(); @@ -537,6 +552,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * */ + @Test public void testLru1() { lruStripes = 1; mem = 10; @@ -579,6 +595,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * */ + @Test public void testLru2() { mem = 1000 + 64 * 16; // Add segment size. @@ -616,6 +633,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testLruMultithreaded() throws Exception { mem = 1000 + 64 * 16; // Add segment size. @@ -667,6 +685,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testIteratorAfterRehash() throws Exception { mem = 0; initCap = 10; @@ -737,6 +756,7 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT /** * @throws Exception If failed. */ + @Test public void testMultithreadedOps() throws Exception { mem = 1512; // Small enough for evictions. @@ -824,4 +844,4 @@ public abstract class GridOffHeapMapAbstractSelfTest extends GridCommonAbstractT assertEquals(zeroAllocated, map.allocatedSize()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapPerformanceAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapPerformanceAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapPerformanceAbstractTest.java index f7388e8..c1bef71 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapPerformanceAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapMapPerformanceAbstractTest.java @@ -23,10 +23,14 @@ import java.util.Random; import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests off-heap map. */ +@RunWith(JUnit4.class) public abstract class GridOffHeapMapPerformanceAbstractTest extends GridCommonAbstractTest { /** Random. */ private static final Random RAND = new Random(); @@ -133,6 +137,7 @@ public abstract class GridOffHeapMapPerformanceAbstractTest extends GridCommonAb /** * Test plain hash map. */ + @Test public void testHashMapPutRemove() { Map<String, String> map = new HashMap<>(LOAD_CNT); @@ -187,6 +192,7 @@ public abstract class GridOffHeapMapPerformanceAbstractTest extends GridCommonAb /** * */ + @Test public void testInsertRemoveLoad() { info("Starting insert performance test..."); @@ -240,6 +246,7 @@ public abstract class GridOffHeapMapPerformanceAbstractTest extends GridCommonAb /** * */ + @Test public void testPutRemoveLoad() { info("Starting put performance test..."); @@ -288,4 +295,4 @@ public abstract class GridOffHeapMapPerformanceAbstractTest extends GridCommonAb rmv = cnt % 3 == 0; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java index d571318..241c654 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java @@ -33,10 +33,14 @@ import org.apache.ignite.internal.util.lang.GridCloseableIterator; import org.apache.ignite.internal.util.lang.GridTuple; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests off-heap map. */ +@RunWith(JUnit4.class) public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridCommonAbstractTest { /** Random. */ private static final Random RAND = new Random(); @@ -143,6 +147,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testInsert() throws Exception { map = newMap(); @@ -165,6 +170,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testRehash() throws Exception { initCap = 10; @@ -203,6 +209,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPointerAfterRehash() throws Exception { initCap = 10; @@ -245,6 +252,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPutRandomKeys() throws Exception { map = newMap(); @@ -274,6 +282,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { map = newMap(); @@ -296,6 +305,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPut1() throws Exception { map = newMap(); @@ -318,6 +328,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPut2() throws Exception { map = newMap(); @@ -348,6 +359,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testRemove() throws Exception { map = newMap(); @@ -379,6 +391,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testRemovex() throws Exception { map = newMap(); @@ -409,6 +422,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testIterator() throws Exception { initCap = 10; @@ -482,6 +496,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testIteratorMultithreaded() throws Exception { initCap = 10; @@ -579,6 +594,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testIteratorRemoveMultithreaded() throws Exception { initCap = 10; @@ -636,6 +652,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPartitionIterator() throws Exception { initCap = 10; @@ -710,6 +727,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testPartitionIteratorMultithreaded() throws Exception { initCap = 10; @@ -785,6 +803,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * */ + @Test public void testInsertLoad() { mem = 0; // Disable LRU. @@ -825,6 +844,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * */ + @Test public void testPutLoad() { mem = 0; // Disable LRU. @@ -866,6 +886,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * */ + @Test public void testLru1() { lruStripes = 1; mem = 10; @@ -910,6 +931,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * */ + @Test public void testLru2() { mem = 1000 + 64 * 16 * parts; // Add segment size. @@ -949,6 +971,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * @throws Exception If failed. */ + @Test public void testLruMultithreaded() throws Exception { mem = 1000 + 64 * 16 * parts; // Add segment size. @@ -1008,6 +1031,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm * */ @SuppressWarnings("TooBroadScope") + @Test public void testValuePointerEvict() { mem = 90; @@ -1075,6 +1099,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm * */ @SuppressWarnings("TooBroadScope") + @Test public void testValuePointerEnableEviction() { mem = 90; @@ -1141,6 +1166,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm /** * */ + @Test public void testValuePointerRemove() { map = newMap(); @@ -1154,4 +1180,4 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm assertNull(map.valuePointer(1, k.hashCode(), k.getBytes())); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java index 86432fc..0a504a6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java @@ -29,11 +29,15 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Performance test for partitioned offheap hash map. */ @SuppressWarnings({"unchecked", "NonThreadSafeLazyInitialization"}) +@RunWith(JUnit4.class) public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends GridCommonAbstractTest { /** */ protected static final int LOAD_CNT = 256; @@ -108,6 +112,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G /** * @throws Exception If failed. */ + @Test public void testPuts() throws Exception { info("Warming up..."); @@ -121,6 +126,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G /** * @throws Exception If failed. */ + @Test public void testPutsConcurrentMap() throws Exception { info("Warming up..."); @@ -134,6 +140,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G /** * @throws Exception If failed. */ + @Test public void testPutRemoves() throws Exception { info("Warming up..."); @@ -147,6 +154,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G /** * @throws Exception If failed. */ + @Test public void testPutRemovesConcurrentMap() throws Exception { info("Warming up..."); @@ -427,4 +435,4 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G private GridByteArrayWrapper randomKeyWrapper(Random rnd) { return wrappers[rnd.nextInt(keys.length)]; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java index 47b0684..d2be2de 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java @@ -23,12 +23,17 @@ import java.util.Arrays; import java.util.Collection; import org.apache.ignite.internal.util.GridUnsafe; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests unsafe memory. */ +@RunWith(JUnit4.class) public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** */ + @Test public void testBuffers() { ByteBuffer b1 = GridUnsafe.allocateBuffer(10); ByteBuffer b2 = GridUnsafe.allocateBuffer(20); @@ -64,6 +69,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBytes() throws Exception { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -90,6 +96,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testByte() throws Exception { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -120,6 +127,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testShort() throws Exception { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -142,6 +150,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testFloat() { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -164,6 +173,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDouble() { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -187,6 +197,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInt() throws Exception { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -223,6 +234,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLong() throws Exception { GridUnsafeMemory mem = new GridUnsafeMemory(64); @@ -258,6 +270,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompare1() throws Exception { checkCompare("123"); } @@ -265,6 +278,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompare2() throws Exception { checkCompare("1234567890"); } @@ -272,6 +286,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompare3() throws Exception { checkCompare("12345678901234567890"); } @@ -310,6 +325,7 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOutOfMemory() throws Exception { int cap = 64; int block = 9; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeStripedLruSefTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeStripedLruSefTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeStripedLruSefTest.java index 76ccceb..57b7778 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeStripedLruSefTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeStripedLruSefTest.java @@ -21,11 +21,15 @@ import java.util.Collection; import java.util.HashSet; import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Striped LRU test. */ @SuppressWarnings("FieldCanBeLocal") +@RunWith(JUnit4.class) public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** Number of stripes. */ private short stripes = 1; @@ -65,6 +69,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testOffer1() { checkOffer(1000); } @@ -72,6 +77,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testOffer2() { stripes = 11; @@ -95,6 +101,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testRemove1() { checkRemove(1000); } @@ -102,6 +109,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testRemove2() { stripes = 35; @@ -130,6 +138,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testPoll1() { checkPoll(1000); } @@ -137,6 +146,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * */ + @Test public void testPoll2() { stripes = 20; @@ -180,6 +190,7 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLruMultithreaded() throws Exception { checkLruMultithreaded(1000000); } @@ -226,4 +237,4 @@ public class GridUnsafeStripedLruSefTest extends GridCommonAbstractTest { assertEquals(0, lru.size()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/CircularStringBuilderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/CircularStringBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/CircularStringBuilderSelfTest.java index b927863..c90cec1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/CircularStringBuilderSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/CircularStringBuilderSelfTest.java @@ -19,15 +19,20 @@ package org.apache.ignite.internal.util.tostring; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ @GridCommonTest(group = "Utils") +@RunWith(JUnit4.class) public class CircularStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCSBPrimitive() throws Exception { CircularStringBuilder csb = new CircularStringBuilder(1); csb.append((String)null); @@ -43,6 +48,7 @@ public class CircularStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCSBOverflow() throws Exception { testSB(3, "1234", 2, "234"); testSB(4, "1234", 2, "1234"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java index bf33f4a..fa00ba4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java @@ -37,6 +37,9 @@ import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.IgniteSystemProperties.IGNITE_TO_STRING_COLLECTION_LIMIT; import static org.apache.ignite.IgniteSystemProperties.IGNITE_TO_STRING_MAX_LENGTH; @@ -46,10 +49,12 @@ import static org.apache.ignite.internal.util.tostring.GridToStringBuilder.ident * Tests for {@link GridToStringBuilder}. */ @GridCommonTest(group = "Utils") +@RunWith(JUnit4.class) public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToString() throws Exception { TestClass1 obj = new TestClass1(); @@ -64,6 +69,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringWithAdditions() throws Exception { TestClass1 obj = new TestClass1(); @@ -81,6 +87,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCheckSimpleListRecursionPrevention() throws Exception { ArrayList<Object> list1 = new ArrayList<>(); ArrayList<Object> list2 = new ArrayList<>(); @@ -95,6 +102,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCheckSimpleMapRecursionPrevention() throws Exception { HashMap<Object, Object> map1 = new HashMap<>(); HashMap<Object, Object> map2 = new HashMap<>(); @@ -109,6 +117,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCheckListAdvancedRecursionPrevention() throws Exception { ArrayList<Object> list1 = new ArrayList<>(); ArrayList<Object> list2 = new ArrayList<>(); @@ -123,6 +132,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCheckMapAdvancedRecursionPrevention() throws Exception { HashMap<Object, Object> map1 = new HashMap<>(); HashMap<Object, Object> map2 = new HashMap<>(); @@ -137,6 +147,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCheckObjectRecursionPrevention() throws Exception { Node n1 = new Node(); Node n2 = new Node(); @@ -244,6 +255,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * JUnit. */ + @Test public void testToStringPerformance() { TestClass1 obj = new TestClass1(); @@ -286,6 +298,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { * * @throws Exception if failed. */ + @Test public void testArrLimitWithRecursion() throws Exception { int limit = IgniteSystemProperties.getInteger(IGNITE_TO_STRING_COLLECTION_LIMIT, 100); @@ -325,6 +338,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringCollectionLimits() throws Exception { int limit = IgniteSystemProperties.getInteger(IGNITE_TO_STRING_COLLECTION_LIMIT, 100); @@ -429,6 +443,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringColAndMapLimitWithRecursion() throws Exception { int limit = IgniteSystemProperties.getInteger(IGNITE_TO_STRING_COLLECTION_LIMIT, 100); Map strMap = new TreeMap<>(); @@ -479,6 +494,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testToStringSizeLimits() throws Exception { int limit = IgniteSystemProperties.getInteger(IGNITE_TO_STRING_MAX_LENGTH, 10_000); int tailLen = limit / 10 * 2; @@ -509,6 +525,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testObjectPlusStringToString() { IgniteTxKey k = new IgniteTxKey(new KeyCacheObjectImpl(1, null, 1), 123); @@ -520,6 +537,7 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testHierarchy() { Wrapper w = new Wrapper(); Parent p = w.p; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/IncludeSensitiveAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/IncludeSensitiveAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/IncludeSensitiveAbstractTest.java index 3907e85..adacd77 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/IncludeSensitiveAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/IncludeSensitiveAbstractTest.java @@ -25,10 +25,14 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.SensitiveInfoTestLoggerProxy; import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for property {@link IgniteSystemProperties#IGNITE_TO_STRING_INCLUDE_SENSITIVE}. */ +@RunWith(JUnit4.class) public abstract class IncludeSensitiveAbstractTest extends GridCacheAbstractSelfTest { /** Number of test entries */ private static final int ENTRY_CNT = 10; @@ -96,6 +100,7 @@ public abstract class IncludeSensitiveAbstractTest extends GridCacheAbstractSelf * * @throws Exception If failed. */ + @Test public void test() throws Exception { IgniteCache<Long, String> cache = grid(0).cache(DEFAULT_CACHE_NAME); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/FileIOTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/FileIOTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/FileIOTest.java index eb1f8d5..a2f7e8f 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/FileIOTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/FileIOTest.java @@ -24,10 +24,14 @@ import java.util.UUID; import junit.framework.TestCase; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Java file IO test. */ +@RunWith(JUnit4.class) public class FileIOTest extends TestCase { /** File path. */ private static final String FILE_PATH = "/test-java-file.tmp"; @@ -38,6 +42,7 @@ public class FileIOTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testReadLineFromBinaryFile() throws Exception { File file = new File(FILE_PATH); @@ -79,6 +84,7 @@ public class FileIOTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testMultipleFilesCreation() throws Exception { File parent = new File(TMP_DIR, "testMultipleFilesCreation"); @@ -127,6 +133,7 @@ public class FileIOTest extends TestCase { /** * */ + @Test public void testGetAbsolutePath() { for (int i = 0; i < 1000000; i++) { new File("/" + UUID.randomUUID().toString()).getAbsolutePath(); @@ -136,4 +143,4 @@ public class FileIOTest extends TestCase { new File("/Users").getAbsolutePath(); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/FileLocksTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/FileLocksTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/FileLocksTest.java index b376f0b..01d3598 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/FileLocksTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/FileLocksTest.java @@ -22,10 +22,14 @@ import java.io.RandomAccessFile; import java.nio.channels.FileLock; import javax.swing.JOptionPane; import junit.framework.TestCase; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Java file locks test. */ +@RunWith(JUnit4.class) public class FileLocksTest extends TestCase { /** File path (on Windows file will be created under the root directory of the current drive). */ private static final String LOCK_FILE_PATH = "/test-java-file-lock-tmp.bin"; @@ -33,6 +37,7 @@ public class FileLocksTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testWriteLocks() throws Exception { final File file = new File(LOCK_FILE_PATH); @@ -77,6 +82,7 @@ public class FileLocksTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testReadLocks() throws Exception { final File file = new File(LOCK_FILE_PATH); @@ -118,4 +124,4 @@ public class FileLocksTest extends TestCase { thread.join(); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/LinkedHashMapTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/LinkedHashMapTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/LinkedHashMapTest.java index 536784e..8155ab5 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/LinkedHashMapTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/LinkedHashMapTest.java @@ -21,12 +21,17 @@ import java.util.LinkedHashMap; import java.util.Map; import junit.framework.TestCase; import org.apache.ignite.internal.util.typedef.X; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for {@link LinkedHashMap}. */ +@RunWith(JUnit4.class) public class LinkedHashMapTest extends TestCase { /** @throws Exception If failed. */ + @Test public void testAccessOrder1() throws Exception { X.println(">>> testAccessOrder1 <<<"); @@ -52,6 +57,7 @@ public class LinkedHashMapTest extends TestCase { } /** @throws Exception If failed. */ + @Test public void testAccessOrder2() throws Exception { X.println(">>> testAccessOrder2 <<<"); @@ -69,6 +75,7 @@ public class LinkedHashMapTest extends TestCase { } /** @throws Exception If failed. */ + @Test public void testAccessOrder3() throws Exception { X.println(">>> testAccessOrder3 <<<"); @@ -84,4 +91,4 @@ public class LinkedHashMapTest extends TestCase { X.println("State after get: " + map); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/NetworkFailureTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/NetworkFailureTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/NetworkFailureTest.java index c331ce9..486265a 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/NetworkFailureTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/NetworkFailureTest.java @@ -32,14 +32,19 @@ import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class NetworkFailureTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testNetworkFailure() throws Exception { final AtomicBoolean done = new AtomicBoolean(); @@ -141,6 +146,7 @@ public class NetworkFailureTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testReadTimeout() throws Exception { final InetAddress addr = InetAddress.getByName("192.168.3.10"); @@ -223,6 +229,7 @@ public class NetworkFailureTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testSocketCloseOnTimeout() throws Exception { final AtomicBoolean done = new AtomicBoolean(); @@ -323,6 +330,7 @@ public class NetworkFailureTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testConnectionTime() throws Exception { X.println("Unexistent host."); checkConnection(InetAddress.getByName("192.168.0.222")); @@ -370,4 +378,4 @@ public class NetworkFailureTest extends TestCase { return sock; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/QueueSizeCounterMultiThreadedTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/QueueSizeCounterMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/QueueSizeCounterMultiThreadedTest.java index 6e7be77..4db09ea 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/QueueSizeCounterMultiThreadedTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/QueueSizeCounterMultiThreadedTest.java @@ -28,14 +28,19 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test to check strange assertion in eviction manager. */ +@RunWith(JUnit4.class) public class QueueSizeCounterMultiThreadedTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testQueueSizeCounter() throws Exception { final ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<>(); @@ -99,4 +104,4 @@ public class QueueSizeCounterMultiThreadedTest extends TestCase { fut1.get(); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/ReadWriteLockMultiThreadedTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/ReadWriteLockMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/ReadWriteLockMultiThreadedTest.java index 666a5a1..f89d846 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/ReadWriteLockMultiThreadedTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/ReadWriteLockMultiThreadedTest.java @@ -25,15 +25,20 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * JDK read write lock test. */ +@RunWith(JUnit4.class) public class ReadWriteLockMultiThreadedTest extends TestCase { /** * @throws Exception If failed. */ @SuppressWarnings({"LockAcquiredButNotSafelyReleased"}) + @Test public void testReadThenWriteLockAcquire() throws Exception { ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -45,6 +50,7 @@ public class ReadWriteLockMultiThreadedTest extends TestCase { /** * */ + @Test public void testNotOwnedLockRelease() { ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -55,6 +61,7 @@ public class ReadWriteLockMultiThreadedTest extends TestCase { * @throws Exception If failed. */ @SuppressWarnings({"LockAcquiredButNotSafelyReleased"}) + @Test public void testWriteLockAcquire() throws Exception { final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -124,6 +131,7 @@ public class ReadWriteLockMultiThreadedTest extends TestCase { * @throws Exception If failed. */ @SuppressWarnings({"LockAcquiredButNotSafelyReleased"}) + @Test public void testReadLockAcquire() throws Exception { final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -169,6 +177,7 @@ public class ReadWriteLockMultiThreadedTest extends TestCase { * @throws Exception If failed. */ @SuppressWarnings({"LockAcquiredButNotSafelyReleased"}) + @Test public void testTryWriteLock() throws Exception { final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -204,4 +213,4 @@ public class ReadWriteLockMultiThreadedTest extends TestCase { fut.get(); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/RegExpTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/RegExpTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/RegExpTest.java index 9b8c4bd..6d90611 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/RegExpTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/RegExpTest.java @@ -22,14 +22,19 @@ import java.util.regex.Pattern; import junit.framework.TestCase; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Java reg exp test. */ +@RunWith(JUnit4.class) public class RegExpTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testRegExp() throws Exception { String normal = "swap-spaces/space1/b53b3a3d6ab90ce0268229151c9bde11|b53b3a3d6ab90ce0268229151c9bde11|1315392441288"; @@ -53,4 +58,4 @@ public class RegExpTest extends TestCase { assert normal.matches(ptrn); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/jvmtest/ServerSocketMultiThreadedTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/ServerSocketMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/ServerSocketMultiThreadedTest.java index f6fe7db..1aee5f1 100644 --- a/modules/core/src/test/java/org/apache/ignite/jvmtest/ServerSocketMultiThreadedTest.java +++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/ServerSocketMultiThreadedTest.java @@ -29,6 +29,9 @@ import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Java server socket test. @@ -37,6 +40,7 @@ import org.jetbrains.annotations.Nullable; * BindException or SocketException may be thrown. Purpose of this test is * to find some explanation to that. */ +@RunWith(JUnit4.class) public class ServerSocketMultiThreadedTest extends TestCase { /** */ private static final int THREADS_CNT = 10; @@ -47,6 +51,7 @@ public class ServerSocketMultiThreadedTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testConcurrentBind() throws Exception { final AtomicInteger bindExCnt = new AtomicInteger(); final AtomicInteger sockExCnt = new AtomicInteger(); @@ -100,4 +105,4 @@ public class ServerSocketMultiThreadedTest extends TestCase { X.println("Test stats [bindExCnt=" + bindExCnt.get() + ", sockExCnt=" + sockExCnt.get() + ", okCnt=" + okCnt + ']'); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/lang/GridByteArrayListSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridByteArrayListSelfTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridByteArrayListSelfTest.java index aad28ea..f99277c 100644 --- a/modules/core/src/test/java/org/apache/ignite/lang/GridByteArrayListSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/lang/GridByteArrayListSelfTest.java @@ -25,15 +25,20 @@ import org.apache.ignite.internal.util.GridByteArrayList; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ @GridCommonTest(group = "Lang") +@RunWith(JUnit4.class) public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testCapacity() { int cap = 10; @@ -64,6 +69,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testAddSetByte() { GridByteArrayList list = new GridByteArrayList(10); @@ -83,6 +89,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testAddSetInteger() { GridByteArrayList list = new GridByteArrayList(10); @@ -118,6 +125,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testAddByteArray() { GridByteArrayList list = new GridByteArrayList(3); @@ -140,6 +148,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testAddByteBuffer() { GridByteArrayList list = new GridByteArrayList(3); @@ -167,6 +176,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { * */ @SuppressWarnings({"ErrorNotRethrown"}) + @Test public void testBounds() { GridByteArrayList list = new GridByteArrayList(3); @@ -201,6 +211,7 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRead() throws Exception { GridByteArrayList list = new GridByteArrayList(10); @@ -212,4 +223,4 @@ public class GridByteArrayListSelfTest extends GridCommonAbstractTest { assert Arrays.equals(list.array(), arr); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java index b7c2262..1d688db 100644 --- a/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java @@ -23,11 +23,15 @@ import org.apache.ignite.internal.util.lang.GridIterator; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * GridFunc performance test. */ @GridCommonTest(group = "Lang") +@RunWith(JUnit4.class) public class GridFuncPerformanceTest extends GridCommonAbstractTest { /** * Creates test. @@ -39,6 +43,7 @@ public class GridFuncPerformanceTest extends GridCommonAbstractTest { /** * */ + @Test public void testTransformingIteratorPerformance() { // Warmup. testBody(); @@ -98,4 +103,4 @@ public class GridFuncPerformanceTest extends GridCommonAbstractTest { return duration; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterLoadTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterLoadTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterLoadTest.java index f411f31..bc4c55e 100644 --- a/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterLoadTest.java +++ b/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterLoadTest.java @@ -22,11 +22,15 @@ import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.processors.cache.eviction.GridCacheMockEntry; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Check how much memory and time required to fill 1_000_000 entries with meta. * Do not include this test to suits. */ +@RunWith(JUnit4.class) public class GridMetadataAwareAdapterLoadTest extends GridCommonAbstractTest { /** Creates test. */ public GridMetadataAwareAdapterLoadTest() { @@ -40,6 +44,7 @@ public class GridMetadataAwareAdapterLoadTest extends GridCommonAbstractTest { * * @throws Exception */ + @Test public void test() throws Exception { String[] dic = new String[1_000_000];
