}
public void testAttributes() throws Exception {
GBeanOverride override;
override = new GBeanOverride(gbeanType, new JexlExpressionParser());
override.setNullAttribute("foo");
override.setClearAttribute("foo");
override.setAttribute(fooInfo, "bar", classLoader);
override.writeXml();
assertFalse(override.isNullAttribute("foo"));
assertFalse(override.getNullAttributes().contains("foo"));
assertFalse(override.isClearAttribute("foo"));
assertFalse(override.getClearAttributes().contains("foo"));
assertTrue(override.getAttribute("foo") != null);
assertTrue(override.getAttributes().containsKey("foo"));
override = new GBeanOverride(gbeanType, new JexlExpressionParser());
override.setAttribute(fooInfo, "bar", classLoader);
override.setNullAttribute("foo");
override.setClearAttribute("foo");
override.writeXml();
assertFalse(override.isNullAttribute("foo"));
assertFalse(override.getNullAttributes().contains("foo"));
assertFalse(override.getAttribute("foo") != null);
assertFalse(override.getAttributes().containsKey("foo"));
assertTrue(override.isClearAttribute("foo"));
assertTrue(override.getClearAttributes().contains("foo"));
override = new GBeanOverride(gbeanType, new JexlExpressionParser());
override.setClearAttribute("foo");
override.setAttribute(fooInfo, "bar", classLoader);
override.setNullAttribute("foo");
override.writeXml();
assertFalse(override.getAttribute("foo") != null);
assertFalse(override.getAttributes().containsKey("foo"));
assertFalse(override.isClearAttribute("foo"));
assertFalse(override.getClearAttributes().contains("foo"));
assertTrue(override.isNullAttribute("foo"));
assertTrue(override.getNullAttributes().contains("foo"));
override = new GBeanOverride(gbeanType, new JexlExpressionParser());
override.setAttribute(gbeanInfo.getAttribute("bar1"), "foo", classLoader);
override.setAttribute(gbeanInfo.getAttribute("bar2"), "foo", classLoader);
override.getAttributes().put("foo", null);
GbeanType gbean = override.writeXml();
assertEquals(3, gbean.getAttributeOrReference().size());