sequence.add(a);
sequence.add(b);
sequence.add(c);
sequence.add(defaultGroup);
Groups chain = new Groups();
chain.insertSequence(sequence);
// create test default sequence
List<Group> defaultSequence = new ArrayList<Group>();
defaultSequence.add(Group.DEFAULT);
defaultSequence.add(new Group(GroupA.class));
try {
chain.assertDefaultGroupSequenceIsExpandable(defaultSequence);
fail();
} catch (GroupDefinitionException e) {
// success
}
defaultSequence.clear();
defaultSequence.add(new Group(GroupA.class));
defaultSequence.add(new Group(Default.class));
try {
chain.assertDefaultGroupSequenceIsExpandable(defaultSequence);
fail();
} catch (GroupDefinitionException e) {
// success
}
defaultSequence.clear();
defaultSequence.add(Group.DEFAULT);
defaultSequence.add(new Group(GroupC.class));
try {
chain.assertDefaultGroupSequenceIsExpandable(defaultSequence);
fail();
} catch (GroupDefinitionException e) {
// success
}
defaultSequence.clear();
defaultSequence.add(new Group(GroupC.class));
defaultSequence.add(Group.DEFAULT);
chain.assertDefaultGroupSequenceIsExpandable(defaultSequence);
}