void () { final MyElement element = createElement("<a attra=\"foo\"/>"); final GenericAttributeValue<String> attributeValue = element.getAttributeValue(); assertEquals("attra", attributeValue.getXmlElementName()); assertEquals("foo", attributeValue.getValue()); final GenericAttributeValue<Integer> attr = element.getAttr(); attr.setValue(239); assertEquals(239, (int)attr.getValue()); assertEquals("239", element.getXmlTag().getAttributeValue("attr")); final DomElement element1 = attr; myCallRegistry.putExpected(new DomEvent(element1, true)); myCallRegistry.assertResultsAndClear(); attr.setValue(42); myCallRegistry.putExpected(new DomEvent(attr, false)); myCallRegistry.assertResultsAndClear(); attr.setValue(null); assertNull(attr.getValue()); assertNull(element.getXmlTag().getAttributeValue("attr")); assertNull(element.getXmlTag().getAttribute("attr", "")); myCallRegistry.putExpected(new DomEvent(attr, false)); myCallRegistry.assertResultsAndClear(); assertEquals("some-attribute", element.getSomeAttribute().getXmlElementName()); assertNull(createElement("<a attra\"attr\"/>").getAttributeValue().getStringValue()); assertNull(createElement("<a attra\"\"/>").getAttributeValue().getStringValue()); assertNull(createElement("<a attra\"/>").getAttributeValue().getStringValue()); }