Skip to content

Commit

Permalink
FORGE-2316: Added excluded stacks to Stack
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jan 14, 2016
1 parent d4fd826 commit 8599d68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public StackBuilder includes(Stack stack)
return this;
}

public StackBuilder excludes(Stack stack)
{
excludedFacets.addAll(stack.getIncludedFacets());
excludedFacets.addAll(stack.getExcludedFacets());
return this;
}

public StackBuilder excludes(Class<? extends ProjectFacet> facet)
{
excludedFacets.add(facet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,18 @@ public void testIncludesStack()
Assert.assertTrue(stack.supports(ProjectFacetC.class));
}

@Test
public void testExcludesStack()
{
Stack anotherStack = StackBuilder.stack("Another Test Stack")
.includes(ProjectFacetC.class);
Stack stack = StackBuilder.stack("Test Stack")
.includes(ProjectFacetA.class)
.includes(anotherStack)
.includes(ProjectFacetB.class)
.excludes(anotherStack);
Assert.assertTrue(stack.supports(ProjectFacetA.class));
Assert.assertTrue(stack.supports(ProjectFacetB.class));
Assert.assertFalse(stack.supports(ProjectFacetC.class));
}
}

0 comments on commit 8599d68

Please sign in to comment.