Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java 
(original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java 
Mon Dec 22 14:23:32 2008
@@ -84,7 +84,7 @@
         /** the latch is used to await the results from the server */
         CountDownLatch latch;
 
-        int rc = 0;
+        Code rc = Code.OK;
         String path = "/foo";
         String expected;
         
@@ -93,7 +93,7 @@
             this.latch = latch;
         }
         
-        public void setRC(int rc) {
+        public void setRC(Code rc) {
             this.rc = rc;
         }
         
@@ -101,7 +101,7 @@
             this.path = path;
         }
         
-        public void processResult(int rc, String path, Object ctx)
+        public void processResult(Code rc, String path, Object ctx)
         {
             this.rc = rc;
             this.path = path;
@@ -157,7 +157,7 @@
         public void processResult(int rc, String path, Object ctx, String name)
         {
             this.name = name;
-            super.processResult(rc, path, ctx);
+            super.processResult(Code.get(rc), path, ctx);
         }
 
         public AsyncCB create() {
@@ -173,7 +173,7 @@
         public void verifyCreateFailure_NodeExists() {
             new StringCB(zk).verifyCreate();
             
-            rc = Code.NodeExists;
+            rc = Code.NODEEXISTS;
             name = null;
             zk.create(path, data, acl, flags, this, toString());
             verify();
@@ -208,7 +208,7 @@
         {
             this.acl = acl;
             this.stat = stat;
-            super.processResult(rc, path, ctx);
+            super.processResult(Code.get(rc), path, ctx);
         }
         
         public void verifyGetACL() {
@@ -252,7 +252,7 @@
         {
             this.children =
                 (children == null ? new ArrayList<String>() : children);
-            super.processResult(rc, path, ctx);
+            super.processResult(Code.get(rc), path, ctx);
         }
         
         public StringCB createNode() {
@@ -306,7 +306,7 @@
         }
         
         public void verifyGetChildrenFailure_NoNode() {
-            rc = KeeperException.Code.NoNode;
+            rc = KeeperException.Code.NONODE;
             verify();
         }
         
@@ -344,7 +344,7 @@
         {
             this.data = data;
             this.stat = stat;
-            super.processResult(rc, path, ctx);
+            super.processResult(Code.get(rc), path, ctx);
         }
         
         public void verifyGetData() {
@@ -355,7 +355,7 @@
         }
         
         public void verifyGetDataFailure_NoNode() {
-            rc = KeeperException.Code.NoNode;
+            rc = KeeperException.Code.NONODE;
             data = null;
             stat = null;
             zk.getData(path, false, this, toString());
@@ -392,7 +392,7 @@
         
         public void processResult(int rc, String path, Object ctx, Stat stat) {
             this.stat = stat;
-            super.processResult(rc, path, ctx);
+            super.processResult(Code.get(rc), path, ctx);
         }
         
         public void verifySetACL() {
@@ -404,7 +404,7 @@
         }
         
         public void verifySetACLFailure_NoNode() {
-            rc = KeeperException.Code.NoNode;
+            rc = KeeperException.Code.NONODE;
             stat = null;
             zk.setACL(path, acl, version, this, toString());
             verify();
@@ -423,7 +423,7 @@
         }
         
         public void verifySetDataFailure_NoNode() {
-            rc = KeeperException.Code.NoNode;
+            rc = KeeperException.Code.NONODE;
             stat = null;
             zk.setData(path, data, version, this, toString());
             verify();
@@ -437,7 +437,7 @@
         }
         
         public void verifyExistsFailure_NoNode() {
-            rc = KeeperException.Code.NoNode;
+            rc = KeeperException.Code.NONODE;
             stat = null;
             zk.exists(path, false, this, toString());
             verify();
@@ -464,6 +464,10 @@
             super(zk, latch);
         }
         
+        public void processResult(int rc, String path, Object ctx) {
+            super.processResult(Code.get(rc), path, ctx);
+        }
+
         public void delete() {
             zk.delete(path, version, this, toString());
         }
@@ -476,7 +480,7 @@
         }
         
         public void verifyDeleteFailure_NoNode() {
-            rc = Code.NoNode;
+            rc = Code.NONODE;
             zk.delete(path, version, this, toString());
             verify();
         }

Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncTest.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncTest.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncTest.java 
(original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncTest.java 
Mon Dec 22 14:23:32 2008
@@ -58,7 +58,7 @@
     @Override
     protected void setUp() throws Exception {
         LOG.info("STARTING " + getName());
-        
+
         ClientBase.setupTestEnv();
 
         quorumTest.setUp();
@@ -85,7 +85,7 @@
             }
         }
     }
-    
+
     private ZooKeeper createClient() throws IOException,InterruptedException {
         return createClient(quorumTest.hostPort);
     }
@@ -220,7 +220,7 @@
                 }
             }
             assertEquals(0, (int) results.get(0));
-            assertEquals(Code.NoAuth, (int) results.get(1));
+            assertEquals(Code.NOAUTH, Code.get((int) results.get(1)));
             assertEquals(0, (int) results.get(2));
             assertEquals(0, (int) results.get(3));
             assertEquals(0, (int) results.get(4));
@@ -235,7 +235,7 @@
                 zk.getData("/ben2", false, new Stat());
                 fail("Should have received a permission error");
             } catch (KeeperException e) {
-                assertEquals(Code.NoAuth, e.getCode());
+                assertEquals(Code.NOAUTH, e.code());
             }
         } finally {
             zk.close();

Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientTest.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientTest.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientTest.java 
(original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientTest.java 
Mon Dec 22 14:23:32 2008
@@ -125,7 +125,7 @@
                 zk.getData("/acltest", false, new Stat());
                 fail("Should have received a permission error");
             } catch (KeeperException e) {
-                assertEquals(Code.NoAuth, e.getCode());
+                assertEquals(Code.NOAUTH, e.code());
             }
             zk.addAuthInfo("digest", "ben:passwd".getBytes());
             zk.getData("/acltest", false, new Stat());
@@ -159,7 +159,7 @@
             }
         }
     }
-    
+
     /**
      * Register multiple watchers and verify that they all get notified and
      * in the right order.
@@ -201,13 +201,13 @@
                 assertEquals("/foo-" + i, event.getPath());
                 assertEquals(EventType.NodeDataChanged, event.getType());
                 assertEquals(KeeperState.SyncConnected, event.getState());
-                
+
                 // small chance that an unexpected message was delivered
                 //  after this check, but we would catch that next time
                 //  we check events
                 assertEquals(0, watchers[i].events.size());
             }
-            
+
             //
             // test get/exists with single set of watchers
             //  get/exists together
@@ -227,13 +227,13 @@
                 assertEquals("/foo-" + i, event.getPath());
                 assertEquals(EventType.NodeDataChanged, event.getType());
                 assertEquals(KeeperState.SyncConnected, event.getState());
-                
+
                 // small chance that an unexpected message was delivered
                 //  after this check, but we would catch that next time
                 //  we check events
                 assertEquals(0, watchers[i].events.size());
             }
-            
+
             //
             // test get/exists with two sets of watchers
             //
@@ -252,7 +252,7 @@
                 assertEquals("/foo-" + i, event.getPath());
                 assertEquals(EventType.NodeDataChanged, event.getType());
                 assertEquals(KeeperState.SyncConnected, event.getState());
-                
+
                 // small chance that an unexpected message was delivered
                 //  after this check, but we would catch that next time
                 //  we check events
@@ -264,13 +264,13 @@
                 assertEquals("/foo-" + i, event2.getPath());
                 assertEquals(EventType.NodeDataChanged, event2.getType());
                 assertEquals(KeeperState.SyncConnected, event2.getState());
-                
+
                 // small chance that an unexpected message was delivered
                 //  after this check, but we would catch that next time
                 //  we check events
                 assertEquals(0, watchers2[i].events.size());
             }
-            
+
         } finally {
             if (zk != null) {
                 zk.close();
@@ -303,7 +303,7 @@
             zk.close();
             //LOG.info("Closed client: " + zk.describeCNXN());
             Thread.sleep(2000);
-            
+
             zk = createClient(watcher, hostPort);
             //LOG.info("Created a new client: " + zk.describeCNXN());
             LOG.info("Before delete /");
@@ -392,7 +392,7 @@
             //    zk.create("/bad\u0000path", "".getBytes(), null, 
CreateMode.PERSISTENT);
             //    fail("created an invalid path");
             //} catch(KeeperException e) {
-            //    assertEquals(KeeperException.Code.BadArguments, e.getCode());
+            //    assertEquals(KeeperException.Code.BadArguments, e.code());
             //}
 
             zk.create("/duplicate", "".getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
@@ -479,19 +479,19 @@
             zk.delete("/parent", -1);
             fail("Should have received a not equals message");
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NotEmpty, e.getCode());
+            assertEquals(KeeperException.Code.NOTEMPTY, e.code());
         }
         zk.delete("/parent/child", -1);
         zk.delete("/parent", -1);
         zk.close();
     }
-    
+
     private static final long HAMMERTHREAD_LATENCY = 5;
-    
+
     private static abstract class HammerThread extends Thread {
         protected final int count;
         protected volatile int current = 0;
-        
+
         HammerThread(String name, int count) {
             super(name);
             this.count = count;
@@ -571,7 +571,7 @@
         try {
             final int threadCount = 10;
             final int childCount = 1000;
-            
+
             HammerThread[] threads = new HammerThread[threadCount];
             long start = System.currentTimeMillis();
             for (int i = 0; i < threads.length; i++) {
@@ -579,21 +579,21 @@
                 String prefix = "/test-" + i;
                 zk.create(prefix, new byte[0], Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
                 prefix += "/";
-                HammerThread thread = 
+                HammerThread thread =
                     new BasicHammerThread("BasicHammerThread-" + i, zk, prefix,
                             childCount);
                 thread.start();
-                
+
                 threads[i] = thread;
             }
-            
+
             verifyHammer(start, threads, childCount);
         } catch (Throwable t) {
             LOG.error("test failed", t);
             throw t;
         }
     }
-    
+
     /**
      * Separate threads each creating a number of nodes. Each thread
      * is creating a new client for each node creation.
@@ -604,7 +604,7 @@
         try {
             final int threadCount = 5;
             final int childCount = 10;
-            
+
             HammerThread[] threads = new HammerThread[threadCount];
             long start = System.currentTimeMillis();
             for (int i = 0; i < threads.length; i++) {
@@ -618,23 +618,23 @@
                     }
                 }
                 prefix += "/";
-                HammerThread thread = 
+                HammerThread thread =
                     new SuperHammerThread("SuperHammerThread-" + i, this,
                             prefix, childCount);
                 thread.start();
-                
+
                 threads[i] = thread;
             }
-            
+
             verifyHammer(start, threads, childCount);
         } catch (Throwable t) {
             LOG.error("test failed", t);
             throw t;
         }
     }
-    
-    public void verifyHammer(long start, HammerThread[] threads, int 
childCount) 
-        throws IOException, InterruptedException, KeeperException 
+
+    public void verifyHammer(long start, HammerThread[] threads, int 
childCount)
+        throws IOException, InterruptedException, KeeperException
     {
         // look for the clients to finish their create operations
         LOG.info("Starting check for completed hammers");
@@ -653,25 +653,25 @@
         }
         if (workingCount > 0) {
             for (HammerThread h : threads) {
-                LOG.warn(h.getName() + " never finished creation, current:" 
+                LOG.warn(h.getName() + " never finished creation, current:"
                         + h.current);
             }
         } else {
             LOG.info("Hammer threads completed creation operations");
         }
-        
+
         for (HammerThread h : threads) {
             final int safetyFactor = 3;
             verifyThreadTerminated(h,
-                    threads.length * childCount 
+                    threads.length * childCount
                     * HAMMERTHREAD_LATENCY * safetyFactor);
         }
         LOG.info(new Date() + " Total time "
                 + (System.currentTimeMillis() - start));
-        
+
         ZooKeeper zk = createClient();
         try {
-            
+
             LOG.info("******************* Connected to ZooKeeper" + new 
Date());
             for (int i = 0; i < threads.length; i++) {
                 LOG.info("Doing thread: " + i + " " + new Date());
@@ -688,16 +688,16 @@
             zk.close();
         }
     }
-    
+
     private class VerifyClientCleanup extends Thread {
         int count;
         int current = 0;
-        
+
         VerifyClientCleanup(String name, int count) {
             super(name);
             this.count = count;
         }
-        
+
         public void run() {
             try {
                 for (; current < count; current++) {
@@ -714,21 +714,21 @@
      * Verify that the client is cleaning up properly. Open/close a large
      * number of sessions. Essentially looking to see if sockets/selectors
      * are being cleaned up properly during close.
-     * 
+     *
      * @throws Throwable
      */
     @Test
     public void testClientCleanup() throws Throwable {
         final int threadCount = 20;
         final int clientCount = 100;
-        
+
         VerifyClientCleanup threads[] = new VerifyClientCleanup[threadCount];
-        
+
         for (int i = 0; i < threads.length; i++) {
             threads[i] = new VerifyClientCleanup("VCC" + i, clientCount);
             threads[i].start();
         }
-        
+
         for (int i = 0; i < threads.length; i++) {
             threads[i].join(600000);
             assertTrue(threads[i].current == threads[i].count);

Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/CreateModeTest.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/CreateModeTest.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/CreateModeTest.java
 (original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/CreateModeTest.java
 Mon Dec 22 14:23:32 2008
@@ -68,14 +68,14 @@
             CreateMode cm = CreateMode.fromFlag(99);
             fail("Shouldn't be able to convert 99 to a CreateMode.");
         } catch(KeeperException ke) {
-            assertEquals(Code.BadArguments, ke.getCode());
+            assertEquals(Code.BADARGUMENTS, ke.code());
         }
 
         try {
             CreateMode cm = CreateMode.fromFlag(-1);
             fail("Shouldn't be able to convert -1 to a CreateMode.");
         } catch(KeeperException ke) {
-            assertEquals(Code.BadArguments, ke.getCode());
+            assertEquals(Code.BADARGUMENTS, ke.code());
         }
     }
 }

Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherFuncTest.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherFuncTest.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherFuncTest.java
 (original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherFuncTest.java
 Mon Dec 22 14:23:32 2008
@@ -140,7 +140,7 @@
             client.setData("/car", "missing".getBytes(), -1);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         try {
@@ -148,7 +148,7 @@
             client.setData("/foo/car", "missing".getBytes(), -1);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         client.setData("/foo", "parent".getBytes(), -1);
@@ -176,13 +176,13 @@
             lsnr.getData("/foo", true, null);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
         try {
             lsnr.getData("/foo/bar", true, null);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         client.create("/foo", "parent".getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
@@ -215,13 +215,13 @@
             lsnr.getChildren("/foo", true);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
         try {
             lsnr.getChildren("/foo/bar", true);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         client.create("/foo", "parent".getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
@@ -340,13 +340,13 @@
             lsnr.getData("/foo", w1, null);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
         try {
             lsnr.getData("/foo/bar", w2, null);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         client.create("/foo", "parent".getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
@@ -406,13 +406,13 @@
             lsnr.getChildren("/foo", true);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
         try {
             lsnr.getChildren("/foo/bar", true);
             fail();
         } catch (KeeperException e) {
-            assertEquals(KeeperException.Code.NoNode, e.getCode());
+            assertEquals(KeeperException.Code.NONODE, e.code());
         }
 
         client.create("/foo", "parent".getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);

Modified: 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZooKeeperTestClient.java
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZooKeeperTestClient.java?rev=728812&r1=728811&r2=728812&view=diff
==============================================================================
--- 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZooKeeperTestClient.java
 (original)
+++ 
hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZooKeeperTestClient.java
 Mon Dec 22 14:23:32 2008
@@ -122,8 +122,8 @@
     try {
       zk.create(nodeName, null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NodeExists;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NODEEXISTS;
       if (!valid) {
         fail("Unexpected exception code for createin: " + ke.getMessage());
       }
@@ -179,9 +179,9 @@
       try {
         zk.delete(nodeName, -1);
       } catch (KeeperException ke) {
-        int code = ke.getCode();
-        boolean valid = code == KeeperException.Code.NoNode
-            || code == KeeperException.Code.NotEmpty;
+        Code code = ke.code();
+        boolean valid = code == KeeperException.Code.NONODE
+            || code == KeeperException.Code.NOTEMPTY;
         if (!valid) {
           fail("Unexpected exception code for delete: " + ke.getMessage());
         }
@@ -193,8 +193,8 @@
     try {
       zk.create(nodeName, null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NodeExists;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NODEEXISTS;
       if (!valid) {
         fail("Unexpected exception code for createin: " + ke.getMessage());
       }
@@ -219,8 +219,8 @@
       zk.delete(parentName, -1);
       fail("Should be impossible to delete a non-empty node " + parentName);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NotEmpty;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NOTEMPTY;
       if (!valid) {
         fail("Unexpected exception code for delete: " + code);
       }
@@ -230,8 +230,8 @@
       zk.create(nodeName + "/def", null, Ids.OPEN_ACL_UNSAFE, 
CreateMode.EPHEMERAL);
       fail("Should be impossible to create child off Ephemeral node " + 
nodeName);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NoChildrenForEphemerals;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NOCHILDRENFOREPHEMERALS;
       if (!valid) {
         fail("Unexpected exception code for createin: " + code);
       }
@@ -243,8 +243,8 @@
         fail("ephemeral node " + nodeName + " should not have children");
       }
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NoNode;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NONODE;
       if (!valid) {
         fail("Unexpected exception code for createin: " + code);
       }
@@ -308,9 +308,9 @@
     try {
       zk.delete(nodeName, -1);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NoNode
-          || code == KeeperException.Code.NotEmpty;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NONODE
+          || code == KeeperException.Code.NOTEMPTY;
       if (!valid) {
         fail("Unexpected exception code for delete: " + ke.getMessage());
       }
@@ -318,8 +318,8 @@
     try {
       zk.create(nodeName, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NodeExists;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NODEEXISTS;
       if (!valid) {
         fail("Unexpected exception code for create: " + ke.getMessage());
       }
@@ -328,7 +328,7 @@
       zk.setData(nodeName, "hi".getBytes(), 5700);
       fail("Should have gotten BadVersion exception");
     } catch (KeeperException ke) {
-      if (ke.getCode() != Code.BadVersion) {
+      if (ke.code() != Code.BADVERSION) {
         fail("Should have gotten BadVersion exception");
       }
     }
@@ -344,9 +344,9 @@
       zk.delete(nodeName, 6800);
       fail("Should have gotten BadVersion exception");
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NotEmpty
-          || code == KeeperException.Code.BadVersion;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NOTEMPTY
+          || code == KeeperException.Code.BADVERSION;
       if (!valid) {
         fail("Unexpected exception code for delete: " + ke.getMessage());
       }
@@ -354,8 +354,8 @@
     try {
       zk.delete(nodeName, -1);
     } catch (KeeperException ke) {
-      int code = ke.getCode();
-      boolean valid = code == KeeperException.Code.NotEmpty;
+      Code code = ke.code();
+      boolean valid = code == KeeperException.Code.NOTEMPTY;
       if (!valid) {
         fail("Unexpected exception code for delete: " + code);
       }


Reply via email to