http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java index f80b5e9..6f83f50 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java @@ -29,12 +29,16 @@ import org.apache.ignite.Ignite; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.F; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.junit.Assert.assertArrayEquals; /** * Tests for TCP binary protocol. */ +@RunWith(JUnit4.class) public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTest { /** Grid count. */ private static final int GRID_CNT = 1; @@ -92,6 +96,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { jcache().put("getKey1", "getVal1"); jcache().put("getKey2", "getVal2"); @@ -104,6 +109,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testGetBulk() throws Exception { jcache().put("getKey1", "getVal1"); jcache().put("getKey2", "getVal2"); @@ -122,6 +128,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testSet() throws Exception { Assert.assertTrue(client.set("setKey", 0, "setVal").get()); @@ -131,6 +138,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testSetWithExpiration() throws Exception { Assert.assertTrue(client.set("setKey", 2000, "setVal").get()); @@ -144,6 +152,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testAdd() throws Exception { jcache().put("addKey1", "addVal1"); @@ -157,6 +166,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testAddWithExpiration() throws Exception { Assert.assertTrue(client.add("addKey", 2000, "addVal").get()); @@ -170,6 +180,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testReplace() throws Exception { Assert.assertFalse(client.replace("replaceKey", 0, "replaceVal").get()); @@ -184,6 +195,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testReplaceWithExpiration() throws Exception { jcache().put("replaceKey", "replaceVal"); @@ -199,6 +211,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testDelete() throws Exception { Assert.assertFalse(client.delete("deleteKey").get()); @@ -212,6 +225,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testIncrement() throws Exception { Assert.assertEquals(5, client.incr("incrKey", 3, 2)); @@ -225,6 +239,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testDecrement() throws Exception { Assert.assertEquals(5, client.decr("decrKey", 10, 15)); @@ -238,6 +253,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testFlush() throws Exception { jcache().put("flushKey1", "flushVal1"); jcache().put("flushKey2", "flushVal2"); @@ -252,6 +268,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testStat() throws Exception { jcache().put("statKey1", "statVal1"); assertEquals("statVal1", jcache().get("statKey1")); @@ -283,6 +300,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testAppend() throws Exception { Assert.assertFalse(client.append(0, "appendKey", "_suffix").get()); @@ -298,6 +316,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testPrepend() throws Exception { Assert.assertFalse(client.append(0, "prependKey", "_suffix").get()); @@ -313,6 +332,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testSpecialTypes() throws Exception { Assert.assertTrue(client.set("boolKey", 0, true).get()); @@ -361,6 +381,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testComplexObject() throws Exception { Assert.assertTrue(client.set("objKey", 0, new ValueObject(10, "String")).get()); @@ -370,6 +391,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testCustomPort() throws Exception { customPort = 11212; @@ -392,6 +414,7 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe /** * @throws Exception If failed. */ + @Test public void testVersion() throws Exception { Map<SocketAddress, String> map = client.getVersions();
http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java index 81f0a36f..46416be 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java @@ -137,6 +137,9 @@ import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CacheMode.REPLICATED; @@ -152,6 +155,7 @@ import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS * Tests for Jetty REST protocol. */ @SuppressWarnings("unchecked") +@RunWith(JUnit4.class) public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProcessorCommonSelfTest { /** Used to sent request charset. */ private static final String CHARSET = StandardCharsets.UTF_8.name(); @@ -287,6 +291,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { jcache().put("getKey", "getVal"); @@ -315,6 +320,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetBinaryObjects() throws Exception { Person p = new Person(1, "John", "Doe", 300); @@ -411,6 +417,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testNullMapKeyAndValue() throws Exception { Map<String, String> map1 = new HashMap<>(); map1.put(null, null); @@ -444,6 +451,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testSimpleObject() throws Exception { SimplePerson p = new SimplePerson(1, "Test", java.sql.Date.valueOf("1977-01-26"), 1000.55, 39, "CIO", 25); @@ -467,6 +475,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testDate() throws Exception { java.util.Date utilDate = new java.util.Date(); @@ -504,6 +513,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testUUID() throws Exception { UUID uuid = UUID.randomUUID(); @@ -529,6 +539,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testTuple() throws Exception { T2 t = new T2("key", "value"); @@ -547,6 +558,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testCacheSize() throws Exception { jcache().removeAll(); @@ -562,6 +574,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testIgniteName() throws Exception { String ret = content(null, GridRestCommand.NAME); @@ -617,6 +630,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetOrCreateCache() throws Exception { checkGetOrCreateAndDestroy("testCache", PARTITIONED, 0, FULL_SYNC, null, null); @@ -666,6 +680,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetAll() throws Exception { final Map<String, String> entries = F.asMap("getKey1", "getVal1", "getKey2", "getVal2"); @@ -688,6 +703,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testIncorrectPut() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT, "key", "key0"); @@ -698,6 +714,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testContainsKey() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -709,6 +726,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testContainsKeys() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); grid(0).cache(DEFAULT_CACHE_NAME).put("key1", "val1"); @@ -724,6 +742,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetAndPut() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -740,6 +759,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetAndPutIfAbsent() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -756,6 +776,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPutIfAbsent2() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT_IF_ABSENT, "key", "key0", @@ -770,6 +791,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testRemoveValue() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -795,6 +817,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetAndRemove() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -808,6 +831,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testReplaceValue() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -835,6 +859,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testGetAndReplace() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("key0", "val0"); @@ -851,6 +876,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testDeactivateActivate() throws Exception { assertClusterState(true); @@ -867,6 +893,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPut() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT, "key", "putKey", @@ -883,6 +910,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPutWithExpiration() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT, "key", "putKey", @@ -902,6 +930,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testAdd() throws Exception { jcache().put("addKey1", "addVal1"); @@ -919,6 +948,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testAddWithExpiration() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_ADD, "key", "addKey", @@ -938,6 +968,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPutAll() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT_ALL, "k1", "putKey1", @@ -957,6 +988,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testRemove() throws Exception { jcache().put("rmvKey", "rmvVal"); @@ -974,6 +1006,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testRemoveAll() throws Exception { jcache().put("rmvKey1", "rmvVal1"); jcache().put("rmvKey2", "rmvVal2"); @@ -1015,6 +1048,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testCas() throws Exception { jcache().put("casKey", "casOldVal"); @@ -1038,6 +1072,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testReplace() throws Exception { jcache().put("repKey", "repOldVal"); @@ -1058,6 +1093,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testReplaceWithExpiration() throws Exception { jcache().put("replaceKey", "replaceVal"); @@ -1082,6 +1118,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testAppend() throws Exception { jcache().put("appendKey", "appendVal"); @@ -1098,6 +1135,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPrepend() throws Exception { jcache().put("prependKey", "prependVal"); @@ -1114,6 +1152,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testIncrement() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.ATOMIC_INCREMENT, "key", "incrKey", @@ -1140,6 +1179,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testDecrement() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.ATOMIC_DECREMENT, "key", "decrKey", @@ -1166,6 +1206,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testCar() throws Exception { jcache().put("casKey", "casOldVal"); @@ -1186,6 +1227,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testPutIfAbsent() throws Exception { assertNull(jcache().localPeek("casKey")); @@ -1204,6 +1246,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testCasRemove() throws Exception { jcache().put("casKey", "casVal"); @@ -1221,6 +1264,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testMetrics() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_METRICS); @@ -1310,6 +1354,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testMetadataLocal() throws Exception { IgniteCacheProxy<?, ?> cache = F.first(grid(0).context().cache().publicCaches()); @@ -1351,6 +1396,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testMetadataRemote() throws Exception { CacheConfiguration<Integer, String> partialCacheCfg = new CacheConfiguration<>("partial"); @@ -1390,6 +1436,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testTopology() throws Exception { String ret = content(null, GridRestCommand.TOPOLOGY, "attr", "false", @@ -1456,6 +1503,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testNode() throws Exception { String ret = content(null, GridRestCommand.NODE, "attr", "true", @@ -1526,6 +1574,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces * * @throws Exception If failed. */ + @Test public void testExe() throws Exception { String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.EXE); @@ -1571,6 +1620,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces * * @throws Exception If failed. */ + @Test public void testVisorGateway() throws Exception { ClusterNode locNode = grid(1).localNode(); @@ -1928,6 +1978,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testVersion() throws Exception { String ret = content(null, GridRestCommand.VERSION); @@ -1939,6 +1990,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testQueryArgs() throws Exception { String qry = "salary > ? and salary <= ?"; @@ -1960,6 +2012,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testQueryScan() throws Exception { String ret = content("person", GridRestCommand.EXECUTE_SCAN_QUERY, "pageSize", "10", @@ -1976,6 +2029,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testFilterQueryScan() throws Exception { String ret = content("person", GridRestCommand.EXECUTE_SCAN_QUERY, "pageSize", "10", @@ -1992,6 +2046,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testIncorrectFilterQueryScan() throws Exception { String clsName = ScanFilter.class.getName() + 1; @@ -2006,6 +2061,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testQuery() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).put("1", "1"); grid(0).cache(DEFAULT_CACHE_NAME).put("2", "2"); @@ -2051,6 +2107,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testDistributedJoinsQuery() throws Exception { String qry = "select * from Person, \"organization\".Organization " + "where \"organization\".Organization.id = Person.orgId " + @@ -2074,6 +2131,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testSqlFieldsQuery() throws Exception { String qry = "select concat(firstName, ' ', lastName) from Person"; @@ -2092,6 +2150,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testDistributedJoinsSqlFieldsQuery() throws Exception { String qry = "select * from \"person\".Person p, \"organization\".Organization o where o.id = p.orgId"; @@ -2111,6 +2170,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testSqlFieldsMetadataQuery() throws Exception { String qry = "select firstName, lastName from Person"; @@ -2141,6 +2201,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testQueryClose() throws Exception { String qry = "salary > ? and salary <= ?"; @@ -2170,6 +2231,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testQueryDelay() throws Exception { String qry = "salary > ? and salary <= ?"; @@ -2232,6 +2294,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testTypedPut() throws Exception { // Test boolean type. putTypedValue("boolean", "true", "false", STATUS_SUCCESS); @@ -2409,6 +2472,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces /** * @throws Exception If failed. */ + @Test public void testTypedGet() throws Exception { // Test boolean type. IgniteCache<Boolean, Boolean> cBool = typedCache(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java index 8f99cdb..351d237 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java @@ -26,12 +26,16 @@ import org.apache.ignite.internal.processors.authentication.IgniteAccessControlE import org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor; 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; import static org.apache.ignite.configuration.WALMode.NONE; /** * Test REST with enabled authentication. */ +@RunWith(JUnit4.class) public abstract class JettyRestProcessorAuthenticationAbstractTest extends JettyRestProcessorUnsignedSelfTest { /** */ protected static final String DFLT_USER = "ignite"; @@ -90,6 +94,7 @@ public abstract class JettyRestProcessorAuthenticationAbstractTest extends Jetty /** * @throws Exception If failed. */ + @Test public void testAuthenticationCommand() throws Exception { String ret = content(null, GridRestCommand.AUTHENTICATE); @@ -99,6 +104,7 @@ public abstract class JettyRestProcessorAuthenticationAbstractTest extends Jetty /** * @throws Exception If failed. */ + @Test public void testAddUpdateRemoveUser() throws Exception { // Add user. String ret = content(null, GridRestCommand.ADD_USER, http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationWithTokenSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationWithTokenSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationWithTokenSelfTest.java index 0a1b6b9..bf2ddac 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationWithTokenSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationWithTokenSelfTest.java @@ -18,10 +18,14 @@ package org.apache.ignite.internal.processors.rest; import org.apache.ignite.internal.util.typedef.F; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test REST with enabled authentication and token. */ +@RunWith(JUnit4.class) public class JettyRestProcessorAuthenticationWithTokenSelfTest extends JettyRestProcessorAuthenticationAbstractTest { /** */ private String tok = ""; @@ -56,6 +60,7 @@ public class JettyRestProcessorAuthenticationWithTokenSelfTest extends JettyRest /** * @throws Exception If failed. */ + @Test public void testInvalidSessionToken() throws Exception { tok = null; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorGetAllAsArrayTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorGetAllAsArrayTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorGetAllAsArrayTest.java index 521d7c1..3017d87 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorGetAllAsArrayTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorGetAllAsArrayTest.java @@ -22,11 +22,15 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; 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.IgniteSystemProperties.IGNITE_REST_GETALL_AS_ARRAY; import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_SUCCESS; /** */ +@RunWith(JUnit4.class) public class JettyRestProcessorGetAllAsArrayTest extends JettyRestProcessorCommonSelfTest { /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { @@ -45,6 +49,7 @@ public class JettyRestProcessorGetAllAsArrayTest extends JettyRestProcessorCommo /** * @throws Exception If failed. */ + @Test public void testGetAll() throws Exception { final Map<String, String> entries = F.asMap("getKey1", "getVal1", "getKey2", "getVal2"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java index 3be99b4..b5860dc 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java @@ -25,10 +25,14 @@ import java.security.NoSuchAlgorithmException; import java.util.Base64; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class JettyRestProcessorSignedSelfTest extends JettyRestProcessorAbstractSelfTest { /** */ protected static final String REST_SECRET_KEY = "secret-key"; @@ -52,6 +56,7 @@ public class JettyRestProcessorSignedSelfTest extends JettyRestProcessorAbstract /** * @throws Exception If failed. */ + @Test public void testUnauthorized() throws Exception { String addr = "http://" + LOC_HOST + ":" + restPort() + "/ignite?cacheName=default&cmd=top"; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java index 8d9fe77..3fe693d 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java @@ -45,6 +45,9 @@ 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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.LOCAL; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; @@ -53,6 +56,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; * TCP protocol test. */ @SuppressWarnings("unchecked") +@RunWith(JUnit4.class) public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -139,6 +143,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPut() throws Exception { assertTrue(client.cachePut(DEFAULT_CACHE_NAME, "key1", "val1")); assertEquals("val1", grid().cache(DEFAULT_CACHE_NAME).get("key1")); @@ -150,6 +155,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPutAll() throws Exception { client.cachePutAll(DEFAULT_CACHE_NAME, F.asMap("key1", "val1", "key2", "val2")); @@ -171,6 +177,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { grid().cache(DEFAULT_CACHE_NAME).put("key", "val"); @@ -184,6 +191,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFailure() throws Exception { IgniteKernal kernal = ((IgniteKernal)grid()); @@ -219,6 +227,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetAll() throws Exception { IgniteCache<Object, Object> jcacheDflt = grid().cache(DEFAULT_CACHE_NAME); IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME); @@ -263,6 +272,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRemove() throws Exception { IgniteCache<Object, Object> jcacheDflt = grid().cache(DEFAULT_CACHE_NAME); IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME); @@ -286,6 +296,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRemoveAll() throws Exception { IgniteCache<Object, Object> jcacheDflt = grid().cache(DEFAULT_CACHE_NAME); @@ -319,6 +330,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testReplace() throws Exception { assertFalse(client.cacheReplace(DEFAULT_CACHE_NAME, "key1", "val1")); @@ -341,6 +353,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompareAndSet() throws Exception { assertFalse(client.cacheCompareAndSet(DEFAULT_CACHE_NAME, "key", null, null)); @@ -403,6 +416,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMetrics() throws Exception { IgniteCache<Object, Object> jcacheDft = grid().cache(DEFAULT_CACHE_NAME); IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME); @@ -445,6 +459,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAppend() throws Exception { grid().cache(DEFAULT_CACHE_NAME).remove("key"); grid().cache(CACHE_NAME).remove("key"); @@ -469,6 +484,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPrepend() throws Exception { grid().cache(DEFAULT_CACHE_NAME).remove("key"); grid().cache(CACHE_NAME).remove("key"); @@ -493,6 +509,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testExecute() throws Exception { GridClientTaskResultBean res = client.execute(TestTask.class.getName(), Arrays.asList("executing", 3, "test", 5, "task")); @@ -504,6 +521,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNode() throws Exception { assertNull(client.node(UUID.randomUUID(), false, false)); assertNull(client.node("wrongHost", false, false)); @@ -548,6 +566,7 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTopology() throws Exception { List<GridClientNodeBean> top = client.topology(true, true); @@ -613,4 +632,4 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { return sum; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java index 8b6c2bf..26a5f8f 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java @@ -28,6 +28,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.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.LOCAL; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; @@ -35,6 +38,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * TCP protocol test. */ +@RunWith(JUnit4.class) public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -121,6 +125,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPut() throws Exception { assertTrue(client.cachePut(null, "key1", "val1")); assertEquals("val1", grid().cache(DEFAULT_CACHE_NAME).get("key1")); @@ -132,6 +137,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { grid().cache(DEFAULT_CACHE_NAME).put("key", "val"); @@ -145,6 +151,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testRemove() throws Exception { grid().cache(DEFAULT_CACHE_NAME).put("key", "val"); @@ -164,6 +171,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAdd() throws Exception { assertTrue(client.cacheAdd(null, "key", "val")); assertEquals("val", grid().cache(DEFAULT_CACHE_NAME).get("key")); @@ -179,6 +187,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testReplace() throws Exception { assertFalse(client.cacheReplace(null, "key1", "val1")); grid().cache(DEFAULT_CACHE_NAME).put("key1", "val1"); @@ -198,6 +207,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMetrics() throws Exception { grid().cache(DEFAULT_CACHE_NAME).localMxBean().clear(); grid().cache(CACHE_NAME).localMxBean().clear(); @@ -236,6 +246,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncrement() throws Exception { assertEquals(15L, client().increment("key", 10L, 5L)); assertEquals(15L, grid().atomicLong("key", 0, true).get()); @@ -259,6 +270,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDecrement() throws Exception { assertEquals(15L, client().decrement("key", 20L, 5L)); assertEquals(15L, grid().atomicLong("key", 0, true).get()); @@ -282,6 +294,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAppend() throws Exception { assertFalse(client.cacheAppend(null, "wrongKey", "_suffix")); assertFalse(client.cacheAppend(CACHE_NAME, "wrongKey", "_suffix")); @@ -298,6 +311,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPrepend() throws Exception { assertFalse(client.cachePrepend(null, "wrongKey", "prefix_")); assertFalse(client.cachePrepend(CACHE_NAME, "wrongKey", "prefix_")); @@ -314,6 +328,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testVersion() throws Exception { assertNotNull(client.version()); } @@ -321,6 +336,7 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNoop() throws Exception { client.noop(); } @@ -328,7 +344,8 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQuit() throws Exception { client.quit(); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java index 24274d7..9be68b1 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java @@ -22,10 +22,14 @@ import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; 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; /** * Rest processor test. */ +@RunWith(JUnit4.class) public class RestProcessorMultiStartSelfTest extends GridCommonAbstractTest { /** */ private static final int GRID_CNT = 3; @@ -55,6 +59,7 @@ public class RestProcessorMultiStartSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testMultiStart() throws Exception { try { for (int i = 0; i < GRID_CNT; i++) @@ -72,6 +77,7 @@ public class RestProcessorMultiStartSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testMultiStartWithClient() throws Exception { try { int clnIdx = GRID_CNT - 1; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java index 477c41a..6026785 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java @@ -35,10 +35,14 @@ 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.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class RestProcessorStartSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -92,6 +96,7 @@ public class RestProcessorStartSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTcpStart() throws Exception { GridClientConfiguration clCfg = new GridClientConfiguration(); @@ -165,4 +170,4 @@ public class RestProcessorStartSelfTest extends GridCommonAbstractTest { super.spiStart(igniteInstanceName); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java index c28da5f..68b5c4c 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java @@ -47,6 +47,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.NotNull; import org.jsr166.ConcurrentLinkedHashMap; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.LOCAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -57,6 +60,7 @@ import static org.apache.ignite.internal.client.GridClientProtocol.TCP; /** * Test for {@code GridTaskCommandHandler} */ +@RunWith(JUnit4.class) public class TaskCommandHandlerSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -163,6 +167,7 @@ public class TaskCommandHandlerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testManyTasksRun() throws Exception { GridClientCompute compute = client.compute(); @@ -220,4 +225,4 @@ public class TaskCommandHandlerSelfTest extends GridCommonAbstractTest { return sum; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TcpRestUnmarshalVulnerabilityTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TcpRestUnmarshalVulnerabilityTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TcpRestUnmarshalVulnerabilityTest.java index 92d824b..cbb14ff 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TcpRestUnmarshalVulnerabilityTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TcpRestUnmarshalVulnerabilityTest.java @@ -38,6 +38,9 @@ import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST; import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_WHITELIST; @@ -47,6 +50,7 @@ import static org.apache.ignite.internal.processors.rest.protocols.tcp.GridMemca /** * Tests for whitelist and blacklist ot avoiding deserialization vulnerability. */ +@RunWith(JUnit4.class) public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** Marshaller. */ private static final GridClientJdkMarshaller MARSH = new GridClientJdkMarshaller(); @@ -89,6 +93,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNoLists() throws Exception { testExploit(true); } @@ -96,6 +101,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWhiteListIncluded() throws Exception { String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath(); @@ -107,6 +113,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWhiteListExcluded() throws Exception { String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath(); @@ -118,6 +125,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBlackListIncluded() throws Exception { String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath(); @@ -129,6 +137,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBlackListExcluded() throws Exception { String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath(); @@ -140,6 +149,7 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBothListIncluded() throws Exception { String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath(); @@ -266,4 +276,4 @@ public class TcpRestUnmarshalVulnerabilityTest extends GridCommonAbstractTest { // No-op. } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/TcpRestParserSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/TcpRestParserSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/TcpRestParserSelfTest.java index fecd2b9..e230ad4 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/TcpRestParserSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/TcpRestParserSelfTest.java @@ -34,6 +34,9 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.CAS; import static org.apache.ignite.internal.processors.rest.protocols.tcp.GridMemcachedMessage.IGNITE_HANDSHAKE_FLAG; @@ -45,6 +48,7 @@ import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.MARSHALL * This class tests that parser confirms memcache extended specification. */ @SuppressWarnings("TypeMayBeWeakened") +@RunWith(JUnit4.class) public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** Marshaller. */ private GridClientMarshaller marshaller = new GridClientOptimizedMarshaller(); @@ -58,6 +62,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSimplePacketParsing() throws Exception { GridNioSession ses = new MockNioSession(); @@ -93,6 +98,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncorrectPackets() throws Exception { final GridNioSession ses = new MockNioSession(); @@ -142,6 +148,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomMessages() throws Exception { GridClientCacheRequest req = new GridClientCacheRequest(CAS); @@ -178,6 +185,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMixedParsing() throws Exception { GridNioSession ses1 = new MockNioSession(); GridNioSession ses2 = new MockNioSession(); @@ -247,6 +255,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testParseContinuousSplit() throws Exception { ByteBuffer tmp = ByteBuffer.allocate(10 * 1024); @@ -301,6 +310,7 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testParseClientHandshake() throws Exception { for (int splitPos = 1; splitPos < 5; splitPos++) { log.info("Checking split position: " + splitPos); @@ -453,4 +463,4 @@ public class TcpRestParserSelfTest extends GridCommonAbstractTest { return res; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolConnectSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolConnectSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolConnectSelfTest.java index f7fd69a..ca3859f 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolConnectSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolConnectSelfTest.java @@ -18,15 +18,20 @@ package org.apache.ignite.internal.processors.rest.protocols.tcp.redis; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import redis.clients.jedis.Jedis; /** * Tests for Connection commands of Redis protocol. */ +@RunWith(JUnit4.class) public class RedisProtocolConnectSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPing() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals("PONG", jedis.ping()); @@ -36,6 +41,7 @@ public class RedisProtocolConnectSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testEcho() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals("Hello, grid!", jedis.echo("Hello, grid!")); @@ -45,6 +51,7 @@ public class RedisProtocolConnectSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSelect() throws Exception { try (Jedis jedis = pool.getResource()) { // connected to cache with index 0 http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolServerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolServerSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolServerSelfTest.java index a424d77..f0f5f47 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolServerSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolServerSelfTest.java @@ -19,15 +19,20 @@ package org.apache.ignite.internal.processors.rest.protocols.tcp.redis; import java.util.HashMap; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import redis.clients.jedis.Jedis; /** * Tests for Server commands of Redis protocol. */ +@RunWith(JUnit4.class) public class RedisProtocolServerSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDbSize() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(0, (long)jedis.dbSize()); @@ -46,6 +51,7 @@ public class RedisProtocolServerSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFlushDb() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(0, (long)jedis.dbSize()); @@ -82,6 +88,7 @@ public class RedisProtocolServerSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFlushAll() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(0, (long)jedis.dbSize()); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringAtomicDatastructuresSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringAtomicDatastructuresSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringAtomicDatastructuresSelfTest.java index 2e983f4..385b489 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringAtomicDatastructuresSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringAtomicDatastructuresSelfTest.java @@ -17,17 +17,22 @@ package org.apache.ignite.internal.processors.rest.protocols.tcp.redis; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import redis.clients.jedis.Jedis; /** * Tests for String atomic datastructures commands of Redis protocol. */ +@RunWith(JUnit4.class) public class RedisProtocolStringAtomicDatastructuresSelfTest extends RedisCommonAbstractTest { /** * Test that threads with datastructures commands wasn't deadlocked when PME happens. * * @throws Exception If failed. */ + @Test public void testAtomicCommandsTopologyChange() throws Exception { try (Jedis jedis = pool.getResource()) { int size = grid(0).cachesx().size(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringSelfTest.java index 21a9882..e192c00 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/redis/RedisProtocolStringSelfTest.java @@ -21,16 +21,21 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import redis.clients.jedis.Jedis; import redis.clients.jedis.exceptions.JedisDataException; /** * Tests for String commands of Redis protocol. */ +@RunWith(JUnit4.class) public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGet() throws Exception { try (Jedis jedis = pool.getResource()) { jcache().put("getKey1", "getVal1"); @@ -54,6 +59,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetSet() throws Exception { try (Jedis jedis = pool.getResource()) { jcache().put("getSetKey1", "1"); @@ -77,6 +83,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMGet() throws Exception { try (Jedis jedis = pool.getResource()) { jcache().put("getKey1", "getVal1"); @@ -96,6 +103,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSet() throws Exception { long EXPIRE_MS = 1000L; int EXPIRE_SEC = 1; @@ -131,6 +139,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMSet() throws Exception { try (Jedis jedis = pool.getResource()) { jedis.mset("setKey1", "1", "setKey2", "2"); @@ -143,6 +152,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncrDecr() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(1, (long)jedis.incr("newKeyIncr")); @@ -226,6 +236,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIncrDecrBy() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(2, (long)jedis.incrBy("newKeyIncrBy", 2)); @@ -282,6 +293,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAppend() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(5, (long)jedis.append("appendKey1", "Hello")); @@ -303,6 +315,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStrlen() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(0, (long)jedis.strlen("strlenKeyNonExisting")); @@ -327,6 +340,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSetRange() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals(0, (long)jedis.setrange("setRangeKey1", 0, "")); @@ -375,6 +389,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testGetRange() throws Exception { try (Jedis jedis = pool.getResource()) { Assert.assertEquals("", jedis.getrange("getRangeKeyNonExisting", 0, 0)); @@ -402,6 +417,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDel() throws Exception { jcache().put("delKey1", "abc"); jcache().put("delKey2", "abcd"); @@ -415,6 +431,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testExists() throws Exception { jcache().put("existsKey1", "abc"); jcache().put("existsKey2", "abcd"); @@ -427,6 +444,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testExpire() throws Exception { testExpire(new Expiration() { @Override public long expire(Jedis jedis, String key) { @@ -438,6 +456,7 @@ public class RedisProtocolStringSelfTest extends RedisCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testExpireMs() throws Exception { testExpire(new Expiration() { @Override public long expire(Jedis jedis, String key) { http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java index 269e301..abb3044 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java @@ -32,6 +32,9 @@ 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; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -40,6 +43,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Tests for complex queries (joins, etc.). */ +@RunWith(JUnit4.class) public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -126,6 +130,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testJoin() throws Exception { ResultSet rs = stmt.executeQuery( "select p.id, p.name, o.name as orgName from \"pers\".Person p, \"org\".Organization o where p.orgId = o.id"); @@ -161,6 +166,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testJoinWithoutAlias() throws Exception { ResultSet rs = stmt.executeQuery( "select p.id, p.name, o.name from \"pers\".Person p, \"org\".Organization o where p.orgId = o.id"); @@ -199,6 +205,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIn() throws Exception { ResultSet rs = stmt.executeQuery("select name from \"pers\".Person where age in (25, 35)"); @@ -219,6 +226,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBetween() throws Exception { ResultSet rs = stmt.executeQuery("select name from \"pers\".Person where age between 24 and 36"); @@ -239,6 +247,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCalculatedValue() throws Exception { ResultSet rs = stmt.executeQuery("select age * 2 from \"pers\".Person"); @@ -316,4 +325,4 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { this.name = name; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java index b48d6e2..1721f1a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java @@ -30,10 +30,14 @@ 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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Connection test. */ +@RunWith(JUnit4.class) public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -95,6 +99,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDefaults() throws Exception { String url = URL_PREFIX + HOST; @@ -105,6 +110,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeId() throws Exception { String url = URL_PREFIX + HOST + "/?nodeId=" + grid(0).localNode().id(); @@ -118,6 +124,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomCache() throws Exception { String url = URL_PREFIX + HOST + "/" + CUSTOM_CACHE_NAME; @@ -127,6 +134,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomPort() throws Exception { String url = URL_PREFIX + HOST + ":" + CUSTOM_PORT; @@ -137,6 +145,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomCacheNameAndPort() throws Exception { String url = URL_PREFIX + HOST + ":" + CUSTOM_PORT + "/" + CUSTOM_CACHE_NAME; @@ -146,6 +155,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWrongCache() throws Exception { final String url = URL_PREFIX + HOST + "/wrongCacheName"; @@ -166,6 +176,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWrongPort() throws Exception { final String url = URL_PREFIX + HOST + ":33333"; @@ -186,6 +197,7 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClose() throws Exception { String url = URL_PREFIX + HOST; @@ -211,4 +223,4 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { "Connection is closed." ); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java index 897f71e..b5b1055 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java @@ -27,6 +27,9 @@ 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; import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; @@ -34,6 +37,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Tests for empty cache. */ +@RunWith(JUnit4.class) public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -100,6 +104,7 @@ public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSelectNumber() throws Exception { ResultSet rs = stmt.executeQuery("select 1"); @@ -118,6 +123,7 @@ public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSelectString() throws Exception { ResultSet rs = stmt.executeQuery("select 'str'"); @@ -131,4 +137,4 @@ public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { assert cnt == 1; } -} \ No newline at end of file +}
