http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java index 8fd9356..e4d7d15 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java @@ -22,10 +22,14 @@ import org.apache.ignite.configuration.IgniteConfiguration; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Base class for complex SQL tests based on JDBC driver. */ +@RunWith(JUnit4.class) public class JdbcThinComplexDmlDdlCustomSchemaSelfTest extends JdbcThinComplexDmlDdlSelfTest { /** Simple schema. */ private static final String SCHEMA_1 = "SCHEMA_1"; @@ -55,6 +59,7 @@ public class JdbcThinComplexDmlDdlCustomSchemaSelfTest extends JdbcThinComplexDm * * @throws Exception If failed. */ + @Test public void testCreateSelectDropEscapedSchema() throws Exception { try { curSchema = SCHEMA_2; @@ -71,8 +76,9 @@ public class JdbcThinComplexDmlDdlCustomSchemaSelfTest extends JdbcThinComplexDm * * @throws Exception If failed. */ + @Test public void testMultiple() throws Exception { testCreateSelectDrop(); testCreateSelectDrop(); } -} \ 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/thin/JdbcThinComplexDmlDdlSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlSelfTest.java index 88fcab2..f721e0c 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlSelfTest.java @@ -39,10 +39,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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Base class for complex SQL tests based on JDBC driver. */ +@RunWith(JUnit4.class) public class JdbcThinComplexDmlDdlSelfTest extends GridCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -127,6 +131,7 @@ public class JdbcThinComplexDmlDdlSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCreateSelectDrop() throws Exception { conn = createConnection(); @@ -476,4 +481,4 @@ public class JdbcThinComplexDmlDdlSelfTest extends GridCommonAbstractTest { return Arrays.toString(row); } } -} \ 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/thin/JdbcThinComplexQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java index f93c4fa..19903e3 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java @@ -31,6 +31,9 @@ import org.apache.ignite.internal.util.typedef.F; 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.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; @@ -39,6 +42,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Tests for complex queries (joins, etc.). */ +@RunWith(JUnit4.class) public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -130,6 +134,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** * @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"); @@ -165,6 +170,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** * @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"); @@ -203,6 +209,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testIn() throws Exception { ResultSet rs = stmt.executeQuery("select name from \"pers\".Person where age in (25, 35)"); @@ -223,6 +230,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** * @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"); @@ -243,6 +251,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCalculatedValue() throws Exception { ResultSet rs = stmt.executeQuery("select age * 2 from \"pers\".Person"); @@ -320,4 +329,4 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest { 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/thin/JdbcThinConnectionMultipleAddressesTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMultipleAddressesTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMultipleAddressesTest.java index 4f6651c..a5840c6 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMultipleAddressesTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMultipleAddressesTest.java @@ -45,11 +45,15 @@ 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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * JDBC driver reconnect test with multiple addresses. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -131,6 +135,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesConnect() throws Exception { try (Connection conn = DriverManager.getConnection(url())) { try (Statement stmt = conn.createStatement()) { @@ -148,6 +153,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testPortRangeConnect() throws Exception { try (Connection conn = DriverManager.getConnection(URL_PORT_RANGE)) { try (Statement stmt = conn.createStatement()) { @@ -165,6 +171,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesOneNodeFailoverOnStatementExecute() throws Exception { checkReconnectOnStatementExecute(url(), false); } @@ -172,6 +179,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesAllNodesFailoverOnStatementExecute() throws Exception { checkReconnectOnStatementExecute(url(), true); } @@ -179,6 +187,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testPortRangeAllNodesFailoverOnStatementExecute() throws Exception { checkReconnectOnStatementExecute(URL_PORT_RANGE, true); } @@ -186,6 +195,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesOneNodeFailoverOnResultSet() throws Exception { checkReconnectOnResultSet(url(), false); } @@ -193,6 +203,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesAllNodesFailoverOnResultSet() throws Exception { checkReconnectOnResultSet(url(), true); } @@ -200,6 +211,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testPortRangeAllNodesFailoverOnResultSet() throws Exception { checkReconnectOnResultSet(URL_PORT_RANGE, true); } @@ -207,6 +219,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesOneNodeFailoverOnMeta() throws Exception { checkReconnectOnMeta(url(), false); } @@ -214,6 +227,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesAllNodesFailoverOnMeta() throws Exception { checkReconnectOnMeta(url(), true); } @@ -221,6 +235,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testPortRangeAllNodesFailoverOnMeta() throws Exception { checkReconnectOnMeta(URL_PORT_RANGE, true); } @@ -228,6 +243,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testMultipleAddressesOneNodeFailoverOnStreaming() throws Exception { checkReconnectOnStreaming(url(), false); } @@ -235,6 +251,7 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel /** * @throws Exception If failed. */ + @Test public void testClientConnectionMXBean() throws Exception { Connection conn = DriverManager.getConnection(URL_PORT_RANGE); @@ -548,4 +565,4 @@ public class JdbcThinConnectionMultipleAddressesTest extends JdbcThinAbstractSel if (all) startGrids(NODES_CNT); } -} \ 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/thin/JdbcThinConnectionMvccEnabledSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java index a26f547..d186dcd 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java @@ -33,6 +33,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridStringLogger; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.sql.Connection.TRANSACTION_NONE; import static java.sql.Connection.TRANSACTION_READ_COMMITTED; @@ -44,6 +47,7 @@ import static java.sql.Connection.TRANSACTION_SERIALIZABLE; * Connection test. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -99,6 +103,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testMetadataDefaults() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -117,6 +122,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testGetSetAutoCommit() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assertTrue(conn.getMetaData().supportsTransactions()); @@ -145,6 +151,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testCommit() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assertTrue(conn.getMetaData().supportsTransactions()); @@ -180,6 +187,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testRollback() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assertTrue(conn.getMetaData().supportsTransactions()); @@ -215,6 +223,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testSetSavepoint() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -254,6 +263,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testSetSavepointName() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -308,6 +318,7 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT /** * @throws Exception If failed. */ + @Test public void testRollbackSavePoint() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -373,4 +384,4 @@ public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfT } }; } -} \ 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/thin/JdbcThinConnectionSSLTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java index 355a198..10d6570 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java @@ -37,11 +37,15 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.ssl.SslContextFactory; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * SSL connection test. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -95,6 +99,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testConnection() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -118,6 +123,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testConnectionTrustAll() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -140,6 +146,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testConnectionUseIgniteFactory() throws Exception { setSslCtxFactoryToIgnite = true; sslCtxFactory = getTestSslContextFactory(); @@ -163,6 +170,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testDefaultContext() throws Exception { // Store exists default SSL context to restore after test. final SSLContext dfltSslCtx = SSLContext.getDefault(); @@ -200,6 +208,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testContextFactory() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -218,6 +227,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSslServerAndPlainClient() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -241,6 +251,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testInvalidKeystoreConfig() throws Exception { setSslCtxFactoryToCli = true; @@ -329,6 +340,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testUnknownClientCertificate() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -356,6 +368,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testUnsupportedSslProtocol() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -384,6 +397,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testInvalidKeyAlgorithm() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -412,6 +426,7 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testInvalidKeyStoreType() throws Exception { setSslCtxFactoryToCli = true; sslCtxFactory = getTestSslContextFactory(); @@ -476,4 +491,4 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { return getTestSslContextFactory().create().getSocketFactory(); } } -} \ 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/thin/JdbcThinConnectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java index 5d2a33e..11f9770 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java @@ -53,6 +53,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridStringLogger; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.sql.Connection.TRANSACTION_NONE; import static java.sql.Connection.TRANSACTION_READ_COMMITTED; @@ -72,6 +75,7 @@ import static org.apache.ignite.internal.processors.odbc.SqlStateCode.TRANSACTIO * Connection test. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -131,6 +135,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ @SuppressWarnings({"EmptyTryBlock", "unused"}) + @Test public void testDefaults() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) { // No-op. @@ -144,6 +149,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * Test invalid endpoint. */ + @Test public void testInvalidEndpoint() { assertInvalid("jdbc:ignite:thin://", "Host name is empty"); assertInvalid("jdbc:ignite:thin://:10000", "Host name is empty"); @@ -160,6 +166,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSocketBuffers() throws Exception { final int dfltDufSize = 64 * 1024; @@ -197,6 +204,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSocketBuffersSemicolon() throws Exception { final int dfltDufSize = 64 * 1024; @@ -229,6 +237,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSqlHints() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) { assertHints(conn, false, false, false, false, false, false); @@ -269,6 +278,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSqlHintsSemicolon() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;distributedJoins=true")) { assertHints(conn, true, false, false, false, false, false); @@ -327,6 +337,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testTcpNoDelay() throws Exception { assertInvalid("jdbc:ignite:thin://127.0.0.1?tcpNoDelay=0", "Invalid property value. [name=tcpNoDelay, val=0, choices=[true, false]]"); @@ -366,6 +377,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testTcpNoDelaySemicolon() throws Exception { assertInvalid("jdbc:ignite:thin://127.0.0.1;tcpNoDelay=0", "Invalid property value. [name=tcpNoDelay, val=0, choices=[true, false]]"); @@ -401,6 +413,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testAutoCloseServerCursorProperty() throws Exception { String url = "jdbc:ignite:thin://127.0.0.1?autoCloseServerCursor"; @@ -437,6 +450,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testAutoCloseServerCursorPropertySemicolon() throws Exception { String url = "jdbc:ignite:thin://127.0.0.1;autoCloseServerCursor"; @@ -469,6 +483,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSchema() throws Exception { assertInvalid("jdbc:ignite:thin://127.0.0.1/qwe/qwe", "Invalid URL format (only schema name is allowed in URL path parameter 'host:port[/schemaName]')" ); @@ -491,6 +506,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testSchemaSemicolon() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;schema=public")) { assertEquals("Invalid schema", "PUBLIC", conn.getSchema()); @@ -539,6 +555,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ @SuppressWarnings("ThrowableNotThrown") + @Test public void testClose() throws Exception { final Connection conn; @@ -565,6 +582,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateStatement() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { try (Statement stmt = conn.createStatement()) { @@ -587,6 +605,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateStatement2() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { int [] rsTypes = new int[] @@ -640,6 +659,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateStatement3() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { int [] rsTypes = new int[] @@ -699,6 +719,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrepareStatement() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // null query text @@ -732,6 +753,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrepareStatement3() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String sqlText = "select * from test where param = ?"; @@ -792,6 +814,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrepareStatement4() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String sqlText = "select * from test where param = ?"; @@ -857,6 +880,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrepareStatementAutoGeneratedKeysUnsupported() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String sqlText = "insert into test (val) values (?)"; @@ -906,6 +930,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrepareCallUnsupported() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String sqlText = "exec test()"; @@ -946,6 +971,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testNativeSql() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // null query text @@ -977,6 +1003,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetAutoCommit() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { boolean ac0 = conn.getAutoCommit(); @@ -1001,6 +1028,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCommit() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Should not be called in auto-commit mode @@ -1045,6 +1073,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testRollback() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Should not be called in auto-commit mode @@ -1074,6 +1103,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception if failed. */ + @Test public void testBeginFailsWhenMvccIsDisabled() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.createStatement().execute("BEGIN"); @@ -1088,6 +1118,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception if failed. */ + @Test public void testCommitIgnoredWhenMvccIsDisabled() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.setAutoCommit(false); @@ -1101,6 +1132,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception if failed. */ + @Test public void testRollbackIgnoredWhenMvccIsDisabled() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.setAutoCommit(false); @@ -1115,6 +1147,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetMetaData() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -1135,6 +1168,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetReadOnly() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.close(); @@ -1158,6 +1192,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetCatalog() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsCatalogsInDataManipulation(); @@ -1189,6 +1224,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetTransactionIsolation() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Invalid parameter value @@ -1239,6 +1275,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testClearGetWarnings() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { SQLWarning warn = conn.getWarnings(); @@ -1272,6 +1309,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetTypeMap() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { GridTestUtils.assertThrows(log, @@ -1327,6 +1365,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetHoldability() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // default value @@ -1380,6 +1419,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSetSavepoint() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -1410,6 +1450,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSetSavepointName() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -1455,6 +1496,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testRollbackSavePoint() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -1500,6 +1542,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testReleaseSavepoint() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert !conn.getMetaData().supportsSavepoints(); @@ -1538,6 +1581,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateClob() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Unsupported @@ -1568,6 +1612,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateBlob() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Unsupported @@ -1598,6 +1643,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateNClob() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Unsupported @@ -1628,6 +1674,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateSQLXML() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Unsupported @@ -1658,6 +1705,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetClientInfoPair() throws Exception { // fail("https://issues.apache.org/jira/browse/IGNITE-5425"); @@ -1693,6 +1741,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetClientInfoProperties() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String name = "ApplicationName"; @@ -1731,6 +1780,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateArrayOf() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { final String typeName = "varchar"; @@ -1771,6 +1821,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testCreateStruct() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // Invalid typename @@ -1807,6 +1858,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetSchema() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assertEquals("PUBLIC", conn.getSchema()); @@ -1840,6 +1892,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testAbort() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { //Invalid executor @@ -1866,6 +1919,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetSetNetworkTimeout() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // default @@ -1924,6 +1978,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * Test that attempting to supply invalid nested TX mode to driver fails on the client. */ + @Test public void testInvalidNestedTxMode() { GridTestUtils.assertThrows(null, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1939,6 +1994,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { * We have to do this without explicit {@link Connection} as long as there's no other way to bypass validation and * supply a malformed {@link ConnectionProperties} to {@link JdbcThinTcpIo}. */ + @Test public void testInvalidNestedTxModeOnServerSide() throws SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException { ConnectionPropertiesImpl connProps = new ConnectionPropertiesImpl(); @@ -1973,6 +2029,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** */ + @Test public void testSslClientAndPlainServer() { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1990,6 +2047,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testMultithreadingException() throws Exception { int threadCnt = 10; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java index 6040bed..cead71a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java @@ -43,11 +43,15 @@ 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.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * DataSource test. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -98,6 +102,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testJndi() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -117,6 +122,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testUrlCompose() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -139,6 +145,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testResetUrl() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -157,6 +164,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSqlHints() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -195,6 +203,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testTcpNoDelay() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -218,6 +227,7 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSocketBuffers() throws Exception { final IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); @@ -426,4 +436,4 @@ public class JdbcThinDataSourceSelfTest extends JdbcThinAbstractSelfTest { return null; } } -} \ 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/thin/JdbcThinDeleteStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDeleteStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDeleteStatementSelfTest.java index 9d0665b..d11e5bb 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDeleteStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDeleteStatementSelfTest.java @@ -20,14 +20,19 @@ package org.apache.ignite.jdbc.thin; import java.sql.SQLException; import java.util.Arrays; import java.util.HashSet; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class JdbcThinDeleteStatementSelfTest extends JdbcThinAbstractUpdateStatementSelfTest { /** * @throws SQLException If failed. */ + @Test public void testExecute() throws SQLException { conn.createStatement().execute("delete from Person where cast(substring(_key, 2, 1) as int) % 2 = 0"); @@ -38,6 +43,7 @@ public class JdbcThinDeleteStatementSelfTest extends JdbcThinAbstractUpdateState /** * @throws SQLException If failed. */ + @Test public void testExecuteUpdate() throws SQLException { int res = conn.createStatement().executeUpdate("delete from Person where cast(substring(_key, 2, 1) as int) % 2 = 0"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java index 539713a..765ca83 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java @@ -33,10 +33,14 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test that checks indexes handling with JDBC. */ +@RunWith(JUnit4.class) public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstractDmlStatementSelfTest { /** */ private static final String CREATE_INDEX = "create index idx on Person (id desc)"; @@ -143,6 +147,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that after index creation index is used by queries. * @throws SQLException If failed. */ + @Test public void testCreateIndex() throws SQLException { assertSize(3); @@ -173,6 +178,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that creating an index with duplicate name yields an error. * @throws SQLException If failed. */ + @Test public void testCreateIndexWithDuplicateName() throws SQLException { jdbcRun(CREATE_INDEX); @@ -189,6 +195,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that creating an index with duplicate name does not yield an error with {@code IF NOT EXISTS}. * @throws SQLException If failed. */ + @Test public void testCreateIndexIfNotExists() throws SQLException { jdbcRun(CREATE_INDEX); @@ -200,6 +207,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that after index drop there are no attempts to use it, and data state remains intact. * @throws SQLException If failed. */ + @Test public void testDropIndex() throws SQLException { assertSize(3); @@ -229,6 +237,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr /** * Test that dropping a non-existent index yields an error. */ + @Test public void testDropMissingIndex() { GridTestUtils.assertThrowsAnyCause(log, new Callable<Void>() { @Override public Void call() throws Exception { @@ -243,6 +252,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that dropping a non-existent index does not yield an error with {@code IF EXISTS}. * @throws SQLException If failed. */ + @Test public void testDropMissingIndexIfExists() throws SQLException { // Despite index missing, this does not yield an error. jdbcRun(DROP_INDEX_IF_EXISTS); @@ -252,6 +262,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr * Test that changes in cache affect index, and vice versa. * @throws SQLException If failed. */ + @Test public void testIndexState() throws SQLException { IgniteCache<String, Person> cache = cache(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java index 87c1428..f67fc52 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.configuration.IgniteConfiguration; 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.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; @@ -33,6 +36,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Tests for empty cache. */ +@RunWith(JUnit4.class) public class JdbcThinEmptyCacheSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -104,6 +108,7 @@ public class JdbcThinEmptyCacheSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSelectNumber() throws Exception { ResultSet rs = stmt.executeQuery("select 1"); @@ -122,6 +127,7 @@ public class JdbcThinEmptyCacheSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSelectString() throws Exception { ResultSet rs = stmt.executeQuery("select 'str'"); @@ -135,4 +141,4 @@ public class JdbcThinEmptyCacheSelfTest extends JdbcThinAbstractSelfTest { assert cnt == 1; } -} \ 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/thin/JdbcThinErrorsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinErrorsSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinErrorsSelfTest.java index 633cdc3..218b39e 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinErrorsSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinErrorsSelfTest.java @@ -24,12 +24,16 @@ import java.sql.SQLException; import java.sql.Statement; import org.apache.ignite.jdbc.JdbcErrorsAbstractSelfTest; import org.apache.ignite.lang.IgniteCallable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.junit.Assert.assertArrayEquals; /** * Test SQLSTATE codes propagation with thin client driver. */ +@RunWith(JUnit4.class) public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { /** {@inheritDoc} */ @Override protected Connection getConnection() throws SQLException { @@ -41,6 +45,7 @@ public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { * due to <b>communication problems</b> (not due to clear misconfiguration). * @throws SQLException if failed. */ + @Test public void testConnectionError() throws SQLException { checkErrorState(new IgniteCallable<Void>() { @Override public Void call() throws Exception { @@ -55,6 +60,7 @@ public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { * Test error code for the case when connection string is a mess. * @throws SQLException if failed. */ + @Test public void testInvalidConnectionStringFormat() throws SQLException { checkErrorState(new IgniteCallable<Void>() { @Override public Void call() throws Exception { @@ -71,6 +77,7 @@ public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { * @throws SQLException if failed. */ @SuppressWarnings("MagicConstant") + @Test public void testInvalidIsolationLevel() throws SQLException { checkErrorState(new ConnClosure() { @Override public void run(Connection conn) throws Exception { @@ -83,6 +90,7 @@ public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { * Test error code for the case when error is caused on batch execution. * @throws SQLException if failed. */ + @Test public void testBatchUpdateException() throws SQLException { try (final Connection conn = getConnection()) { try (Statement stmt = conn.createStatement()) { @@ -113,6 +121,7 @@ public class JdbcThinErrorsSelfTest extends JdbcErrorsAbstractSelfTest { * Check that unsupported explain of update operation causes Exception on the driver side with correct code and * message. */ + @Test public void testExplainUpdatesUnsupported() throws Exception{ checkErrorState((conn) -> { try (Statement statement = conn.createStatement()) { http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinInsertStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinInsertStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinInsertStatementSelfTest.java index bf55da0..50c197a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinInsertStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinInsertStatementSelfTest.java @@ -25,10 +25,14 @@ import java.util.Arrays; import java.util.HashSet; import java.util.concurrent.Callable; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Statement test. */ +@RunWith(JUnit4.class) public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatementSelfTest { /** SQL query. */ private static final String SQL = "insert into Person(_key, id, firstName, lastName, age) values " + @@ -140,6 +144,7 @@ public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatemen /** * @throws SQLException If failed. */ + @Test public void testExecuteUpdate() throws SQLException { assertEquals(3, stmt.executeUpdate(SQL)); } @@ -147,6 +152,7 @@ public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatemen /** * @throws SQLException If failed. */ + @Test public void testPreparedExecuteUpdate() throws SQLException { assertEquals(3, prepStmt.executeUpdate()); } @@ -154,6 +160,7 @@ public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatemen /** * @throws SQLException If failed. */ + @Test public void testExecute() throws SQLException { assertFalse(stmt.execute(SQL)); } @@ -161,6 +168,7 @@ public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatemen /** * @throws SQLException If failed. */ + @Test public void testPreparedExecute() throws SQLException { assertFalse(prepStmt.execute()); } @@ -168,6 +176,7 @@ public class JdbcThinInsertStatementSelfTest extends JdbcThinAbstractDmlStatemen /** * */ + @Test public void testDuplicateKeys() { jcache(0).put("p2", new Person(2, "Joe", "Black", 35)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java index 1e28e52..7bb7168 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java @@ -23,10 +23,14 @@ import java.util.List; import java.util.Map; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test that replicated-only query is executed locally. */ +@RunWith(JUnit4.class) public class JdbcThinLocalQueriesSelfTest extends JdbcThinAbstractSelfTest { /** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { @@ -47,6 +51,7 @@ public class JdbcThinLocalQueriesSelfTest extends JdbcThinAbstractSelfTest { /** * */ + @Test public void testLocalThinJdbcQuery() throws SQLException { try (Connection c = connect(grid(0), "replicatedOnly=true")) { execute(c, "CREATE TABLE Company(id int primary key, name varchar) WITH " + http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMergeStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMergeStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMergeStatementSelfTest.java index 9d9467f..11911ba 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMergeStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMergeStatementSelfTest.java @@ -21,10 +21,14 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * MERGE statement test. */ +@RunWith(JUnit4.class) public class JdbcThinMergeStatementSelfTest extends JdbcThinAbstractDmlStatementSelfTest { /** SQL query. */ private static final String SQL = "merge into Person(_key, id, firstName, lastName, age) values " + @@ -117,6 +121,7 @@ public class JdbcThinMergeStatementSelfTest extends JdbcThinAbstractDmlStatement /** * @throws SQLException If failed. */ + @Test public void testExecuteUpdate() throws SQLException { assertEquals(3, stmt.executeUpdate(SQL)); } @@ -124,6 +129,7 @@ public class JdbcThinMergeStatementSelfTest extends JdbcThinAbstractDmlStatement /** * @throws SQLException If failed. */ + @Test public void testExecute() throws SQLException { assertFalse(stmt.execute(SQL)); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataPrimaryKeysSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataPrimaryKeysSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataPrimaryKeysSelfTest.java index 5733b72..a4ef311 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataPrimaryKeysSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataPrimaryKeysSelfTest.java @@ -27,10 +27,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Verifies that primary keys in the metadata are valid. */ +@RunWith(JUnit4.class) public class JdbcThinMetadataPrimaryKeysSelfTest extends GridCommonAbstractTest { /** Url. */ private static final String URL = "jdbc:ignite:thin://127.0.0.1"; @@ -68,6 +72,7 @@ public class JdbcThinMetadataPrimaryKeysSelfTest extends GridCommonAbstractTest /** * Checks for PK that contains single unwrapped field. */ + @Test public void testSingleUnwrappedKey() throws Exception { executeUpdate("CREATE TABLE TEST (ID LONG PRIMARY KEY, NAME VARCHAR);"); @@ -77,6 +82,7 @@ public class JdbcThinMetadataPrimaryKeysSelfTest extends GridCommonAbstractTest /** * Checks for PK that contains single field. Key is forcibly wrapped. */ + @Test public void testSingleWrappedKey() throws Exception { executeUpdate("CREATE TABLE TEST (" + "ID LONG PRIMARY KEY, " + @@ -89,6 +95,7 @@ public class JdbcThinMetadataPrimaryKeysSelfTest extends GridCommonAbstractTest /** * Checks for composite (so implicitly wrapped) primary key. */ + @Test public void testCompositeKey() throws Exception { executeUpdate("CREATE TABLE TEST (" + "ID LONG, " + @@ -102,6 +109,7 @@ public class JdbcThinMetadataPrimaryKeysSelfTest extends GridCommonAbstractTest /** * Checks for composite (so implicitly wrapped) primary key. Additionally, affinity key is used. */ + @Test public void testCompositeKeyWithAK() throws Exception { final String tpl = "CREATE TABLE TEST (" + "ID LONG, " + http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java index df67666..04c2efd 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java @@ -51,6 +51,9 @@ import org.apache.ignite.internal.util.typedef.F; 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.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.sql.Types.INTEGER; import static java.sql.Types.VARCHAR; @@ -63,6 +66,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Metadata tests. */ +@RunWith(JUnit4.class) public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -106,7 +110,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { startGridsMultiThreaded(3); Map<String, Integer> orgPrecision = new HashMap<>(); - + orgPrecision.put("name", 42); IgniteCache<String, Organization> orgCache = jcache(grid(0), @@ -147,7 +151,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { personCache.put(new AffinityKey<>("p2", "o1"), new Person("Joe Black", 35, 1)); personCache.put(new AffinityKey<>("p3", "o2"), new Person("Mike Green", 40, 2)); - IgniteCache<Integer, Department> departmentCache = jcache(grid(0), + IgniteCache<Integer, Department> departmentCache = jcache(grid(0), defaultCacheConfiguration().setIndexedTypes(Integer.class, Department.class), "dep"); try (Connection conn = DriverManager.getConnection(URL)) { @@ -167,6 +171,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testResultSetMetaData() throws Exception { Connection conn = DriverManager.getConnection(URL); @@ -203,6 +208,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testDecimalAndDateTypeMetaData() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { Statement stmt = conn.createStatement(); @@ -237,6 +243,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetTables() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -285,6 +292,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetAllTables() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -316,6 +324,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetColumns() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.setSchema("pers"); @@ -428,6 +437,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetAllColumns() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -481,6 +491,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testInvalidCatalog() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { DatabaseMetaData meta = conn.getMetaData(); @@ -510,6 +521,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testIndexMetadata() throws Exception { try (Connection conn = DriverManager.getConnection(URL); ResultSet rs = conn.getMetaData().getIndexInfo(null, "pers", "PERSON", false, false)) { @@ -548,6 +560,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetAllIndexes() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { ResultSet rs = conn.getMetaData().getIndexInfo(null, null, null, false, false); @@ -576,6 +589,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testPrimaryKeyMetadata() throws Exception { try (Connection conn = DriverManager.getConnection(URL); ResultSet rs = conn.getMetaData().getPrimaryKeys(null, "pers", "PERSON")) { @@ -595,6 +609,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testGetAllPrimaryKeys() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { ResultSet rs = conn.getMetaData().getPrimaryKeys(null, null, null); @@ -627,6 +642,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testParametersMetadata() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.setSchema("\"pers\""); @@ -651,6 +667,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSchemasMetadata() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { ResultSet rs = conn.getMetaData().getSchemas(); @@ -674,6 +691,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { * Negative scenarios for catalog name. * Perform metadata lookups, that use incorrect catalog names. */ + @Test public void testCatalogWithNotExistingName() throws SQLException { checkNoEntitiesFoundForCatalog(""); checkNoEntitiesFoundForCatalog("NOT_EXISTING_CATALOG"); @@ -725,6 +743,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testEmptySchemasMetadata() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { ResultSet rs = conn.getMetaData().getSchemas(null, "qqq"); @@ -736,6 +755,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testVersions() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { assert conn.getMetaData().getDatabaseProductVersion().equals(IgniteVersionUtils.VER.toString()); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java index f78ce70..6363e13 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java @@ -35,10 +35,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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class JdbcThinMissingLongArrayResultsTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -165,6 +169,7 @@ public class JdbcThinMissingLongArrayResultsTest extends JdbcThinAbstractSelfTes * @throws Exception If failed. */ @SuppressWarnings({"unused"}) + @Test public void testDefaults() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { conn.setSchema('"' + CACHE_NAME + '"'); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java index 53425c8..b4f7788 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java @@ -32,10 +32,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.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -104,6 +108,7 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ @SuppressWarnings({"EmptyTryBlock", "unused"}) + @Test public void testDefaults() throws Exception { try (Connection conn = DriverManager.getConnection(URL)) { // No-op. @@ -117,6 +122,7 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSchemaNameInQuery() throws Exception { Connection conn = DriverManager.getConnection(URL); @@ -155,6 +161,7 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSchemaInUrl() throws Exception { try(Connection conn = DriverManager.getConnection(URL + "/\"cache1\"")) { Statement stmt = conn.createStatement(); @@ -182,6 +189,7 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSchemaInUrlAndInQuery() throws Exception { try(Connection conn = DriverManager.getConnection(URL + "/\"cache2\"")) { Statement stmt = conn.createStatement(); @@ -201,6 +209,7 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest { /** * @throws Exception If failed. */ + @Test public void testSetSchema() throws Exception { try(Connection conn = DriverManager.getConnection(URL)) { // Try to execute query without set schema http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java index 36bc80c..97887fd 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java @@ -44,6 +44,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.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.sql.Types.BIGINT; import static java.sql.Types.BINARY; @@ -65,6 +68,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; * Prepared statement test. */ @SuppressWarnings("ThrowableNotThrown") +@RunWith(JUnit4.class) public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -167,6 +171,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testRepeatableUsage() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where id = ?"); @@ -202,6 +207,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testQueryExecuteException() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where boolVal is not distinct from ?"); @@ -259,6 +265,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testBoolean() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where boolVal is not distinct from ?"); @@ -298,6 +305,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testByte() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where byteVal is not distinct from ?"); @@ -337,6 +345,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testShort() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where shortVal is not distinct from ?"); @@ -376,6 +385,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testInteger() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where intVal is not distinct from ?"); @@ -415,6 +425,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testLong() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where longVal is not distinct from ?"); @@ -454,6 +465,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testFloat() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where floatVal is not distinct from ?"); @@ -493,6 +505,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testDouble() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where doubleVal is not distinct from ?"); @@ -532,6 +545,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testBigDecimal() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where bigVal is not distinct from ?"); @@ -571,6 +585,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testString() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where strVal is not distinct from ?"); @@ -610,6 +625,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testArray() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where arrVal is not distinct from ?"); @@ -649,6 +665,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testDate() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where dateVal is not distinct from ?"); @@ -688,6 +705,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testTime() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where timeVal is not distinct from ?"); @@ -727,6 +745,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testTimestamp() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where tsVal is not distinct from ?"); @@ -766,6 +785,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testClearParameter() throws Exception { stmt = conn.prepareStatement(SQL_PART + " where boolVal is not distinct from ?"); @@ -789,6 +809,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest /** * @throws Exception If failed. */ + @Test public void testNotSupportedTypes() throws Exception { stmt = conn.prepareStatement(""); @@ -1049,4 +1070,4 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest this.id = id; } } -} \ No newline at end of file +}
