Repository: ignite Updated Branches: refs/heads/ignite-3038 b4883e654 -> c0e8c420e
IGNITE-2718: Added Zookeeper IP finder dependencies. Backport Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eade5137 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eade5137 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eade5137 Branch: refs/heads/ignite-3038 Commit: eade513759e9df46896bd7524f224a1845adef47 Parents: 303d3ca Author: shtykh_roman <[email protected]> Authored: Wed Mar 2 06:02:27 2016 +0300 Committer: Anton Vinogradov <[email protected]> Committed: Fri May 27 18:01:55 2016 +0300 ---------------------------------------------------------------------- modules/zookeeper/pom.xml | 50 +++++++++++++++++++- .../tcp/ipfinder/zk/ZookeeperIpFinderTest.java | 24 ++++++---- 2 files changed, 63 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/eade5137/modules/zookeeper/pom.xml ---------------------------------------------------------------------- diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml index e296b55..b749c30 100644 --- a/modules/zookeeper/pom.xml +++ b/modules/zookeeper/pom.xml @@ -20,7 +20,8 @@ <!-- POM file. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -55,6 +56,53 @@ <dependency> <groupId>org.apache.curator</groupId> + <artifactId>curator-client</artifactId> + <version>${curator.version}</version> + </dependency> + + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>${guava16.version}</version> + </dependency> + + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-core-asl</artifactId> + <version>${jackson.version}</version> + </dependency> + + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-mapper-asl</artifactId> + <version>${jackson.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.zookeeper</groupId> + <artifactId>zookeeper</artifactId> + <version>${zookeeper.version}</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${slf4j.version}</version> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.curator</groupId> <artifactId>curator-test</artifactId> <version>${curator.version}</version> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/ignite/blob/eade5137/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java ---------------------------------------------------------------------- diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java index c19a8fc..ec868ea 100644 --- a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java +++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java @@ -27,6 +27,7 @@ import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.retry.RetryNTimes; import org.apache.curator.test.InstanceSpec; import org.apache.curator.test.TestingCluster; +import org.apache.curator.utils.CloseableUtils; import org.apache.ignite.Ignite; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.events.Event; @@ -64,6 +65,7 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { /** * Before test. + * * @throws Exception */ @Override public void beforeTest() throws Exception { @@ -72,6 +74,9 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { // remove stale system properties System.getProperties().remove(TcpDiscoveryZookeeperIpFinder.PROP_ZK_CONNECTION_STRING); + // disable JMX for tests + System.setProperty("zookeeper.jmx.log4j.disable", "true"); + // start the ZK cluster zkCluster = new TestingCluster(ZK_CLUSTER_SIZE); zkCluster.start(); @@ -84,18 +89,17 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { /** * After test. + * * @throws Exception */ @Override public void afterTest() throws Exception { super.afterTest(); if (zkCurator != null) - zkCurator.close(); + CloseableUtils.closeQuietly(zkCurator); - if (zkCluster != null) { - zkCluster.stop(); - zkCluster.close(); - } + if (zkCluster != null) + CloseableUtils.closeQuietly(zkCluster); stopAllGrids(); @@ -111,7 +115,7 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration configuration = super.getConfiguration(gridName); - TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi) configuration.getDiscoverySpi(); + TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)configuration.getDiscoverySpi(); TcpDiscoveryZookeeperIpFinder zkIpFinder = new TcpDiscoveryZookeeperIpFinder(); zkIpFinder.setAllowDuplicateRegistrations(isAllowDuplicateRegistrations()); @@ -148,7 +152,7 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { startGrid(0); // set up an event listener to expect one NODE_JOINED event - CountDownLatch latch = expectJoinEvents(grid(0), 1); + CountDownLatch latch = expectJoinEvents(grid(0), 1); // start the other node startGrid(1); @@ -171,7 +175,7 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { startGrid(0); // set up an event listener to expect one NODE_JOINED event - CountDownLatch latch = expectJoinEvents(grid(0), 2); + CountDownLatch latch = expectJoinEvents(grid(0), 2); // start the 2nd node startGrid(1); @@ -202,7 +206,7 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { startGrid(0); // set up an event listener to expect one NODE_JOINED event - CountDownLatch latch = expectJoinEvents(grid(0), 3); + CountDownLatch latch = expectJoinEvents(grid(0), 3); // start the 2nd node startGrid(1); @@ -392,4 +396,4 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { public boolean isAllowDuplicateRegistrations() { return allowDuplicateRegistrations; } -} \ No newline at end of file +}
