/** * Call each of the setters and verify */ @Test(timeout = 5000) public void testBlockLocationSetters() throws Exception { BlockLocation loc; loc = new BlockLocation(); // Test that null sets the empty array loc.setHosts(null); loc.setCachedHosts(null); loc.setNames(null); loc.setTopologyPaths(null); checkBlockLocation(loc); // Test that not-null gets set properly String[] names = new String[] { "name" }; String[] hosts = new String[] { "host" }; String[] cachedHosts = new String[] { "cachedHost" }; String[] topologyPaths = new String[] { "path" }; loc.setNames(names); loc.setHosts(hosts); loc.setCachedHosts(cachedHosts); loc.setTopologyPaths(topologyPaths); loc.setOffset(1); loc.setLength(2); loc.setCorrupt(true); checkBlockLocation(loc, names, hosts, cachedHosts, topologyPaths, 1, 2, true); } }
/** * Call each of the setters and verify */ @Test(timeout = 5000) public void testBlockLocationSetters() throws Exception { BlockLocation loc; loc = new BlockLocation(); // Test that null sets the empty array loc.setHosts(null); loc.setCachedHosts(null); loc.setNames(null); loc.setTopologyPaths(null); checkBlockLocation(loc); // Test that not-null gets set properly String[] names = new String[] { "name" }; String[] hosts = new String[] { "host" }; String[] cachedHosts = new String[] { "cachedHost" }; String[] topologyPaths = new String[] { "path" }; loc.setNames(names); loc.setHosts(hosts); loc.setCachedHosts(cachedHosts); loc.setTopologyPaths(topologyPaths); loc.setOffset(1); loc.setLength(2); loc.setCorrupt(true); checkBlockLocation(loc, names, hosts, cachedHosts, topologyPaths, 1, 2, true); } }