PhaseGroupImpl extends XliffElementImpl implements PhaseGroup { public List<Phase> getPhases() { return Collections.unmodifiableList(phases); } PhaseGroupImpl(List<Phase> phases);  PhaseGroupImpl(org.w3c.dom.Element element); @Override List<? extends Node> getChildren(); List<Phase> getPhases(); void setPhases(List<Phase> phases);  }
@Test public void testPhaseGroupImplListOfPhase() { PhaseGroupImpl pg = createDefaultPhaseGroup(); assertEquals(createDefaultPhases(), pg.getPhases()); }
@Test public void testPhaseGroupImplElement() { Document doc = Utils.createDocument(); Element elem = doc.createElementNS(XLIFF_12_NAMESPACE, "phase-group"); Element phase = doc.createElementNS(XLIFF_12_NAMESPACE, "phase"); phase.setAttributeNS(null, "phase-name", "phaseName"); phase.setAttributeNS(null, "process-name", "processName"); elem.appendChild(phase); try { PhaseGroupImpl pg = new PhaseGroupImpl(elem); assertEquals(createDefaultPhases(), pg.getPhases()); } catch (ConstraintViolationException e) { fail("Did not expect ConstraintViolationException"); } elem.removeChild(elem.getFirstChild()); try { new PhaseGroupImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } elem.appendChild(doc.createElementNS(XLIFF_12_NAMESPACE, "something")); try { new PhaseGroupImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } }