void () { final Artifact exploded = addArtifact("exploded:", root()); final Artifact war = addArtifact("war", PlainArtifactType.getInstance(), archive("web.war") .dir("dir") .artifact(exploded) .build()); addArtifact("ear", PlainArtifactType.getInstance(), archive("ear.ear") .artifact(war) .build()); final MyParentElementProcessor processor = new MyParentElementProcessor(); ArtifactUtil.processParents(exploded, getContext(), processor, 2); assertEquals(""" war:dir war:web.war/dir ear:ear.ear/web.war/dir """, processor.getLog()); ArtifactUtil.processParents(exploded, getContext(), processor, 1); assertEquals(""" war:dir war:web.war/dir """, processor.getLog()); ArtifactUtil.processParents(exploded, getContext(), processor, 0); assertEquals("war:dir\n", processor.getLog()); ArtifactUtil.processParents(war, getContext(), processor, 2); assertEquals(""" war:web.war ear:ear.ear/web.war """, processor.getLog()); }