NonXliffAttributeImpl extends AttributeImpl implements
		NonXliffAttribute { public NonXliffAttributeImpl(String namespaceUri, String prefix, String name, String value) { super(namespaceUri, prefix, name, value); if (Schemas.XLIFF_12_NAMESPACE.equals(namespaceUri)) { throw new IllegalArgumentException("Non-XLIFF attributes must not be member of the XLIFF namespace"); } else if (Schemas.XML_NAMESPACE.equals(namespaceUri)) { throw new IllegalArgumentException("Non-XLIFF attributes must not be member of the XML namespace"); } else if (Schemas.XMLNS_NAMESPACE.equals(namespaceUri)) { throw new IllegalArgumentException("Non-XLIFF attributes must not be member of the XMLNS namespace"); } } NonXliffAttributeImpl(String namespaceUri, String prefix, String name, String value);   }
@Test public void testNonXliffAttributeImpl() { NonXliffAttributeImpl attr = new NonXliffAttributeImpl("ns", "pre", "name", "value"); assertEquals("ns", attr.getNamespaceUri()); assertEquals("pre", attr.getPrefix()); assertEquals("name", attr.getName()); assertEquals("value", attr.getValue()); attr = new NonXliffAttributeImpl("ns", null, "name", "value"); assertEquals("ns", attr.getNamespaceUri()); assertNull(attr.getPrefix()); assertEquals("name", attr.getName()); assertEquals("value", attr.getValue()); try { attr = new NonXliffAttributeImpl(XML_NAMESPACE, "pre", "name", "value"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } try { attr = new NonXliffAttributeImpl(XMLNS_NAMESPACE, "pre", "name", "value"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } try { attr = new NonXliffAttributeImpl(XLIFF_12_NAMESPACE, "pre", "name", "value"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } }