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