@Test public void testGet_InvalidFormat() { Property badProp = Property.MASTER_CLIENTPORT; expect(zc.get(PATH + "/" + badProp.getKey())).andReturn(VALUE_BYTES); replay(zc); AccumuloConfiguration parent = createMock(AccumuloConfiguration.class); expect(parent.get(badProp)).andReturn("12345"); replay(parent); assertEquals("12345", a.get(badProp, PATH, parent)); }
String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; }
ZooCachePropertyAccessor { String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; } }
ZooCachePropertyAccessor { String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; } ZooCachePropertyAccessor(ZooCache propCache); }
ZooCachePropertyAccessor { String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; } ZooCachePropertyAccessor(ZooCache propCache);  }
ZooCachePropertyAccessor { String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; } ZooCachePropertyAccessor(ZooCache propCache);   }