http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java ---------------------------------------------------------------------- diff --git a/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java b/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java index d8c15ea..029ff6e 100644 --- a/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java +++ b/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java @@ -53,14 +53,16 @@ import org.eclipse.paho.client.mqttv3.MqttConnectOptions; import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; -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.events.EventType.EVT_CACHE_OBJECT_PUT; /** * Test for {@link MqttStreamer}. */ +@RunWith(JUnit4.class) public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** The test data. */ private static final Map<Integer, String> TEST_DATA = new HashMap<>(); @@ -105,9 +107,8 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ - @Before @SuppressWarnings("unchecked") - public void beforeTest() throws Exception { + @Override public void beforeTest() throws Exception { grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration()); // find an available local port @@ -153,8 +154,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ - @After - public void afterTest() throws Exception { + @Override public void afterTest() throws Exception { try { streamer.stop(); } @@ -173,6 +173,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConnectDisconnect() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -194,6 +195,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConnectionStatusWithBrokerDisconnection() throws Exception { fail("https://issues.apache.org/jira/browse/IGNITE-2255"); @@ -225,6 +227,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleTopic_NoQoS_OneEntryPerMessage() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -247,6 +250,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMultipleTopics_NoQoS_OneEntryPerMessage() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -273,6 +277,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleTopic_NoQoS_MultipleEntriesOneMessage() throws Exception { // configure streamer streamer.setMultipleTupleExtractor(multipleTupleExtractor()); @@ -295,6 +300,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMultipleTopics_NoQoS_MultipleEntriesOneMessage() throws Exception { // configure streamer streamer.setMultipleTupleExtractor(multipleTupleExtractor()); @@ -321,6 +327,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleTopic_NoQoS_ConnectOptions_Durable() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -362,6 +369,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleTopic_NoQoS_Reconnect() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -408,6 +416,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleTopic_NoQoS_RetryOnce() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -447,6 +456,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMultipleTopics_MultipleQoS_OneEntryPerMessage() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor()); @@ -474,6 +484,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMultipleTopics_MultipleQoS_Mismatch() throws Exception { // configure streamer streamer.setSingleTupleExtractor(singleTupleExtractor());
http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridRestSuite.java ---------------------------------------------------------------------- diff --git a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridRestSuite.java b/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridRestSuite.java index c69ce7f..d02b614 100644 --- a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridRestSuite.java +++ b/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridRestSuite.java @@ -16,6 +16,7 @@ */ package org.apache.ignite.internal.processors.rest.protocols.http.jetty; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; /** @@ -28,7 +29,7 @@ public class GridRestSuite extends TestSuite { public static TestSuite suite() { TestSuite suite = new TestSuite("Apache Ignite REST Api suite"); - suite.addTest(new TestSuite(RestSetupSimpleTest.class)); + suite.addTest(new JUnit4TestAdapter(RestSetupSimpleTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestSetupSimpleTest.java ---------------------------------------------------------------------- diff --git a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestSetupSimpleTest.java b/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestSetupSimpleTest.java index 7c076f7..93fdbcf 100644 --- a/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestSetupSimpleTest.java +++ b/modules/rest-http/src/test/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestSetupSimpleTest.java @@ -26,10 +26,14 @@ import java.util.Map; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Integration test for Grid REST functionality; Jetty is under the hood. */ +@RunWith(JUnit4.class) public class RestSetupSimpleTest extends GridCommonAbstractTest { /** Jetty port. */ private static final int JETTY_PORT = 8080; @@ -56,6 +60,7 @@ public class RestSetupSimpleTest extends GridCommonAbstractTest { /** * Runs version command using GridJettyRestProtocol. */ + @Test public void testVersionCommand() throws Exception { URLConnection conn = new URL("http://localhost:" + JETTY_PORT + "/ignite?cmd=version").openConnection(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java ---------------------------------------------------------------------- diff --git a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java b/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java index 606a6d1..cbc710a 100644 --- a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java +++ b/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java @@ -38,6 +38,9 @@ import org.apache.rocketmq.common.TopicConfig; import org.apache.rocketmq.common.message.Message; import org.apache.rocketmq.common.message.MessageExt; import org.apache.rocketmq.tools.admin.DefaultMQAdminExt; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT; import static org.apache.ignite.stream.rocketmq.TestRocketMQServer.NAME_SERVER_PORT; @@ -46,6 +49,7 @@ import static org.apache.ignite.stream.rocketmq.TestRocketMQServer.TEST_IP; /** * Test for {@link RocketMQStreamer}. */ +@RunWith(JUnit4.class) public class RocketMQStreamerTest extends GridCommonAbstractTest { /** Test topic. */ private static final String TOPIC_NAME = "testTopic"; @@ -91,6 +95,7 @@ public class RocketMQStreamerTest extends GridCommonAbstractTest { * * @throws Exception If fails. */ + @Test public void testStreamer() throws Exception { RocketMQStreamer<String, byte[]> streamer = null; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTestSuite.java b/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTestSuite.java index 127b442..4e54969 100644 --- a/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTestSuite.java +++ b/modules/rocketmq/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.stream.rocketmq; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; /** @@ -25,12 +26,11 @@ import junit.framework.TestSuite; public class RocketMQStreamerTestSuite extends TestSuite { /** * @return Test suite. - * @throws Exception Thrown in case of the failure. */ - public static TestSuite suite() throws Exception { + public static TestSuite suite() { TestSuite suite = new TestSuite("Apache RocketMQ streamer Test Suite"); - suite.addTest(new TestSuite(RocketMQStreamerTest.class)); + suite.addTest(new JUnit4TestAdapter(RocketMQStreamerTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java index 992deb5..bb4e9fc 100644 --- a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java +++ b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java @@ -39,6 +39,9 @@ import org.apache.ignite.resources.LoggerResource; import org.apache.ignite.scheduler.SchedulerFuture; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.ignite.testframework.GridTestUtils.assertThrows; @@ -47,6 +50,7 @@ import static org.apache.ignite.testframework.GridTestUtils.assertThrows; * Test for task scheduler. */ @SuppressWarnings({"ProhibitedExceptionDeclared", "TooBroadScope"}) +@RunWith(JUnit4.class) public class GridScheduleSelfTest extends GridCommonAbstractTest { /** */ private static final int NODES_CNT = 2; @@ -89,6 +93,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRunLocal() throws Exception { for (int i = 0; i < NODES_CNT; i++) { IgniteFuture<?> fut = grid(i).scheduler().runLocal(new TestRunnable()); @@ -102,6 +107,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCallLocal() throws Exception { for (int i = 0; i < NODES_CNT; i++) { IgniteFuture<?> fut = grid(i).scheduler().callLocal(new TestCallable()); @@ -115,6 +121,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testScheduleRunnable() throws Exception { final CountDownLatch latch = new CountDownLatch(1); @@ -232,6 +239,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testScheduleCallable() throws Exception { SchedulerFuture<Integer> fut = null; @@ -289,6 +297,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRunnableCancel() throws Exception { SchedulerFuture fut = null; @@ -339,6 +348,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInvalidPatterns() throws Exception { Runnable run = new Runnable() { @Override public void run() { @@ -410,6 +420,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNoNextExecutionTime() throws Exception { Callable<Integer> run = new Callable<Integer>() { @Override public Integer call() { @@ -508,4 +519,4 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest { return execCntr.incrementAndGet(); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/schedule/src/test/java/org/apache/ignite/testsuites/IgniteSchedulerTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/schedule/src/test/java/org/apache/ignite/testsuites/IgniteSchedulerTestSuite.java b/modules/schedule/src/test/java/org/apache/ignite/testsuites/IgniteSchedulerTestSuite.java index 688c3eb..7fc82ae 100644 --- a/modules/schedule/src/test/java/org/apache/ignite/testsuites/IgniteSchedulerTestSuite.java +++ b/modules/schedule/src/test/java/org/apache/ignite/testsuites/IgniteSchedulerTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.testsuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.internal.processors.schedule.GridScheduleSelfTest; @@ -26,13 +27,12 @@ import org.apache.ignite.internal.processors.schedule.GridScheduleSelfTest; public class IgniteSchedulerTestSuite extends TestSuite { /** * @return Test suite. - * @throws Exception Thrown in case of the failure. */ - public static TestSuite suite() throws Exception { + public static TestSuite suite() { TestSuite suite = new TestSuite("Grid Scheduler Test Suite"); - suite.addTestSuite(GridScheduleSelfTest.class); + suite.addTest(new JUnit4TestAdapter(GridScheduleSelfTest.class)); return suite; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/slf4j/src/test/java/org/apache/ignite/logger/slf4j/Slf4jLoggerMarkerTest.java ---------------------------------------------------------------------- diff --git a/modules/slf4j/src/test/java/org/apache/ignite/logger/slf4j/Slf4jLoggerMarkerTest.java b/modules/slf4j/src/test/java/org/apache/ignite/logger/slf4j/Slf4jLoggerMarkerTest.java index 578e6ba..03fb6c5 100644 --- a/modules/slf4j/src/test/java/org/apache/ignite/logger/slf4j/Slf4jLoggerMarkerTest.java +++ b/modules/slf4j/src/test/java/org/apache/ignite/logger/slf4j/Slf4jLoggerMarkerTest.java @@ -20,11 +20,15 @@ package org.apache.ignite.logger.slf4j; import java.io.File; 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; import org.slf4j.LoggerFactory; /** * Testing that markers are supported by log4j2 implementation. */ +@RunWith(JUnit4.class) public class Slf4jLoggerMarkerTest extends TestCase { /** Path to full log. */ private static final String LOG_ALL = "work/log/all.log"; @@ -47,6 +51,7 @@ public class Slf4jLoggerMarkerTest extends TestCase { } /** */ + @Test public void testMarkerFiltering() throws Exception { // create log Slf4jLogger log = new Slf4jLogger(LoggerFactory.getLogger(Slf4jLoggerMarkerTest.class)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/slf4j/src/test/java/org/apache/ignite/testsuites/IgniteSlf4jTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/slf4j/src/test/java/org/apache/ignite/testsuites/IgniteSlf4jTestSuite.java b/modules/slf4j/src/test/java/org/apache/ignite/testsuites/IgniteSlf4jTestSuite.java index 8668f92..abf1eb8 100644 --- a/modules/slf4j/src/test/java/org/apache/ignite/testsuites/IgniteSlf4jTestSuite.java +++ b/modules/slf4j/src/test/java/org/apache/ignite/testsuites/IgniteSlf4jTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.testsuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.logger.slf4j.Slf4jLoggerMarkerTest; @@ -30,7 +31,7 @@ public class IgniteSlf4jTestSuite extends TestSuite { public static TestSuite suite() { TestSuite suite = new TestSuite("Slf4j Logging Test Suite"); - suite.addTestSuite(Slf4jLoggerMarkerTest.class); + suite.addTest(new JUnit4TestAdapter(Slf4jLoggerMarkerTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java index 49bb1ac..85799d3 100644 --- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java +++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java @@ -37,11 +37,15 @@ import org.apache.spark.api.java.function.PairFunction; import org.apache.spark.sql.Column; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import scala.Tuple2; /** * Tests for {@link JavaIgniteRDD} (embedded mode). */ +@RunWith(JUnit4.class) public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** For Ignite instance names generation */ private static AtomicInteger cntr = new AtomicInteger(1); @@ -64,7 +68,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** Sum function. */ private static final Function2<Integer, Integer, Integer> SUM_F = new Function2<Integer, Integer, Integer>() { - public Integer call(Integer x, Integer y) { + @Override public Integer call(Integer x, Integer y) { return x + y; } }; @@ -120,6 +124,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStoreDataToIgnite() throws Exception { JavaSparkContext sc = createContext(); @@ -153,6 +158,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testReadDataFromIgnite() throws Exception { JavaSparkContext sc = createContext(); @@ -187,6 +193,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryObjectsFromIgnite() throws Exception { JavaSparkContext sc = createContext(); @@ -225,6 +232,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryFieldsFromIgnite() throws Exception { JavaSparkContext sc = createContext(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java index 29ada3f..1ec637c 100644 --- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java +++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java @@ -37,6 +37,9 @@ import org.apache.spark.api.java.function.PairFunction; import org.apache.spark.sql.Column; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import scala.Tuple2; import java.lang.reflect.Field; @@ -46,6 +49,7 @@ import java.util.List; /** * Tests for {@link JavaIgniteRDD} (standalone mode). */ +@RunWith(JUnit4.class) public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** Grid count. */ private static final int GRID_CNT = 3; @@ -64,7 +68,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** Sum function. */ private static final Function2<Integer, Integer, Integer> SUM_F = new Function2<Integer, Integer, Integer>() { - public Integer call(Integer x, Integer y) { + @Override public Integer call(Integer x, Integer y) { return x + y; } }; @@ -120,6 +124,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStoreDataToIgnite() throws Exception { JavaSparkContext sc = new JavaSparkContext("local[*]", "test"); @@ -148,6 +153,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testReadDataFromIgnite() throws Exception { JavaSparkContext sc = new JavaSparkContext("local[*]", "test"); @@ -177,6 +183,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryObjectsFromIgnite() throws Exception { JavaSparkContext sc = new JavaSparkContext("local[*]", "test"); @@ -204,6 +211,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryFieldsFromIgnite() throws Exception { JavaSparkContext sc = new JavaSparkContext("local[*]", "test"); @@ -249,6 +257,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAllFieldsTypes() throws Exception { JavaSparkContext sc = new JavaSparkContext("local[*]", "test"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spark/src/test/java/org/apache/ignite/testsuites/IgniteRDDTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/spark/src/test/java/org/apache/ignite/testsuites/IgniteRDDTestSuite.java b/modules/spark/src/test/java/org/apache/ignite/testsuites/IgniteRDDTestSuite.java index 9d6227b..75534f1 100644 --- a/modules/spark/src/test/java/org/apache/ignite/testsuites/IgniteRDDTestSuite.java +++ b/modules/spark/src/test/java/org/apache/ignite/testsuites/IgniteRDDTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.testsuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.spark.JavaEmbeddedIgniteRDDSelfTest; import org.apache.ignite.spark.JavaStandaloneIgniteRDDSelfTest; @@ -27,13 +28,12 @@ import org.apache.ignite.spark.JavaStandaloneIgniteRDDSelfTest; public class IgniteRDDTestSuite extends TestSuite { /** * @return Java Ignite RDD test suit. - * @throws Exception If failed. */ - public static TestSuite suite() throws Exception { + public static TestSuite suite() { TestSuite suite = new TestSuite("Java Ignite RDD tests (standalone and embedded modes"); - suite.addTest(new TestSuite(JavaEmbeddedIgniteRDDSelfTest.class)); - suite.addTest(new TestSuite(JavaStandaloneIgniteRDDSelfTest.class)); + suite.addTest(new JUnit4TestAdapter(JavaEmbeddedIgniteRDDSelfTest.class)); + suite.addTest(new JUnit4TestAdapter(JavaStandaloneIgniteRDDSelfTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java b/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java index 766b2a8..5e717bf 100644 --- a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java +++ b/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java @@ -26,11 +26,15 @@ import org.apache.ignite.springdata.misc.ApplicationConfiguration; import org.apache.ignite.springdata.misc.Person; import org.apache.ignite.springdata.misc.PersonRepository; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.context.annotation.AnnotationConfigApplicationContext; /** * */ +@RunWith(JUnit4.class) public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** Repository. */ private static PersonRepository repo; @@ -80,6 +84,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testPutGet() { Person person = new Person("some_name", "some_surname"); @@ -104,6 +109,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testPutAllGetAll() { LinkedHashMap<Integer, Person> map = new LinkedHashMap<>(); @@ -143,6 +149,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testGetAll() { assertEquals(CACHE_SIZE, repo.count()); @@ -161,6 +168,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDelete() { assertEquals(CACHE_SIZE, repo.count()); @@ -182,6 +190,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDeleteSet() { assertEquals(CACHE_SIZE, repo.count()); @@ -212,6 +221,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDeleteAll() { assertEquals(CACHE_SIZE, repo.count()); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java b/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java index c03c9c8..68ff6e7 100644 --- a/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java +++ b/modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.springdata.misc.PersonRepository; import org.apache.ignite.springdata.misc.Person; import org.apache.ignite.springdata.misc.PersonSecondRepository; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; @@ -34,6 +37,7 @@ import org.springframework.data.domain.Sort; /** * */ +@RunWith(JUnit4.class) public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { /** Repository. */ private static PersonRepository repo; @@ -76,6 +80,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testExplicitQuery() { List<Person> persons = repo.simpleQuery("person4a"); @@ -86,6 +91,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testEqualsPart() { List<Person> persons = repo.findByFirstName("person4e"); @@ -96,6 +102,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testContainingPart() { List<Person> persons = repo.findByFirstNameContaining("person4"); @@ -106,6 +113,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testTopPart() { Iterable<Person> top = repo.findTopByFirstNameContaining("person4"); @@ -119,6 +127,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testLikeAndLimit() { Iterable<Person> like = repo.findFirst10ByFirstNameLike("person"); @@ -134,6 +143,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCount() { int cnt = repo.countByFirstNameLike("person"); @@ -141,6 +151,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCount2() { int cnt = repo.countByFirstNameLike("person4"); @@ -148,6 +159,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testPageable() { PageRequest pageable = new PageRequest(1, 5, Sort.Direction.DESC, "firstName"); @@ -177,6 +189,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testAndAndOr() { int cntAnd = repo.countByFirstNameLikeAndSecondNameLike("person1", "lastName1"); @@ -186,6 +199,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryWithSort() { List<Person> persons = repo.queryWithSort("^[a-z]+$", new Sort(Sort.Direction.DESC, "secondName")); @@ -201,6 +215,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryWithPaging() { List<Person> persons = repo.queryWithPageable("^[a-z]+$", new PageRequest(1, 7, Sort.Direction.DESC, "secondName")); @@ -218,6 +233,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryFields() { List<String> persons = repo.selectField("^[a-z]+$", new PageRequest(1, 7, Sort.Direction.DESC, "secondName")); @@ -225,6 +241,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindCacheEntries() { List<Cache.Entry<Integer, Person>> cacheEntries = repo.findBySecondNameLike("stName1"); @@ -235,6 +252,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindOneCacheEntry() { Cache.Entry<Integer, Person> cacheEntry = repo.findTopBySecondNameLike("tName18"); @@ -244,6 +262,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindOneValue() { Person person = repo.findTopBySecondNameStartingWith("lastName18"); @@ -253,6 +272,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSelectSeveralFields() { List<List> lists = repo.selectSeveralField("^[a-z]+$", new PageRequest(2, 6)); @@ -266,6 +286,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCountQuery() { int cnt = repo.countQuery(".*"); @@ -273,6 +294,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSliceOfCacheEntries() { Slice<Cache.Entry<Integer, Person>> slice = repo2.findBySecondNameIsNot("lastName18", new PageRequest(3, 4)); @@ -283,6 +305,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSliceOfLists() { Slice<List> lists = repo2.querySliceOfList("^[a-z]+$", new PageRequest(0, 3)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data-2.0/src/test/java/org/apache/ignite/testsuites/IgniteSpringData2TestSuite.java ---------------------------------------------------------------------- diff --git a/modules/spring-data-2.0/src/test/java/org/apache/ignite/testsuites/IgniteSpringData2TestSuite.java b/modules/spring-data-2.0/src/test/java/org/apache/ignite/testsuites/IgniteSpringData2TestSuite.java index c4134e5..edfd57f 100644 --- a/modules/spring-data-2.0/src/test/java/org/apache/ignite/testsuites/IgniteSpringData2TestSuite.java +++ b/modules/spring-data-2.0/src/test/java/org/apache/ignite/testsuites/IgniteSpringData2TestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.testsuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.springdata.IgniteSpringDataCrudSelfTest; import org.apache.ignite.springdata.IgniteSpringDataQueriesSelfTest; @@ -27,13 +28,12 @@ import org.apache.ignite.springdata.IgniteSpringDataQueriesSelfTest; public class IgniteSpringData2TestSuite extends TestSuite { /** * @return Test suite. - * @throws Exception Thrown in case of the failure. */ - public static TestSuite suite() throws Exception { + public static TestSuite suite() { TestSuite suite = new TestSuite("Spring Data 2.0 Test Suite"); - suite.addTestSuite(IgniteSpringDataCrudSelfTest.class); - suite.addTestSuite(IgniteSpringDataQueriesSelfTest.class); + suite.addTest(new JUnit4TestAdapter(IgniteSpringDataCrudSelfTest.class)); + suite.addTest(new JUnit4TestAdapter(IgniteSpringDataQueriesSelfTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java b/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java index f9011fa..155e784 100644 --- a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java +++ b/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java @@ -25,11 +25,15 @@ import org.apache.ignite.springdata.misc.ApplicationConfiguration; import org.apache.ignite.springdata.misc.Person; import org.apache.ignite.springdata.misc.PersonRepository; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.context.annotation.AnnotationConfigApplicationContext; /** * */ +@RunWith(JUnit4.class) public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** Repository. */ private static PersonRepository repo; @@ -79,6 +83,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testPutGet() { Person person = new Person("some_name", "some_surname"); @@ -103,6 +108,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testPutAllGetAll() { LinkedHashMap<Integer, Person> map = new LinkedHashMap<>(); @@ -142,6 +148,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testGetAll() { assertEquals(CACHE_SIZE, repo.count()); @@ -160,6 +167,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDelete() { assertEquals(CACHE_SIZE, repo.count()); @@ -181,6 +189,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDeleteSet() { assertEquals(CACHE_SIZE, repo.count()); @@ -211,6 +220,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDeleteAll() { assertEquals(CACHE_SIZE, repo.count()); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java b/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java index 2d7dcc0..d7678c6 100644 --- a/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java +++ b/modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataQueriesSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.springdata.misc.PersonRepository; import org.apache.ignite.springdata.misc.Person; import org.apache.ignite.springdata.misc.PersonSecondRepository; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; @@ -34,6 +37,7 @@ import org.springframework.data.domain.Sort; /** * */ +@RunWith(JUnit4.class) public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { /** Repository. */ private static PersonRepository repo; @@ -70,6 +74,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testExplicitQuery() { List<Person> persons = repo.simpleQuery("person4a"); @@ -80,6 +85,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testEqualsPart() { List<Person> persons = repo.findByFirstName("person4e"); @@ -90,6 +96,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testContainingPart() { List<Person> persons = repo.findByFirstNameContaining("person4"); @@ -100,6 +107,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testTopPart() { Iterable<Person> top = repo.findTopByFirstNameContaining("person4"); @@ -113,6 +121,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testLikeAndLimit() { Iterable<Person> like = repo.findFirst10ByFirstNameLike("person"); @@ -128,6 +137,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCount() { int cnt = repo.countByFirstNameLike("person"); @@ -135,6 +145,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCount2() { int cnt = repo.countByFirstNameLike("person4"); @@ -142,6 +153,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testPageable() { PageRequest pageable = new PageRequest(1, 5, Sort.Direction.DESC, "firstName"); @@ -169,6 +181,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testAndAndOr() { int cntAnd = repo.countByFirstNameLikeAndSecondNameLike("person1", "lastName1"); @@ -178,6 +191,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryWithSort() { List<Person> persons = repo.queryWithSort("^[a-z]+$", new Sort(Sort.Direction.DESC, "secondName")); @@ -193,6 +207,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryWithPaging() { List<Person> persons = repo.queryWithPageable("^[a-z]+$", new PageRequest(1, 7, Sort.Direction.DESC, "secondName")); @@ -210,6 +225,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testQueryFields() { List<String> persons = repo.selectField("^[a-z]+$", new PageRequest(1, 7, Sort.Direction.DESC, "secondName")); @@ -217,6 +233,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindCacheEntries() { List<Cache.Entry<Integer, Person>> cacheEntries = repo.findBySecondNameLike("stName1"); @@ -227,6 +244,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindOneCacheEntry() { Cache.Entry<Integer, Person> cacheEntry = repo.findTopBySecondNameLike("tName18"); @@ -236,6 +254,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testFindOneValue() { Person person = repo.findTopBySecondNameStartingWith("lastName18"); @@ -245,6 +264,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSelectSeveralFields() { List<List> lists = repo.selectSeveralField("^[a-z]+$", new PageRequest(2, 6)); @@ -258,6 +278,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testCountQuery() { int cnt = repo.countQuery(".*"); @@ -265,6 +286,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSliceOfCacheEntries() { Slice<Cache.Entry<Integer, Person>> slice = repo2.findBySecondNameIsNot("lastName18", new PageRequest(3, 4)); @@ -275,6 +297,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { } /** */ + @Test public void testSliceOfLists() { Slice<List> lists = repo2.querySliceOfList("^[a-z]+$", new PageRequest(0, 3)); @@ -290,6 +313,7 @@ public class IgniteSpringDataQueriesSelfTest extends GridCommonAbstractTest { /** * Tests the repository method with a custom query which takes no parameters. */ + @Test public void testCountAllPersons() { int cnt = repo.countAllPersons(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring-data/src/test/java/org/apache/ignite/testsuites/IgniteSpringDataTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/spring-data/src/test/java/org/apache/ignite/testsuites/IgniteSpringDataTestSuite.java b/modules/spring-data/src/test/java/org/apache/ignite/testsuites/IgniteSpringDataTestSuite.java index 0d6c519..6ac72fb 100644 --- a/modules/spring-data/src/test/java/org/apache/ignite/testsuites/IgniteSpringDataTestSuite.java +++ b/modules/spring-data/src/test/java/org/apache/ignite/testsuites/IgniteSpringDataTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.testsuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.springdata.IgniteSpringDataCrudSelfTest; import org.apache.ignite.springdata.IgniteSpringDataQueriesSelfTest; @@ -27,13 +28,12 @@ import org.apache.ignite.springdata.IgniteSpringDataQueriesSelfTest; public class IgniteSpringDataTestSuite extends TestSuite { /** * @return Test suite. - * @throws Exception Thrown in case of the failure. */ - public static TestSuite suite() throws Exception { + public static TestSuite suite() { TestSuite suite = new TestSuite("Spring Data Test Suite"); - suite.addTestSuite(IgniteSpringDataCrudSelfTest.class); - suite.addTestSuite(IgniteSpringDataQueriesSelfTest.class); + suite.addTest(new JUnit4TestAdapter(IgniteSpringDataCrudSelfTest.class)); + suite.addTest(new JUnit4TestAdapter(IgniteSpringDataQueriesSelfTest.class)); return suite; } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerAbstractTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerAbstractTest.java index 370c634..bed8574 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerAbstractTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerAbstractTest.java @@ -22,10 +22,14 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.configuration.CacheConfiguration; 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; /** * Spring cache test. */ +@RunWith(JUnit4.class) public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstractTest { /** */ protected static final String CACHE_NAME = "testCache"; @@ -61,6 +65,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testSimpleKey() throws Exception { for (int i = 0; i < 3; i++) { assertEquals("value" + i, svc.simpleKey(i)); @@ -80,6 +85,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testSimpleKeyNullValue() throws Exception { for (int i = 0; i < 3; i++) { assertNull(svc.simpleKeyNullValue(i)); @@ -99,6 +105,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testComplexKey() throws Exception { for (int i = 0; i < 3; i++) { assertEquals("value" + i + "suffix" + i, svc.complexKey(i, "suffix" + i)); @@ -118,6 +125,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testComplexKeyNullValue() throws Exception { for (int i = 0; i < 3; i++) { assertNull(svc.complexKeyNullValue(i, "suffix" + i)); @@ -137,6 +145,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testSimpleKeyPut() throws Exception { IgniteCache<Integer, String> c = grid().cache(CACHE_NAME); @@ -158,6 +167,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testSimpleKeyPutNullValue() throws Exception { IgniteCache<Integer, String> c = grid().cache(CACHE_NAME); @@ -179,6 +189,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testComplexKeyPut() throws Exception { IgniteCache<GridSpringCacheTestKey, String> c = grid().cache(CACHE_NAME); @@ -200,6 +211,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testComplexKeyPutNullValue() throws Exception { IgniteCache<GridSpringCacheTestKey, String> c = grid().cache(CACHE_NAME); @@ -221,6 +233,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testSimpleKeyEvict() throws Exception { IgniteCache<Integer, String> c = grid().cache(CACHE_NAME); @@ -245,6 +258,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testComplexKeyEvict() throws Exception { IgniteCache<GridSpringCacheTestKey, String> c = grid().cache(CACHE_NAME); @@ -269,6 +283,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testEvictAll() throws Exception { IgniteCache<Integer, String> c = grid().cache(CACHE_NAME); @@ -289,6 +304,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testDynamicCache() throws Exception { for (int i = 0; i < 3; i++) { assertEquals("value" + i, dynamicSvc.cacheable(i)); @@ -311,6 +327,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testDynamicCachePut() throws Exception { for (int i = 0; i < 3; i++) { assertEquals("value" + i, dynamicSvc.cachePut(i)); @@ -333,6 +350,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testDynamicCacheEvict() throws Exception { CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME); @@ -360,6 +378,7 @@ public abstract class GridSpringCacheManagerAbstractTest extends GridCommonAbstr /** * @throws Exception If failed. */ + @Test public void testDynamicCacheEvictAll() throws Exception { CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java index acf09a7..0b3f707 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java @@ -29,12 +29,16 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.multijvm.IgniteProcessProxy; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * Spring cache test in multi jvm environment. */ +@RunWith(JUnit4.class) public class GridSpringCacheManagerMultiJvmSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected boolean isMultiJvm() { @@ -54,6 +58,7 @@ public class GridSpringCacheManagerMultiJvmSelfTest extends GridCommonAbstractTe /** * @throws Exception If failed. */ + @Test public void testSyncCache() throws Exception { fail("https://issues.apache.org/jira/browse/IGNITE-9488"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheManagerContextInjectionTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheManagerContextInjectionTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheManagerContextInjectionTest.java index 482c837..6837360 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheManagerContextInjectionTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheManagerContextInjectionTest.java @@ -23,6 +23,9 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgnitionEx; import org.apache.ignite.lifecycle.LifecycleBean; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; @@ -31,10 +34,12 @@ import org.springframework.context.annotation.Configuration; /** * */ +@RunWith(JUnit4.class) public class SpringCacheManagerContextInjectionTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBeanInjectionUsingConfigPath() throws Exception { new AnnotationConfigApplicationContext(TestPathConfiguration.class); @@ -56,6 +61,7 @@ public class SpringCacheManagerContextInjectionTest extends GridCommonAbstractTe /** * @throws Exception If failed. */ + @Test public void testBeanInjectionUsingConfiguration() throws Exception { BeanFactory factory = new AnnotationConfigApplicationContext(TestCfgConfiguration.class); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java index 53c52f8..3b80a63 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java @@ -21,10 +21,14 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link SpringCache} */ +@RunWith(JUnit4.class) public class SpringCacheTest extends GridCommonAbstractTest { /** */ private static Ignite ignite; @@ -70,6 +74,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetName() throws Exception { assertEquals(cacheName, springCache.getName()); } @@ -77,6 +82,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetNativeCache() throws Exception { assertEquals(nativeCache, springCache.getNativeCache()); } @@ -84,6 +90,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetByKey() throws Exception { String key = "key"; String value = "value"; @@ -97,6 +104,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetByKeyType() throws Exception { String key = "key"; String value = "value"; @@ -116,6 +124,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPut() throws Exception { String key = "key"; assertNull(springCache.get(key)); @@ -129,6 +138,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPutIfAbsent() throws Exception { String key = "key"; String expected = "value"; @@ -143,6 +153,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testEvict() throws Exception { String key = "key"; assertNull(springCache.get(key)); @@ -157,6 +168,7 @@ public class SpringCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClear() throws Exception { String key; springCache.put((key = "key1"), "value1"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java index bc4f268..c6a73e0 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java @@ -32,10 +32,14 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.h2.jdbcx.JdbcDataSource; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for Cache JDBC blob store factory. */ +@RunWith(JUnit4.class) public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { /** Cache name. */ private static final String CACHE_NAME = "test"; @@ -46,6 +50,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testXmlConfiguration() throws Exception { try (Ignite ignite = Ignition.start("modules/spring/src/test/config/store-cache.xml")) { try(Ignite ignite1 = Ignition.start("modules/spring/src/test/config/store-cache1.xml")) { @@ -59,6 +64,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCacheConfiguration() throws Exception { try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) { try (Ignite ignite1 = Ignition.start("modules/spring/src/test/config/node1.xml")) { @@ -76,6 +82,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncorrectBeanConfiguration() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java index 0d6d6a2..a6c4d4c 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java @@ -29,10 +29,14 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.h2.jdbcx.JdbcDataSource; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for Cache JDBC POJO store factory. */ +@RunWith(JUnit4.class) public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest { /** Cache name. */ private static final String CACHE_NAME = "test"; @@ -40,6 +44,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCacheConfiguration() throws Exception { try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) { try (Ignite ignite1 = Ignition.start("modules/spring/src/test/config/node1.xml")) { @@ -57,6 +62,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSerializable() throws Exception { try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) { try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfigurationH2Dialect())) { @@ -68,6 +74,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncorrectBeanConfiguration() throws Exception { GridTestUtils.assertThrowsAnyCause(log, new Callable<Object>() { @Override public Object call() throws Exception { http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java index 6488527..962209a 100644 --- a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java @@ -29,10 +29,14 @@ import org.apache.ignite.internal.util.IgniteUtils; import org.apache.ignite.internal.util.typedef.T2; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionKey; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.testframework.GridTestUtils.assertThrowsWithCause; /** */ +@RunWith(JUnit4.class) public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { /** {@inheritDoc} */ @Override protected void createEncryptedCache(IgniteEx grid0, IgniteEx grid1, String cacheName, String cacheGroup) { @@ -63,6 +67,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { } /** @throws Exception If failed. */ + @Test public void testEncryptionKeysEqualsOnThirdNodeJoin() throws Exception { T2<IgniteEx, IgniteEx> g = startTestGrids(true); @@ -97,6 +102,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { } /** @throws Exception If failed. */ + @Test public void testCreateEncryptedCacheGroup() throws Exception { IgniteEx g0 = (IgniteEx)IgnitionEx.start( IgniteUtils.resolveIgnitePath( @@ -134,6 +140,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { } /** @throws Exception If failed. */ + @Test public void testCreateNotEncryptedCacheInEncryptedGroupFails() throws Exception { IgniteEx g0 = (IgniteEx)IgnitionEx.start( IgniteUtils.resolveIgnitePath( @@ -151,6 +158,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { } /** @throws Exception If failed. */ + @Test public void testStartWithEncryptedOnDiskPlainInCfg() throws Exception { doTestDiffCfgAndPersistentFlagVal( "modules/spring/src/test/config/enc/enc-cache.xml", @@ -158,6 +166,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { } /** @throws Exception If failed. */ + @Test public void testStartWithPlainOnDiskEncryptedInCfg() throws Exception { doTestDiffCfgAndPersistentFlagVal( "modules/spring/src/test/config/enc/not-encrypted-cache.xml", http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java index d2d8627..adc959c 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java @@ -66,6 +66,9 @@ import org.apache.ignite.testframework.http.GridEmbeddedHttpServer; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.ConstructorArgumentValues; import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -84,6 +87,7 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP * @see GridFactoryVmShutdownTest */ @GridCommonTest(group = "NonDistributed Kernal Self") +@RunWith(JUnit4.class) public class GridFactorySelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -125,6 +129,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIgnitionStartDefault() throws Exception { try (Ignite ignite = Ignition.start()) { log.info("Started1: " + ignite.name()); @@ -147,6 +152,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartDefault() throws Exception { try (Ignite ignite = Ignition.start("config/default-config.xml")) { log.info("Started: " + ignite.name()); @@ -156,6 +162,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartGridWithConfigUrlString() throws Exception { GridEmbeddedHttpServer srv = null; String igniteInstanceName = "grid_with_url_config"; @@ -179,6 +186,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartGridWithConfigUrl() throws Exception { GridEmbeddedHttpServer srv = null; String igniteInstanceName = "grid_with_url_config"; @@ -202,6 +210,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * Tests default grid */ + @Test public void testDefaultGridGetOrStart() throws Exception { IgniteConfiguration cfg = getConfiguration(null); @@ -225,6 +234,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * Tests named grid */ + @Test public void testNamedGridGetOrStart() throws Exception { IgniteConfiguration cfg = getConfiguration("test"); try (Ignite ignite = Ignition.getOrStart(cfg)) { @@ -248,6 +258,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * Tests concurrent grid initialization */ + @Test public void testConcurrentGridGetOrStartCon() throws Exception { final IgniteConfiguration cfg = getConfiguration(null); @@ -284,6 +295,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLifecycleBeansNullIgniteInstanceName() throws Exception { checkLifecycleBeans(null); } @@ -291,6 +303,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLifecycleBeansNotNullIgniteInstanceName() throws Exception { checkLifecycleBeans("testGrid"); } @@ -363,6 +376,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartMultipleGridsFromSpring() throws Exception { File cfgFile = GridTestUtils.resolveIgnitePath(GridTestProperties.getProperty("loader.self.multipletest.config")); @@ -417,6 +431,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartMultipleDefaultGrids() throws Exception { try { multithreaded( @@ -454,6 +469,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartMultipleNonDefaultGrids() throws Exception { try { multithreaded( @@ -492,6 +508,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConcurrentStartStop() throws Exception { checkConcurrentStartStop("TEST_NAME"); } @@ -499,6 +516,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConcurrentStartStopDefaultGrid() throws Exception { checkConcurrentStartStop(null); } @@ -581,6 +599,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGridStartRollback() throws Exception { GridTestUtils.assertThrows( log, @@ -657,6 +676,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartMultipleInstanceSpi() throws Exception { IgniteConfiguration cfg1 = getConfiguration(); IgniteConfiguration cfg2 = getConfiguration(); @@ -692,6 +712,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLoadBean() throws Exception { final String path = "modules/spring/src/test/java/org/apache/ignite/internal/cache.xml"; @@ -927,6 +948,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStopCancel() throws Exception { IgniteConfiguration cfg = new IgniteConfiguration(); @@ -942,6 +964,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConfigInClassPath() throws Exception { try (Ignite ignite = Ignition.start("config/ignite-test-config.xml")) { assert "config-in-classpath".equals(ignite.name()); @@ -951,6 +974,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCurrentIgnite() throws Exception { final String LEFT = "LEFT"; final String RIGHT = "RIGHT"; @@ -981,6 +1005,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRepeatingStart() throws Exception { try { IgniteConfiguration c = getConfiguration("1"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/GridSpringBeanSerializationSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/GridSpringBeanSerializationSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/GridSpringBeanSerializationSelfTest.java index 6a72213..cf9b97a 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/GridSpringBeanSerializationSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/GridSpringBeanSerializationSelfTest.java @@ -26,10 +26,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; /** * Test for {@link org.apache.ignite.IgniteSpringBean} serialization. */ +@RunWith(JUnit4.class) public class GridSpringBeanSerializationSelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -87,6 +91,7 @@ public class GridSpringBeanSerializationSelfTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testSerialization() throws Exception { assert bean != null; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java index 45655e1..13ed4ac 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java @@ -28,10 +28,14 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.http.GridEmbeddedHttpServer; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for dynamic cache start from config file. */ +@RunWith(JUnit4.class) public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** */ public static final String CACHE_NAME = "TestDynamicCache"; @@ -86,6 +90,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDynamicCacheStartFromConfig() throws Exception { IgniteCache cache = ignite(0).createCache(load( "modules/spring/src/test/java/org/apache/ignite/internal/cache.xml")); @@ -101,6 +106,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDynamicNearCacheStartFromConfig() throws Exception { testAttribute = false; @@ -130,6 +136,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCreateNearCache() throws Exception { testAttribute = false; @@ -162,6 +169,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetOrCreateNearCache() throws Exception { testAttribute = false; @@ -197,6 +205,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDynamicCacheStartFromNotExistConfig() throws Exception { try { ignite(0).getOrCreateCache(load("config/cache.xml")); @@ -211,6 +220,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStartCachedWithConfigUrlString() throws Exception { GridEmbeddedHttpServer srv = null; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java index c7f0d59..03ab32e 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java @@ -19,14 +19,19 @@ package org.apache.ignite.internal; import org.apache.ignite.IgniteSpringBean; 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 IgniteSpringBeanTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInitialization() throws Exception { try (IgniteSpringBean bean = new IgniteSpringBean()) { bean.setConfiguration(getConfiguration("test")); @@ -40,6 +45,7 @@ public class IgniteSpringBeanTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIllegalState() throws Exception { IgniteSpringBean bean = new IgniteSpringBean(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java index 3fc64b5..60a8481 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java @@ -28,10 +28,14 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteCallable; import org.apache.ignite.resources.LoggerResource; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for injected logger category. */ +@RunWith(JUnit4.class) public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest implements Externalizable { /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { @@ -45,6 +49,7 @@ public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest implemen * * @throws Exception If failed. */ + @Test public void testClosureField() throws Exception { Ignite ignite = grid(0); @@ -72,6 +77,7 @@ public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest implemen * * @throws Exception If failed. */ + @Test public void testClosureMethod() throws Exception { Ignite ignite = grid(0); @@ -99,6 +105,7 @@ public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest implemen * * @throws Exception If failed. */ + @Test public void testStringCategory() throws Exception { Ignite ignite = grid(0); @@ -130,4 +137,4 @@ public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest implemen @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // No-op. } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java index 12535a7e..56f1b54 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java @@ -42,12 +42,16 @@ import org.apache.ignite.testframework.junits.GridTestKernalContext; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.springframework.util.Assert; /** * Unit tests for grid resource processor. */ @GridCommonTest(group = "Resource Self") +@RunWith(JUnit4.class) public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** */ private GridTestKernalContext ctx; @@ -116,6 +120,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInjectResourceToAnnotatedField() throws Exception { TestClassWithAnnotatedField target = new TestClassWithAnnotatedField(); @@ -148,6 +153,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInjectResourceToAnnotatedMethod() throws Exception { TestClassWithAnnotatedMethod target = new TestClassWithAnnotatedMethod(); @@ -269,6 +275,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInjectResourceInnerClasses() throws Exception { // Test fields. TestClassWithAnnotationsOuter outer = new TestClassWithAnnotationsOuter(); @@ -383,6 +390,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInjectResourceGridTaskAndJob() throws Exception { Ignite g = startGrid(); @@ -398,6 +406,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInjectResourcePerformance() throws Exception { int injNum = 50000; @@ -417,6 +426,7 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("TooBroadScope") + @Test public void testInjectResourceMultiThreaded() throws Exception { final int threadsCnt = 100; final int iters = 2000000; @@ -475,4 +485,4 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest { @TestAnnotation1 private String val1; } -} \ No newline at end of file +}
