Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #1

Merged
merged 1 commit into from
Jul 15, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.netflix.curator</groupId>
<artifactId>curator</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>client</artifactId>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.retry;
package com.netflix.curator.retry;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.retry;
package com.netflix.curator.retry;

import com.google.common.base.Preconditions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.retry;
package com.netflix.curator.retry;

/**
* A retry policy that retries only once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.retry;
package com.netflix.curator.retry;

/**
* A retry policy that retries until a given amount of time elapses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.retry;
package com.netflix.curator.retry;

import com.netflix.curator.RetryPolicy;
import com.netflix.curator.RetryPolicy;

abstract class SleepingRetry implements RetryPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.netflix.curator;

import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.retry.RetryOneTime;
import com.netflix.curator.utils.TestingServer;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.netflix.curator;

import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.retry.RetryOneTime;
import com.netflix.curator.utils.TestingServer;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
Expand Down
18 changes: 18 additions & 0 deletions framework/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.netflix.curator</groupId>
<artifactId>curator</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>framework</artifactId>

<dependencies>
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>client</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.netflix.curator.framework;

import com.netflix.curator.utils.TestingServer;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;

public class BaseClassForTests
{
protected TestingServer server;

@BeforeMethod
public void setup() throws Exception
{
server = new TestingServer();
}

@AfterMethod
public void teardown() throws InterruptedException
{
server.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
package com.netflix.curator.framework;

import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.retry.RetryOneTime;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
*/
package com.netflix.curator.framework;

import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.RetryPolicy;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.retry.RetryOneTime;
import com.netflix.curator.utils.TestingServer;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.data.Stat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
package com.netflix.curator.framework;

import com.google.common.io.Closeables;
import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.retry.RetryOneTime;
import org.apache.zookeeper.Watcher;
import org.testng.Assert;
import org.testng.annotations.Test;
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
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>

<groupId>curator</groupId>
<groupId>com.netflix.curator</groupId>
<artifactId>curator</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>client</module>
<module>framework</module>
<module>recipes</module>
</modules>

<dependencies>
<dependency>
Expand Down
18 changes: 18 additions & 0 deletions recipes/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.netflix.curator</groupId>
<artifactId>curator</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>recipes</artifactId>

<dependencies>
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>framework</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.netflix.curator.framework.recipes;

import com.netflix.curator.utils.TestingServer;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;

public class BaseClassForTests
{
protected TestingServer server;

@BeforeMethod
public void setup() throws Exception
{
server = new TestingServer();
}

@AfterMethod
public void teardown() throws InterruptedException
{
server.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.recipes;
package com.netflix.curator.framework.recipes.cache;

import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.framework.recipes.cache.PathChildrenCache;
import com.netflix.curator.framework.recipes.cache.PathChildrenCacheEvent;
import com.netflix.curator.framework.recipes.cache.PathChildrenCacheListener;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.framework.recipes.BaseClassForTests;
import com.netflix.curator.retry.RetryOneTime;
import junit.framework.Assert;
import org.testng.annotations.Test;
import java.util.concurrent.BlockingQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.recipes;
package com.netflix.curator.framework.recipes.leader;

import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.framework.recipes.leader.LeaderSelector;
import com.netflix.curator.framework.recipes.leader.LeaderSelectorListener;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.framework.recipes.BaseClassForTests;
import com.netflix.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.netflix.curator.framework.recipes;
package com.netflix.curator.framework.recipes.mutex;

import com.google.common.io.Closeables;
import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.framework.recipes.mutex.InterProcessMutex;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.framework.recipes.BaseClassForTests;
import com.netflix.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.concurrent.Callable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import com.google.common.io.Closeables;
import com.google.common.util.concurrent.MoreExecutors;
import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.framework.recipes.BaseClassForTests;
import com.netflix.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import com.google.common.collect.Sets;
import com.google.common.io.Closeables;
import com.netflix.curator.BaseClassForTests;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.framework.retry.RetryOneTime;
import com.netflix.curator.framework.recipes.BaseClassForTests;
import com.netflix.curator.retry.RetryOneTime;
import junit.framework.Assert;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
Expand Down