private String getStringAttribute(final String key) { if (!attributes.containsKey(key)) { return null; } Exceptions.Block block = new Exceptions.Block() { protected Object inner() throws Exception { return getAttribute(key); } }; return (String) block.exec(); } }
public void testContainsKey() throws Exception { assertTrue(map.containsKey("foo")); assertFalse(map.containsKey("bogus")); }
public void testContainsKey() throws Exception { assertTrue(map.containsKey("foo")); assertFalse(map.containsKey("bogus")); }
public void testContainsKey() throws Exception { assertTrue(map.containsKey("foo")); assertFalse(map.containsKey("bogus")); }
/** * Allows the JMX Agent to set a command line option to be used when MySQL * is launched. * * @throws AttributeNotFoundException * ReflectionException */ public synchronized void setAttribute(Attribute attribute) throws AttributeNotFoundException { String name = attribute.getName(); if (!attributes.containsKey(name)) { // new RuntimeException("attempting to set '" + name + "'") // .printStackTrace(); throw new AttributeNotFoundException(name); } attributes.put(name, attribute); }
/** * Allows the JMX Agent to set a command line option to be used when MySQL * is launched. * * @throws AttributeNotFoundException * ReflectionException */ public synchronized void setAttribute(Attribute attribute) throws AttributeNotFoundException { String name = attribute.getName(); if (!attributes.containsKey(name)) { // new RuntimeException("attempting to set '" + name + "'") // .printStackTrace(); throw new AttributeNotFoundException(name); } attributes.put(name, attribute); }
public void testRemove() { assertEquals(1, map.getChanged().size()); map.remove("foo"); assertEquals(0, map.getChanged().size()); assertFalse(map.containsKey("foo")); map.put("foo", "two"); assertEquals(0, map.getChanged().size()); map.remove("foo"); assertFalse(map.containsKey("foo")); }
public void testRemove() { assertEquals(1, map.getChanged().size()); map.remove("foo"); assertEquals(0, map.getChanged().size()); assertFalse(map.containsKey("foo")); map.put("foo", "two"); assertEquals(0, map.getChanged().size()); map.remove("foo"); assertFalse(map.containsKey("foo")); }
public void testRemove() { assertEquals(1, map.getChanged().size()); map.remove("foo"); assertEquals(0, map.getChanged().size()); assertFalse(map.containsKey("foo")); map.put("foo", "two"); assertEquals(0, map.getChanged().size()); map.remove("foo"); assertFalse(map.containsKey("foo")); }