Search in sources :

Example 1 with AbstractMergeableElementList

use of org.codehaus.plexus.metadata.merge.support.AbstractMergeableElementList in project plexus-containers by codehaus-plexus.

the class ComponentsXmlMergerTest method testInvalidMergeableElements.

public void testInvalidMergeableElements() throws Exception {
    // dominant Component Element
    AbstractMergeableElement dCE = new ComponentElement(new Element("component"));
    Element roleElt = new Element("role");
    roleElt.setText("org.codehaus.plexus.ISampleRole");
    dCE.addContent(roleElt);
    AbstractMergeableElementList reqElt = new RequirementsElement(new Element("requirement"));
    // attempt and invalid merge
    try {
        dCE.merge(reqElt);
        fail("Expected MergeException!");
    } catch (MergeException e) {
    // do nothing.
    }
}
Also used : RequirementsElement(org.codehaus.plexus.metadata.merge.support.RequirementsElement) AbstractMergeableElementList(org.codehaus.plexus.metadata.merge.support.AbstractMergeableElementList) ComponentsElement(org.codehaus.plexus.metadata.merge.support.ComponentsElement) RequirementsElement(org.codehaus.plexus.metadata.merge.support.RequirementsElement) ComponentElement(org.codehaus.plexus.metadata.merge.support.ComponentElement) AbstractMergeableElement(org.codehaus.plexus.metadata.merge.support.AbstractMergeableElement) Element(org.jdom2.Element) AbstractMergeableElement(org.codehaus.plexus.metadata.merge.support.AbstractMergeableElement) ComponentElement(org.codehaus.plexus.metadata.merge.support.ComponentElement)

Aggregations

AbstractMergeableElement (org.codehaus.plexus.metadata.merge.support.AbstractMergeableElement)1 AbstractMergeableElementList (org.codehaus.plexus.metadata.merge.support.AbstractMergeableElementList)1 ComponentElement (org.codehaus.plexus.metadata.merge.support.ComponentElement)1 ComponentsElement (org.codehaus.plexus.metadata.merge.support.ComponentsElement)1 RequirementsElement (org.codehaus.plexus.metadata.merge.support.RequirementsElement)1 Element (org.jdom2.Element)1