ZooKeeperManager { public static String getBasePath(Configuration conf) { String result = conf.get(BASE_ZNODE_KEY, ""); if (!result.equals("") && !result.startsWith("/")) { throw new IllegalArgumentException("Value for " + BASE_ZNODE_KEY + " must start with /: " + result); } return result; } ZooKeeperManager(Mapper<?, ?, ?, ?>.Context context,
                          ImmutableClassesGiraphConfiguration configuration); static String getBasePath(Configuration conf); void setup(); void createCandidateStamp(); boolean computationDone(); String getZooKeeperServerPortString(); void onlineZooKeeperServer(); void offlineZooKeeperServers(State state); boolean runsZooKeeper(); void cleanupOnExit(); void cleanup();  }
@Test public void testGetBasePath() { Configuration conf = new Configuration(); assertEquals("Default value for base path should be empty", "", ZooKeeperManager.getBasePath(conf)); conf.set(GiraphConstants.BASE_ZNODE_KEY, "/howdy"); assertEquals("Base path should reflect value of " + GiraphConstants.BASE_ZNODE_KEY, "/howdy", ZooKeeperManager.getBasePath(conf)); conf.set(GiraphConstants.BASE_ZNODE_KEY, "no_slash"); try { ZooKeeperManager.getBasePath(conf); fail("Should not have allowed path without starting slash"); } catch (IllegalArgumentException iae) { assertTrue(iae.getMessage().contains(GiraphConstants.BASE_ZNODE_KEY)); } }