GlossaryImpl extends XliffElementImpl implements Glossary { public Child getChild() { return child; } GlossaryImpl(Child child);  GlossaryImpl(org.w3c.dom.Element elem); @Override List<? extends Element> getChildren(); Child getChild(); void setChild(Child child);  }
@Test public void testGlossaryImplChild() { GlossaryImpl glossary = createDefaultGlossary(); assertEquals(new ExternalFileImpl(new HrefImpl("http: glossary.getChild()); }
@Test public void testGlossaryImplElement() { Document doc = Utils.createDocument(); Element elem = doc.createElementNS(XLIFF_12_NAMESPACE, "glossary"); try { new GlossaryImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } elem.appendChild(new ExternalFileImpl( new HrefImpl("http: try { GlossaryImpl glossary = new GlossaryImpl(elem); assertEquals(new ExternalFileImpl( new HrefImpl("http: } catch (ConstraintViolationException e) { fail("Did not expect ConstraintViolationException"); } elem.removeChild(elem.getFirstChild()); elem.appendChild(new InternalFileImpl(new TextImpl("abc")) .asXmlNode(doc)); try { GlossaryImpl glossary = new GlossaryImpl(elem); assertEquals(new InternalFileImpl(new TextImpl("abc")), glossary .getChild()); } catch (ConstraintViolationException e) { fail("Did not expect ConstraintViolationException"); } elem.removeChild(elem.getFirstChild()); elem.appendChild(doc.createElementNS(XLIFF_12_NAMESPACE, "something")); try { new GlossaryImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } }