SklImpl extends XliffElementImpl implements Skl { public Child getChild() { return child; } SklImpl(Child child);  SklImpl(org.w3c.dom.Element element); @Override List<? extends Element> getChildren(); Child getChild(); void setChild(Child child);  }
@Test public void testSklImplChild() { SklImpl ref = createDefaultSkl(); assertEquals(new ExternalFileImpl(new HrefImpl("http: ref.getChild()); }
@Test public void testSklImplElement() { Document doc = Utils.createDocument(); Element elem = doc.createElementNS(XLIFF_12_NAMESPACE, "skl"); try { new SklImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } elem.appendChild(new ExternalFileImpl( new HrefImpl("http: try { SklImpl ref = new SklImpl(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 { SklImpl ref = new SklImpl(elem); assertEquals(new InternalFileImpl(new TextImpl("abc")), ref .getChild()); } catch (ConstraintViolationException e) { fail("Did not expect ConstraintViolationException"); } elem.removeChild(elem.getFirstChild()); elem.appendChild(doc.createElementNS(XLIFF_12_NAMESPACE, "something")); try { new SklImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } }