http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java index e44c8ea..532728b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java @@ -30,10 +30,14 @@ import org.apache.ignite.internal.processors.cache.IgniteInternalCache; import org.apache.ignite.internal.util.typedef.F; 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 service reassignment. */ +@RunWith(JUnit4.class) public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstractSelfTest { /** */ private static final String SERVICE_NAME = "testService"; @@ -46,6 +50,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac /** * @throws Exception If failed. */ + @Test public void testClusterSingleton() throws Exception { checkReassigns(1, 1); } @@ -53,6 +58,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac /** * @throws Exception If failed. */ + @Test public void testNodeSingleton() throws Exception { checkReassigns(0, 1); } @@ -60,6 +66,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac /** * @throws Exception If failed. */ + @Test public void testLimited1() throws Exception { checkReassigns(5, 2); } @@ -67,6 +74,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac /** * @throws Exception If failed. */ + @Test public void testLimited2() throws Exception { checkReassigns(7, 3); } @@ -249,4 +257,4 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac } } } -} \ 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/processors/service/GridServiceSerializationSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceSerializationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceSerializationSelfTest.java index 7c0b03d..6693815 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceSerializationSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceSerializationSelfTest.java @@ -34,10 +34,14 @@ 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.apache.ignite.thread.IgniteThread; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Service serialization test. */ +@RunWith(JUnit4.class) public class GridServiceSerializationSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -54,6 +58,7 @@ public class GridServiceSerializationSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testServiceSerialization() throws Exception { try { Ignite server = startGridsMultiThreaded(3); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java index 9ea0652..0ebee6e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java @@ -39,10 +39,14 @@ import org.apache.ignite.services.ServiceContext; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.configvariations.Parameters; import org.apache.ignite.testframework.junits.IgniteConfigVariationsAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Full API services test. */ +@RunWith(JUnit4.class) public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariationsAbstractTest { /** Test service name. */ private static final String SERVICE_NAME = "testService"; @@ -83,6 +87,7 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat * * @throws Exception If failed. */ + @Test public void testNodeSingletonDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(true, new DeployClosure() { @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { @@ -99,6 +104,7 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat * * @throws Exception If failed. */ + @Test public void testClusterSingletonDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(false, new DeployClosure() { @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { @@ -115,6 +121,7 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat * * @throws Exception If failed. */ + @Test public void testKeyAffinityDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(false, new DeployClosure() { @Override public void run(IgniteServices services, String svcName, TestService svc) { @@ -135,6 +142,7 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat * * @throws Exception If failed. */ + @Test public void testMultipleDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(true, new DeployClosure() { @Override public void run(IgniteServices services, String svcName, TestService svc) { @@ -148,6 +156,7 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat * * @throws Exception If failed. */ + @Test public void testDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(false, new DeployClosure() { @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest.java index 000ed20..76738d7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest.java @@ -33,10 +33,14 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestExternalClassLoader; import org.apache.ignite.testframework.config.GridTestProperties; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests that not all nodes in cluster need user's service definition (only nodes according to filter). */ +@RunWith(JUnit4.class) public class IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest extends GridCommonAbstractTest { /** */ private static final String NOOP_SERVICE_CLS_NAME = "org.apache.ignite.tests.p2p.NoopService"; @@ -151,6 +155,7 @@ public class IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest extends G /** * @throws Exception If failed. */ + @Test public void testServiceDeployment1() throws Exception { startGrid(0).services().deploy(serviceConfig(true)); @@ -173,6 +178,7 @@ public class IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest extends G /** * @throws Exception If failed. */ + @Test public void testServiceDeployment2() throws Exception { for (int i = 0 ; i < 4; i++) startGrid(i); @@ -190,6 +196,7 @@ public class IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest extends G /** * @throws Exception If failed. */ + @Test public void testServiceDeployment3() throws Exception { startGrid(0).services().deploy(serviceConfig(true)); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java index 7f08721..be0450c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java @@ -29,10 +29,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; /** * Tests that not all nodes in cluster need user's service definition (only nodes according to filter). */ +@RunWith(JUnit4.class) public class IgniteServiceDeploymentClassLoadingDefaultMarshallerTest extends GridCommonAbstractTest { /** */ private static final String NOOP_SERVICE_CLS_NAME = "org.apache.ignite.tests.p2p.NoopService"; @@ -124,6 +128,7 @@ public class IgniteServiceDeploymentClassLoadingDefaultMarshallerTest extends Gr /** * @throws Exception If failed. */ + @Test public void testServiceDeployment1() throws Exception { startGrid(SERVER_NODE); @@ -141,6 +146,7 @@ public class IgniteServiceDeploymentClassLoadingDefaultMarshallerTest extends Gr /** * @throws Exception If failed. */ + @Test public void testServiceDeployment2() throws Exception { startGrid(SERVER_NODE); @@ -154,6 +160,7 @@ public class IgniteServiceDeploymentClassLoadingDefaultMarshallerTest extends Gr /** * @throws Exception If failed. */ + @Test public void testServiceDeployment3() throws Exception { startGrid(SERVER_NODE_WITH_EXT_CLASS_LOADER).services().deploy(serviceConfig()); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java index 7e5a18d..c33af40 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java @@ -31,10 +31,14 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; 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 IgniteServiceDynamicCachesSelfTest extends GridCommonAbstractTest { /** */ private static final int GRID_CNT = 4; @@ -63,6 +67,7 @@ public class IgniteServiceDynamicCachesSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDeployCalledAfterCacheStart() throws Exception { String cacheName = "cache"; @@ -108,6 +113,7 @@ public class IgniteServiceDynamicCachesSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDeployCalledBeforeCacheStart() throws Exception { String cacheName = "cache"; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceProxyTimeoutInitializedTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceProxyTimeoutInitializedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceProxyTimeoutInitializedTest.java index 6bf76f5..4e56b58 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceProxyTimeoutInitializedTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceProxyTimeoutInitializedTest.java @@ -42,10 +42,14 @@ import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests service proxy timeouts. */ +@RunWith(JUnit4.class) public class IgniteServiceProxyTimeoutInitializedTest extends GridCommonAbstractTest { /** */ private static Service srvc; @@ -103,6 +107,7 @@ public class IgniteServiceProxyTimeoutInitializedTest extends GridCommonAbstract * @throws Exception If fail. */ @SuppressWarnings({"Convert2Lambda"}) + @Test public void testUnavailableService() throws Exception { srvc = new TestWaitServiceImpl(); @@ -143,6 +148,7 @@ public class IgniteServiceProxyTimeoutInitializedTest extends GridCommonAbstract * @throws Exception If fail. */ @SuppressWarnings({"Convert2Lambda"}) + @Test public void testServiceException() throws Exception { srvc = new HangServiceImpl(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceReassignmentTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceReassignmentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceReassignmentTest.java index e74b27d..56c07b3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceReassignmentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceReassignmentTest.java @@ -38,10 +38,14 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridStringLogger; 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 IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -87,6 +91,7 @@ public class IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeRestart1() throws Exception { srvcCfg = serviceConfiguration(); @@ -129,6 +134,7 @@ public class IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeRestart2() throws Exception { startGrids(3); @@ -157,6 +163,7 @@ public class IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeRestartRandom() throws Exception { final int NODES = 5; @@ -190,6 +197,7 @@ public class IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testZombieAssignmentsCleanup() throws Exception { useStrLog = true; @@ -246,6 +254,7 @@ public class IgniteServiceReassignmentTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeStopWhileThereAreCacheActivitiesInServiceProcessor() throws Exception { final int nodesCnt = 2; final int maxSvc = 1024; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java index 29e38d3..f66c612 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java @@ -32,8 +32,12 @@ 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 ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -101,6 +105,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testServersWithPersistence() throws Exception { persistence = true; @@ -110,6 +115,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception if failed. */ + @Test public void testClientsWithPersistence() throws Exception { persistence = true; @@ -119,6 +125,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception if failed. */ + @Test public void testServersWithoutPersistence() throws Exception { persistence = false; @@ -128,6 +135,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception if failed. */ + @Test public void testClientsWithoutPersistence() throws Exception { persistence = false; @@ -137,6 +145,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testServersStaticConfigWithPersistence() throws Exception { persistence = true; @@ -146,6 +155,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClientsStaticConfigWithPersistence() throws Exception { persistence = true; @@ -155,6 +165,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testServersStaticConfigWithoutPersistence() throws Exception { persistence = false; @@ -164,6 +175,7 @@ public class ServiceDeploymentOnActivationTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClientsStaticConfigWithoutPersistence() throws Exception { fail("https://issues.apache.org/jira/browse/IGNITE-8279"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOutsideBaselineTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOutsideBaselineTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOutsideBaselineTest.java index 878ec0d..48690a3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOutsideBaselineTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOutsideBaselineTest.java @@ -37,8 +37,12 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; 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 ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -93,6 +97,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployOutsideBaseline() throws Exception { checkDeploymentFromOutsideNode(true, false); } @@ -100,6 +105,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployOutsideBaselineNoPersistence() throws Exception { checkDeploymentFromOutsideNode(false, false); } @@ -107,6 +113,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployOutsideBaselineStatic() throws Exception { checkDeploymentFromOutsideNode(true, true); } @@ -114,6 +121,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployOutsideBaselineStaticNoPersistence() throws Exception { checkDeploymentFromOutsideNode(false, true); } @@ -121,6 +129,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployFromNodeAddedToBlt() throws Exception { checkDeployWithNodeAddedToBlt(true); } @@ -128,6 +137,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployToNodeAddedToBlt() throws Exception { checkDeployWithNodeAddedToBlt(false); } @@ -135,6 +145,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployFromNodeRemovedFromBlt() throws Exception { checkDeployFromNodeRemovedFromBlt(true, false); } @@ -142,6 +153,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployFromNodeRemovedFromBltStatic() throws Exception { checkDeployFromNodeRemovedFromBlt(true, true); } @@ -149,6 +161,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployToNodeRemovedFromBlt() throws Exception { checkDeployFromNodeRemovedFromBlt(false, false); } @@ -156,6 +169,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testStaticDeployFromEachPersistentNodes() throws Exception { checkDeployFromEachNodes(true, true); } @@ -163,6 +177,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testDeployFromEachNodes() throws Exception { checkDeployFromEachNodes(false, false); } @@ -170,6 +185,7 @@ public class ServiceDeploymentOutsideBaselineTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testStaticDeployFromEachNodes() throws Exception { checkDeployFromEachNodes(false, true); } http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServicePredicateAccessCacheTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServicePredicateAccessCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServicePredicateAccessCacheTest.java index 33a1993..87b6808 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServicePredicateAccessCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServicePredicateAccessCacheTest.java @@ -36,6 +36,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; 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.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheMode.REPLICATED; @@ -44,6 +47,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * */ +@RunWith(JUnit4.class) public class ServicePredicateAccessCacheTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -72,6 +76,7 @@ public class ServicePredicateAccessCacheTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPredicateAccessCache() throws Exception { final Ignite ignite0 = startGrid(0); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/service/SystemCacheNotConfiguredTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/SystemCacheNotConfiguredTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/SystemCacheNotConfiguredTest.java index a76eb22..f7f8195 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/SystemCacheNotConfiguredTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/SystemCacheNotConfiguredTest.java @@ -29,10 +29,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; /** * Tests if system cache was started before deploying of service. */ +@RunWith(JUnit4.class) public class SystemCacheNotConfiguredTest extends GridCommonAbstractTest { /** */ private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); @@ -66,6 +70,7 @@ public class SystemCacheNotConfiguredTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void test() throws Exception { captureErr(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessorSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessorSelfTest.java index 606b102..c31e4cf 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessorSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessorSelfTest.java @@ -27,12 +27,16 @@ import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.GridTestKernalContext; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.util.concurrent.TimeUnit.MILLISECONDS; /** * Timeout processor tests. */ +@RunWith(JUnit4.class) public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { /** Random number generator. */ private static final Random RAND = new Random(); @@ -66,6 +70,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeouts() throws Exception { int max = 100; @@ -136,6 +141,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeoutsMultithreaded() throws Exception { final int max = 100; @@ -212,6 +218,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeoutObjectAdapterMultithreaded() throws Exception { final int max = 100; @@ -272,6 +279,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeoutNeverCalled() throws Exception { int max = 100; @@ -331,6 +339,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeoutNeverCalledMultithreaded() throws Exception { int threads = 20; @@ -395,6 +404,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testAddRemoveInterleaving() throws Exception { final AtomicInteger callCnt = new AtomicInteger(0); @@ -517,6 +527,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testTimeoutCallOnce() throws Exception { ctx.timeout().addTimeoutObject(new GridTimeoutObject() { /** Timeout ID. */ @@ -558,6 +569,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testTimeoutSameEndTime() throws Exception { final CountDownLatch latch = new CountDownLatch(2); @@ -631,6 +643,7 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { * * @throws Exception If test failed. */ + @Test public void testCancelingWithClearedInterruptedFlag() throws Exception { final CountDownLatch onTimeoutCalled = new CountDownLatch(1); @@ -652,4 +665,4 @@ public class GridTimeoutProcessorSelfTest extends GridCommonAbstractTest { onTimeoutCalled.await(); } -} \ 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/product/GridProductVersionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java index 92990de..58b3f97 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java @@ -19,6 +19,9 @@ package org.apache.ignite.internal.product; import org.apache.ignite.lang.IgniteProductVersion; 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.internal.IgniteVersionUtils.BUILD_TSTAMP; import static org.apache.ignite.internal.IgniteVersionUtils.REV_HASH_STR; @@ -28,10 +31,12 @@ import static org.junit.Assert.assertArrayEquals; /** * Versions test. */ +@RunWith(JUnit4.class) public class GridProductVersionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFromString() throws Exception { IgniteProductVersion ver = IgniteProductVersion.fromString("1.2.3"); @@ -138,4 +143,4 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest { IgniteProductVersion.fromString(VER_STR + '-' + BUILD_TSTAMP + '-' + REV_HASH_STR); } -} \ 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/sql/SqlParserBulkLoadSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserBulkLoadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserBulkLoadSelfTest.java index b6716ff..60e489e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserBulkLoadSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserBulkLoadSelfTest.java @@ -17,11 +17,17 @@ package org.apache.ignite.internal.sql; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + /** * Tests for SQL parser: COPY command. */ +@RunWith(JUnit4.class) public class SqlParserBulkLoadSelfTest extends SqlParserAbstractSelfTest { /** Tests for COPY command. */ + @Test public void testCopy() { assertParseError(null, "copy grom 'any.file' into Person (_key, age, firstName, lastName) format csv", http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserCreateIndexSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserCreateIndexSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserCreateIndexSelfTest.java index a3be018..774a73b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserCreateIndexSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserCreateIndexSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.internal.sql.command.SqlCreateIndexCommand; import org.apache.ignite.internal.sql.command.SqlIndexColumn; import org.apache.ignite.internal.util.typedef.F; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.sql.SqlKeyword.INLINE_SIZE; import static org.apache.ignite.internal.sql.SqlKeyword.PARALLEL; @@ -34,6 +37,7 @@ import static org.apache.ignite.internal.sql.SqlKeyword.PARALLEL; * Tests for SQL parser: CREATE INDEX. */ @SuppressWarnings({"UnusedReturnValue"}) +@RunWith(JUnit4.class) public class SqlParserCreateIndexSelfTest extends SqlParserAbstractSelfTest { /** Default properties */ private static final Map<String, Object> DEFAULT_PROPS = getProps(null, null); @@ -43,6 +47,7 @@ public class SqlParserCreateIndexSelfTest extends SqlParserAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testCreateIndex() throws Exception { // Base. parseValidate(null, "CREATE INDEX idx ON tbl(a)", null, "TBL", "IDX", DEFAULT_PROPS, "A", false); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserDropIndexSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserDropIndexSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserDropIndexSelfTest.java index a0af3a6..a6d668e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserDropIndexSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserDropIndexSelfTest.java @@ -18,16 +18,21 @@ package org.apache.ignite.internal.sql; import org.apache.ignite.internal.sql.command.SqlDropIndexCommand; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for SQL parser: CREATE INDEX. */ +@RunWith(JUnit4.class) public class SqlParserDropIndexSelfTest extends SqlParserAbstractSelfTest { /** * Tests for DROP INDEX command. * * @throws Exception If failed. */ + @Test public void testDropIndex() throws Exception { // Base. parseValidate(null, "DROP INDEX idx", null, "IDX"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserSetStreamingSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserSetStreamingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserSetStreamingSelfTest.java index 7e699f6..2b448eb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserSetStreamingSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserSetStreamingSelfTest.java @@ -19,14 +19,19 @@ package org.apache.ignite.internal.sql; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.sql.command.SqlSetStreamingCommand; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for SQL parser: SET STREAMING. */ +@RunWith(JUnit4.class) public class SqlParserSetStreamingSelfTest extends SqlParserAbstractSelfTest { /** * */ + @Test public void testParseSetStreaming() { parseValidate("set streaming on", true, false, 2048, 0, 0, 0, false); parseValidate("set streaming 1", true, false, 2048, 0, 0, 0, false); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserTransactionalKeywordsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserTransactionalKeywordsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserTransactionalKeywordsSelfTest.java index 103bb97..f2e12cf 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserTransactionalKeywordsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserTransactionalKeywordsSelfTest.java @@ -21,14 +21,19 @@ import org.apache.ignite.internal.sql.command.SqlBeginTransactionCommand; import org.apache.ignite.internal.sql.command.SqlCommand; import org.apache.ignite.internal.sql.command.SqlCommitTransactionCommand; import org.apache.ignite.internal.sql.command.SqlRollbackTransactionCommand; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for processing of keywords BEGIN, COMMIT, ROLLBACK, START. */ +@RunWith(JUnit4.class) public class SqlParserTransactionalKeywordsSelfTest extends SqlParserAbstractSelfTest { /** * Test parsing of different forms of BEGIN/START. */ + @Test public void testBegin() { assertBegin("begin"); assertBegin("BEGIN"); @@ -44,6 +49,7 @@ public class SqlParserTransactionalKeywordsSelfTest extends SqlParserAbstractSel /** * Test parsing of different forms of COMMIT. */ + @Test public void testCommit() { assertCommit("commit"); assertCommit("COMMIT transaction"); @@ -54,6 +60,7 @@ public class SqlParserTransactionalKeywordsSelfTest extends SqlParserAbstractSel /** * Test parsing of different forms of ROLLBACK. */ + @Test public void testRollback() { assertRollback("rollback"); assertRollback("ROLLBACK transaction"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserUserSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserUserSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserUserSelfTest.java index 2c240f4..ec5b37d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserUserSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/sql/SqlParserUserSelfTest.java @@ -20,17 +20,22 @@ package org.apache.ignite.internal.sql; import org.apache.ignite.internal.sql.command.SqlAlterUserCommand; import org.apache.ignite.internal.sql.command.SqlCreateUserCommand; import org.apache.ignite.internal.sql.command.SqlDropUserCommand; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for SQL parser: CREATE INDEX. */ @SuppressWarnings({"UnusedReturnValue"}) +@RunWith(JUnit4.class) public class SqlParserUserSelfTest extends SqlParserAbstractSelfTest { /** * Tests for CREATE USER command. * * @throws Exception If failed. */ + @Test public void testCreateUser() throws Exception { // Base. parseValidateCreate("CREATE USER test WITH PASSWORD 'test'", "TEST", "test"); @@ -51,6 +56,7 @@ public class SqlParserUserSelfTest extends SqlParserAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testAlterUser() throws Exception { // Base. parseValidateAlter("ALTER USER test WITH PASSWORD 'test'", "TEST", "test"); @@ -71,6 +77,7 @@ public class SqlParserUserSelfTest extends SqlParserAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testDropUser() throws Exception { // Base. parseValidateDrop("DROP USER test", "TEST"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/GridArraysSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/GridArraysSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/GridArraysSelfTest.java index 1cab527..7e032fb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/GridArraysSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/GridArraysSelfTest.java @@ -19,6 +19,9 @@ package org.apache.ignite.internal.util; import java.util.Arrays; 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.internal.util.GridArrays.clearTail; import static org.apache.ignite.internal.util.GridArrays.remove; @@ -26,12 +29,14 @@ import static org.apache.ignite.internal.util.GridArrays.set; /** */ +@RunWith(JUnit4.class) public class GridArraysSelfTest extends GridCommonAbstractTest { /** */ private static final String[] EMPTY = {}; /** */ + @Test public void testSet() { String[] arr = set(EMPTY, 4, "aa"); @@ -71,6 +76,7 @@ public class GridArraysSelfTest extends GridCommonAbstractTest { /** */ + @Test public void testClearTail() { String[] arr = new String[10]; @@ -105,6 +111,7 @@ public class GridArraysSelfTest extends GridCommonAbstractTest { /** */ + @Test public void testRemoveLong() { long[] arr = {0,1,2,3,4,5,6}; @@ -117,6 +124,7 @@ public class GridArraysSelfTest extends GridCommonAbstractTest { /** */ + @Test public void testRemove() { Integer[] arr = {0,1,2,3,4,5,6}; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/GridCleanerTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/GridCleanerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/GridCleanerTest.java index deb87b0..d6959ed 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/GridCleanerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/GridCleanerTest.java @@ -18,14 +18,19 @@ package org.apache.ignite.internal.util; import junit.framework.TestCase; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Grid cleaner tests. */ +@RunWith(JUnit4.class) public class GridCleanerTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testCreate() throws Exception { Object cleaner = GridCleaner.create(this, new Runnable() { @Override public void run() { http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/GridHandleTableSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/GridHandleTableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/GridHandleTableSelfTest.java index bd6105f..ccbe84f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/GridHandleTableSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/GridHandleTableSelfTest.java @@ -18,14 +18,19 @@ package org.apache.ignite.internal.util; 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 GridHandleTable}. */ +@RunWith(JUnit4.class) public class GridHandleTableSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGrow() throws Exception { GridHandleTable table = new GridHandleTable(8, 2); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/GridStartupWithUndefinedIgniteHomeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/GridStartupWithUndefinedIgniteHomeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/GridStartupWithUndefinedIgniteHomeSelfTest.java index cb0beed..d8f300d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/GridStartupWithUndefinedIgniteHomeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/GridStartupWithUndefinedIgniteHomeSelfTest.java @@ -30,6 +30,10 @@ 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.After; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.IgniteSystemProperties.IGNITE_HOME; import static org.apache.ignite.internal.util.IgniteUtils.nullifyHomeDirectory; @@ -42,6 +46,7 @@ import static org.apache.ignite.internal.util.IgniteUtils.nullifyHomeDirectory; * independent from {@link GridCommonAbstractTest} stuff. * 2. Do not replace native Java asserts with JUnit ones - test won't fall on TeamCity. */ +@RunWith(JUnit4.class) public class GridStartupWithUndefinedIgniteHomeSelfTest extends TestCase { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -50,7 +55,8 @@ public class GridStartupWithUndefinedIgniteHomeSelfTest extends TestCase { private static final int GRID_COUNT = 2; /** {@inheritDoc} */ - @Override protected void tearDown() throws Exception { + @After + @Override public void tearDown() throws Exception { // Next grid in the same VM shouldn't use cached values produced by these tests. nullifyHomeDirectory(); @@ -60,6 +66,7 @@ public class GridStartupWithUndefinedIgniteHomeSelfTest extends TestCase { /** * @throws Exception If failed. */ + @Test public void testStartStopWithUndefinedIgniteHome() throws Exception { IgniteUtils.nullifyHomeDirectory(); @@ -103,4 +110,4 @@ public class GridStartupWithUndefinedIgniteHomeSelfTest extends TestCase { } } } -} \ 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/IgniteDevOnlyLogTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteDevOnlyLogTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteDevOnlyLogTest.java index 9a82947..de3ba71 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteDevOnlyLogTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteDevOnlyLogTest.java @@ -26,10 +26,14 @@ import org.apache.ignite.lang.IgniteRunnable; import org.apache.ignite.resources.IgniteInstanceResource; import org.apache.ignite.testframework.GridStringLogger; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Testing logging via {@link IgniteUtils#warnDevOnly(IgniteLogger, Object)}. */ +@RunWith(JUnit4.class) public class IgniteDevOnlyLogTest extends GridCommonAbstractTest { /** */ private List<String> additionalArgs; @@ -55,6 +59,7 @@ public class IgniteDevOnlyLogTest extends GridCommonAbstractTest { } /** Check that dev-only messages appear in the log. */ + @Test public void testDevOnlyQuietMessage() throws Exception { fail("https://issues.apache.org/jira/browse/IGNITE-9328"); @@ -72,6 +77,7 @@ public class IgniteDevOnlyLogTest extends GridCommonAbstractTest { } /** Check that dev-only messages appear in the log. */ + @Test public void testDevOnlyVerboseMessage() throws Exception { additionalArgs = Collections.singletonList("-D" + IgniteSystemProperties.IGNITE_QUIET + "=false"); @@ -91,6 +97,7 @@ public class IgniteDevOnlyLogTest extends GridCommonAbstractTest { * doesn't print anything if {@link org.apache.ignite.IgniteSystemProperties#IGNITE_DEV_ONLY_LOGGING_DISABLED} * is set to {@code true}. */ + @Test public void testDevOnlyDisabledProperty() throws Exception { additionalArgs = Collections.singletonList("-D" + IgniteSystemProperties.IGNITE_DEV_ONLY_LOGGING_DISABLED + "=true"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteExceptionRegistrySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteExceptionRegistrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteExceptionRegistrySelfTest.java index 81b7522..18aaded 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteExceptionRegistrySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteExceptionRegistrySelfTest.java @@ -24,11 +24,15 @@ import java.util.concurrent.Callable; 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; /** * */ @GridCommonTest(group = "Utils") +@RunWith(JUnit4.class) public class IgniteExceptionRegistrySelfTest extends GridCommonAbstractTest { /** */ private IgniteExceptionRegistry registry = IgniteExceptionRegistry.get(); @@ -36,6 +40,7 @@ public class IgniteExceptionRegistrySelfTest extends GridCommonAbstractTest { /** * @throws Exception if failed. */ + @Test public void testOnException() throws Exception { awaitPartitionMapExchange(); @@ -90,6 +95,7 @@ public class IgniteExceptionRegistrySelfTest extends GridCommonAbstractTest { /** * @throws Exception if failed. */ + @Test public void testMultiThreadedMaxSize() throws Exception { final int maxSize = 10; @@ -108,4 +114,4 @@ public class IgniteExceptionRegistrySelfTest extends GridCommonAbstractTest { assert maxSize + 1 >= size && maxSize - 1 <= 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/IgniteUtilsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java index 310705b..93b7586 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java @@ -77,6 +77,9 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.testframework.junits.common.GridCommonTest; import org.jetbrains.annotations.Nullable; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.util.Arrays.asList; import static org.junit.Assert.assertArrayEquals; @@ -85,6 +88,7 @@ import static org.junit.Assert.assertArrayEquals; * Grid utils tests. */ @GridCommonTest(group = "Utils") +@RunWith(JUnit4.class) public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** */ public static final int[] EMPTY = new int[0]; @@ -103,6 +107,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testIsPow2() { assertTrue(U.isPow2(1)); assertTrue(U.isPow2(2)); @@ -127,6 +132,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAllLocalIps() throws Exception { Collection<String> ips = U.allLocalIps(); @@ -136,6 +142,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAllLocalMACs() throws Exception { Collection<String> macs = U.allLocalMACs(); @@ -147,6 +154,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testAllLocalMACsMultiThreaded() throws Exception { GridTestUtils.runMultiThreaded(new Runnable() { @Override public void run() { @@ -162,6 +170,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testByteArray2String() throws Exception { assertEquals("{0x0A,0x14,0x1E,0x28,0x32,0x3C,0x46,0x50,0x5A}", U.byteArray2String(new byte[]{10, 20, 30, 40, 50, 60, 70, 80, 90}, "0x%02X", ",0x%02X")); @@ -170,6 +179,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFormatMins() throws Exception { printFormatMins(0); printFormatMins(1); @@ -197,6 +207,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDownloadUrlFromHttp() throws Exception { GridEmbeddedHttpServer srv = null; try { @@ -220,6 +231,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDownloadUrlFromHttps() throws Exception { GridEmbeddedHttpServer srv = null; try { @@ -243,6 +255,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDownloadUrlFromLocalFile() throws Exception { File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "url-http.file"); @@ -256,6 +269,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOs() throws Exception { System.out.println("OS string: " + U.osString()); System.out.println("JDK string: " + U.jdkString()); @@ -282,6 +296,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testJavaSerialization() throws Exception { ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); ObjectOutputStream objOut = new ObjectOutputStream(byteOut); @@ -300,6 +315,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testHidePassword() { Collection<String> uriList = new ArrayList<>(); @@ -368,6 +384,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test fails. */ + @Test public void testDetectPeerDeployAwareInfiniteRecursion() throws Exception { Ignite g = startGrid(1); @@ -402,6 +419,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If test failed. */ + @Test public void testPeerDeployAware0() throws Exception { Collection<Object> col = new ArrayList<>(); @@ -470,6 +488,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test UUID to bytes array conversion. */ + @Test public void testsGetBytes() { for (int i = 0; i < 100; i++) { UUID id = UUID.randomUUID(); @@ -486,6 +505,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { * */ @SuppressWarnings("ZeroLengthArrayAllocation") + @Test public void testReadByteArray() { assertTrue(Arrays.equals(new byte[0], U.readByteArray(ByteBuffer.allocate(0)))); assertTrue(Arrays.equals(new byte[0], U.readByteArray(ByteBuffer.allocate(0), ByteBuffer.allocate(0)))); @@ -527,6 +547,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { * */ @SuppressWarnings("ZeroLengthArrayAllocation") + @Test public void testHashCodeFromBuffers() { assertEquals(Arrays.hashCode(new byte[0]), U.hashCode(ByteBuffer.allocate(0))); assertEquals(Arrays.hashCode(new byte[0]), U.hashCode(ByteBuffer.allocate(0), ByteBuffer.allocate(0))); @@ -551,6 +572,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test annotation look up. */ + @Test public void testGetAnnotations() { assert U.getAnnotation(A1.class, Ann1.class) != null; assert U.getAnnotation(A2.class, Ann1.class) != null; @@ -565,6 +587,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testUnique() { int[][][] arrays = new int[][][]{ new int[][]{EMPTY, EMPTY, EMPTY}, @@ -591,6 +614,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDifference() { int[][][] arrays = new int[][][]{ new int[][]{EMPTY, EMPTY, EMPTY}, @@ -614,6 +638,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testCopyIfExceeded() { int[][] arrays = new int[][]{new int[]{13, 14, 17, 11}, new int[]{13}, EMPTY}; @@ -631,6 +656,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testIsIncreasingArray() { assertTrue(U.isIncreasingArray(EMPTY, 0)); assertTrue(U.isIncreasingArray(new int[]{Integer.MIN_VALUE, -10, 1, 13, Integer.MAX_VALUE}, 5)); @@ -649,6 +675,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testIsNonDecreasingArray() { assertTrue(U.isNonDecreasingArray(EMPTY, 0)); assertTrue(U.isNonDecreasingArray(new int[]{Integer.MIN_VALUE, -10, 1, 13, Integer.MAX_VALUE}, 5)); @@ -667,6 +694,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test InetAddress Comparator. */ + @Test public void testInetAddressesComparator() { List<InetSocketAddress> ips = new ArrayList<InetSocketAddress>() { { @@ -691,6 +719,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { } + @Test public void testMD5Calculation() throws Exception { String md5 = U.calculateMD5(new ByteArrayInputStream("Corrupted information.".getBytes())); @@ -700,6 +729,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testResolveLocalAddresses() throws Exception { InetAddress inetAddress = InetAddress.getByName("0.0.0.0"); @@ -721,6 +751,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testToSocketAddressesNoDuplicates() { Collection<String> addrs = new ArrayList<>(); @@ -776,6 +807,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testLongStringWriteUTF() throws Exception { checkString(null); checkString(""); @@ -797,6 +829,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testCeilPow2() throws Exception { assertEquals(2, U.ceilPow2(2)); assertEquals(4, U.ceilPow2(3)); @@ -823,6 +856,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testIsOldestNodeVersionAtLeast() { IgniteProductVersion v240 = IgniteProductVersion.fromString("2.4.0"); IgniteProductVersion v241 = IgniteProductVersion.fromString("2.4.1"); @@ -850,6 +884,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDoInParallel() throws Throwable { CyclicBarrier barrier = new CyclicBarrier(3); @@ -878,6 +913,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDoInParallelBatch() { CyclicBarrier barrier = new CyclicBarrier(3); @@ -911,6 +947,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test optimal splitting on batch sizes. */ + @Test public void testOptimalBatchSize() { assertArrayEquals(new int[]{1}, IgniteUtils.calculateOptimalBatchSizes(1, 1)); @@ -942,6 +979,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test parallel execution in order. */ + @Test public void testDoInParallelResultsOrder() throws IgniteCheckedException { ExecutorService executorService = Executors.newFixedThreadPool(4); @@ -957,6 +995,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test parallel execution steal job. */ + @Test public void testDoInParallelWithStealingJob() throws IgniteCheckedException { // Pool size should be less that input data collection. ExecutorService executorService = Executors.newFixedThreadPool(1); @@ -1029,6 +1068,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * Test parallel execution steal job. */ + @Test public void testDoInParallelWithStealingJobRunTaskInExecutor() throws Exception { // Pool size should be less that input data collection. ExecutorService executorService = Executors.newFixedThreadPool(2); @@ -1109,6 +1149,7 @@ public class IgniteUtilsSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDoInParallelException() { String expectedException = "ExpectedException"; http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/StripedExecutorTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/StripedExecutorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/StripedExecutorTest.java index 9a4bf06..0b4123a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/StripedExecutorTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/StripedExecutorTest.java @@ -20,10 +20,14 @@ package org.apache.ignite.internal.util; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.logger.java.JavaLogger; 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 StripedExecutorTest extends GridCommonAbstractTest { /** */ private StripedExecutor stripedExecSvc; @@ -44,6 +48,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompletedTasks() throws Exception { stripedExecSvc.execute(0, new TestRunnable()); stripedExecSvc.execute(1, new TestRunnable()); @@ -56,6 +61,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStripesCompletedTasks() throws Exception { stripedExecSvc.execute(0, new TestRunnable()); stripedExecSvc.execute(1, new TestRunnable()); @@ -72,6 +78,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStripesActiveStatuses() throws Exception { stripedExecSvc.execute(0, new TestRunnable()); stripedExecSvc.execute(1, new TestRunnable(true)); @@ -88,6 +95,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testActiveStripesCount() throws Exception { stripedExecSvc.execute(0, new TestRunnable()); stripedExecSvc.execute(1, new TestRunnable(true)); @@ -100,6 +108,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStripesQueueSizes() throws Exception { stripedExecSvc.execute(0, new TestRunnable()); stripedExecSvc.execute(0, new TestRunnable(true)); @@ -120,6 +129,7 @@ public class StripedExecutorTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueueSize() throws Exception { stripedExecSvc.execute(1, new TestRunnable()); stripedExecSvc.execute(1, new TestRunnable(true)); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridCompoundFutureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridCompoundFutureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridCompoundFutureSelfTest.java index a602133..4d87569 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridCompoundFutureSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridCompoundFutureSelfTest.java @@ -25,14 +25,19 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests compound future contracts. */ +@RunWith(JUnit4.class) public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMarkInitialized() throws Exception { GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(); @@ -53,6 +58,7 @@ public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompleteOnReducer() throws Exception { GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer()); @@ -85,6 +91,7 @@ public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompleteOnException() throws Exception { GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer()); @@ -117,6 +124,7 @@ public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConcurrentCompletion() throws Exception { GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer()); @@ -149,6 +157,7 @@ public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testConcurrentRandomCompletion() throws Exception { GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer()); @@ -187,4 +196,4 @@ public class GridCompoundFutureSelfTest extends GridCommonAbstractTest { assertTrue(fut.isDone()); } -} \ 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/future/GridEmbeddedFutureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridEmbeddedFutureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridEmbeddedFutureSelfTest.java index 314acce..4d31349 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridEmbeddedFutureSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridEmbeddedFutureSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.internal.util.typedef.C2; import org.apache.ignite.lang.IgniteBiClosure; import org.apache.ignite.testframework.junits.GridTestKernalContext; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +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.configuration.CacheConfiguration.DFLT_MAX_CONCURRENT_ASYNC_OPS; @@ -33,6 +36,7 @@ import static org.apache.ignite.configuration.CacheConfiguration.DFLT_MAX_CONCUR /** * Tests grid embedded future use cases. */ +@RunWith(JUnit4.class) public class GridEmbeddedFutureSelfTest extends GridCommonAbstractTest { /** * Test kernal context. @@ -47,6 +51,7 @@ public class GridEmbeddedFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFutureChain() throws Exception { GridFutureAdapter<Integer> fut = new GridFutureAdapter<>(); @@ -70,6 +75,7 @@ public class GridEmbeddedFutureSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("ErrorNotRethrown") + @Test public void testFutureCompletesCorrectly() throws Exception { List<Throwable> list = Arrays.asList( null, @@ -137,4 +143,4 @@ public class GridEmbeddedFutureSelfTest 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/future/GridFutureAdapterSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureAdapterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureAdapterSelfTest.java index 89f3a03..e954afc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureAdapterSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureAdapterSelfTest.java @@ -35,14 +35,19 @@ import org.apache.ignite.internal.util.typedef.CX1; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.GridTestKernalContext; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests grid future adapter use cases. */ +@RunWith(JUnit4.class) public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOnDone() throws Exception { GridFutureAdapter<String> fut = new GridFutureAdapter<>(); @@ -92,6 +97,7 @@ public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOnCancelled() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -119,6 +125,7 @@ public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testListenSyncNotify() throws Exception { GridFutureAdapter<String> fut = new GridFutureAdapter<>(); @@ -170,6 +177,7 @@ public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testListenNotify() throws Exception { GridTestKernalContext ctx = new GridTestKernalContext(log); @@ -228,6 +236,7 @@ public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { * * @throws Exception In case of any exception. */ + @Test public void testChaining() throws Exception { checkChaining(null); @@ -326,6 +335,7 @@ public class GridFutureAdapterSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { GridFutureAdapter<Object> unfinished = new GridFutureAdapter<>(); GridFutureAdapter<Object> finished = new GridFutureAdapter<>(); @@ -371,4 +381,4 @@ public class GridFutureAdapterSelfTest 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/future/GridFutureQueueTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureQueueTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureQueueTest.java index e68141b..0bc75ff 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureQueueTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/GridFutureQueueTest.java @@ -180,4 +180,4 @@ public class GridFutureQueueTest { System.gc(); } } -} \ 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/future/IgniteFutureImplTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java index 16adbd1..12f5bbe 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java @@ -37,10 +37,14 @@ import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.testframework.GridTestUtils; 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; /** * */ +@RunWith(JUnit4.class) public class IgniteFutureImplTest extends GridCommonAbstractTest { /** Context thread name. */ private static final String CTX_THREAD_NAME = "test-async"; @@ -72,6 +76,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFutureGet() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -91,6 +96,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFutureException() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -130,6 +136,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFutureIgniteException() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -153,6 +160,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testListeners() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -197,6 +205,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testListenersOnError() throws Exception { { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -264,6 +273,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAsyncListeners() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -305,6 +315,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAsyncListenersOnError() throws Exception { checkAsyncListenerOnError(new IgniteException("Test exception")); checkAsyncListenerOnError(new IgniteCheckedException("Test checked exception")); @@ -384,6 +395,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChain() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -425,6 +437,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChainError() throws Exception { { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -574,6 +587,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChainAsync() throws Exception { GridFutureAdapter<String> fut0 = new GridFutureAdapter<>(); @@ -646,6 +660,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChainAsyncOnError() throws Exception { checkChainedOnError(new IgniteException("Test exception")); checkChainedOnError(new IgniteCheckedException("Test checked exception")); @@ -804,4 +819,4 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest { protected Class<? extends Exception> expectedException() { return IgniteException.class; } -} \ 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/future/nio/GridNioEmbeddedFutureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioEmbeddedFutureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioEmbeddedFutureSelfTest.java index b7b6966..0b26d4f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioEmbeddedFutureSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/nio/GridNioEmbeddedFutureSelfTest.java @@ -20,16 +20,21 @@ package org.apache.ignite.internal.util.future.nio; import org.apache.ignite.internal.util.nio.GridNioEmbeddedFuture; import org.apache.ignite.internal.util.nio.GridNioFutureImpl; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.util.concurrent.TimeUnit.SECONDS; /** * Test for NIO embedded future. */ +@RunWith(JUnit4.class) public class GridNioEmbeddedFutureSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNioEmbeddedFuture() throws Exception { // Original future. final GridNioFutureImpl<Integer> origFut = new GridNioFutureImpl<>(null); @@ -57,4 +62,4 @@ public class GridNioEmbeddedFutureSelfTest extends GridCommonAbstractTest { // Wait for embedded future completes. assertEquals(new Integer(100), embFut.get(1, SECONDS)); } -} \ No newline at end of file +}
