Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B9881840D for ; Wed, 17 Jun 2015 10:45:02 +0000 (UTC) Received: (qmail 45963 invoked by uid 500); 17 Jun 2015 10:45:01 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 45930 invoked by uid 500); 17 Jun 2015 10:45:01 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 45921 invoked by uid 99); 17 Jun 2015 10:45:01 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2015 10:45:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 675C21A5B54 for ; Wed, 17 Jun 2015 10:45:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id zhfzE42PHTLr for ; Wed, 17 Jun 2015 10:44:53 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 3A97A2D645 for ; Wed, 17 Jun 2015 10:44:52 +0000 (UTC) Received: (qmail 45412 invoked by uid 99); 17 Jun 2015 10:44:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2015 10:44:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33074E3C71; Wed, 17 Jun 2015 10:44:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 17 Jun 2015 10:45:01 -0000 Message-Id: <6a2b9acd599245ba8dfac346c28d36a6@git.apache.org> In-Reply-To: <26ea68dd35634e44b86ea33d72b75e0e@git.apache.org> References: <26ea68dd35634e44b86ea33d72b75e0e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/39] incubator-ignite git commit: #ignite-960: Change CacheJdbcBlobStoreFactorySelfTest:testCacheConfiguration. Start several nodes with different configuration + use TcpDiscoveryVmIpFinder. #ignite-960: Change CacheJdbcBlobStoreFactorySelfTest:testCacheConfiguration. Start several nodes with different configuration + use TcpDiscoveryVmIpFinder. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5c4bb215 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5c4bb215 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5c4bb215 Branch: refs/heads/ignite-484-1 Commit: 5c4bb215b1713df40ac8ae28f97e7f0b3a1916fe Parents: fef12fc Author: ivasilinets Authored: Tue Jun 2 13:18:30 2015 +0300 Committer: ivasilinets Committed: Tue Jun 2 13:18:30 2015 +0300 ---------------------------------------------------------------------- modules/spring/src/test/config/node.xml | 2 +- modules/spring/src/test/config/node1.xml | 45 ++++++++++++++++++++ .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 36 +++++++++++----- 3 files changed, 72 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c4bb215/modules/spring/src/test/config/node.xml ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/config/node.xml b/modules/spring/src/test/config/node.xml index 36d64cb..6f467eb 100644 --- a/modules/spring/src/test/config/node.xml +++ b/modules/spring/src/test/config/node.xml @@ -29,7 +29,7 @@ - + 127.0.0.1:47500..47509 http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c4bb215/modules/spring/src/test/config/node1.xml ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/config/node1.xml b/modules/spring/src/test/config/node1.xml new file mode 100644 index 0000000..67bae12 --- /dev/null +++ b/modules/spring/src/test/config/node1.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + 127.0.0.1:47500..47509 + + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c4bb215/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java index eebd48d..6289e34 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java @@ -31,6 +31,9 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { /** Cache name. */ private static final String CACHE_NAME = "test"; + /** User name. */ + private static final String USER_NAME = "GridGain"; + /** * @throws Exception If failed. */ @@ -49,20 +52,33 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { */ public void testCacheConfiguration() throws Exception { try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) { - CacheConfiguration cfg = new CacheConfiguration<>(); + try (Ignite ignite1 = Ignition.start("modules/spring/src/test/config/node1.xml")) { + try (IgniteCache cache = ignite.getOrCreateCache(cacheConfiguration())) { + try (IgniteCache cache1 = ignite1.getOrCreateCache(cacheConfiguration())) { + checkStore(cache, JdbcDataSource.class); + + checkStore(cache1, ConnectionPoolDataSource.class); + } + } + } + } + } - CacheJdbcBlobStoreFactory factory = new CacheJdbcBlobStoreFactory(); + /** + * @return Cache configuration with store. + */ + private CacheConfiguration cacheConfiguration() { + CacheConfiguration cfg = new CacheConfiguration<>(); - factory.setUser("GridGain"); + CacheJdbcBlobStoreFactory factory = new CacheJdbcBlobStoreFactory(); - factory.setDataSourceBean("simpleDataSource"); + factory.setUser(USER_NAME); - cfg.setCacheStoreFactory(factory); + factory.setDataSourceBean("simpleDataSource"); - try(IgniteCache cache = ignite.getOrCreateCache(cfg)) { - checkStore(cache, JdbcDataSource.class); - } - } + cfg.setCacheStoreFactory(factory); + + return cfg; } /** @@ -74,7 +90,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest { CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class). getCacheStoreFactory().create(); - assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user")); + assertEquals(USER_NAME, GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user")); assertEquals(dataSrcClass, GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());