Skip to content

Commit

Permalink
Merge pull request apache#9 from tausten/trunk
Browse files Browse the repository at this point in the history
Use IZooKeeper instead of ZooKeeper directly to permit mocking.
  • Loading branch information
ewhauser committed Jun 11, 2013
2 parents 1378344 + 0064269 commit adb349e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/dotnet/ZooKeeperNet.Recipes/ProtocolSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public abstract class ProtocolSupport : IDisposable

private int closed;

public ProtocolSupport(ZooKeeper zookeeper)
public ProtocolSupport(IZooKeeper zookeeper)
{
RetryDelay = new TimeSpan(0, 0, 0, 0, 500);
Acl = Ids.OPEN_ACL_UNSAFE;
RetryCount = 10;
Zookeeper = zookeeper;
}

public ZooKeeper Zookeeper { get; set; }
public IZooKeeper Zookeeper { get; set; }

public TimeSpan RetryDelay { get; set; }

Expand Down
6 changes: 3 additions & 3 deletions src/dotnet/ZooKeeperNet.Recipes/WriteLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ private void OnLockReleased()

public event Action LockReleased;

public WriteLock(ZooKeeper zookeeper, string dir) : this(zookeeper, dir, null)
public WriteLock(IZooKeeper zookeeper, string dir) : this(zookeeper, dir, null)
{ }

public WriteLock(ZooKeeper zookeeper, string dir, List<ACL> acl) : base(zookeeper)
public WriteLock(IZooKeeper zookeeper, string dir, List<ACL> acl) : base(zookeeper)
{
this.dir = dir;
if (acl != null) Acl = acl;
Expand Down Expand Up @@ -146,7 +146,7 @@ private bool LockOperation()
return false;
}

private void FindPrefixInChildren(String prefix, ZooKeeper zookeeper, String dir)
private void FindPrefixInChildren(String prefix, IZooKeeper zookeeper, String dir)
{
var names = Zookeeper.GetChildren(dir, false);
foreach (string name in names)
Expand Down

0 comments on commit adb349e

Please sign in to comment.