@Test
public void testGetDecorator() throws Exception {

    final VoiceXmlDocument document = new VoiceXmlDocument();
    final Vxml vxml = document.getVxml();
    final Form form = vxml.appendChild(Form.class);
    final Field field = form.appendChild(Field.class);
    final ObjectTag object = form.appendChild(ObjectTag.class);
    final Record record = form.appendChild(Record.class);
    final Initial initial = form.appendChild(Initial.class);
    final FieldFormItem fieldItem = new FieldFormItem(context, field);
    final EventStrategyDecoratorFactory factory = new EventStrategyDecoratorFactory();
    final EventStrategy strategy1 = factory.getDecorator(context, null,
            null, fieldItem);
    Assert.assertNotNull(strategy1);
    Assert.assertEquals(InputItemRecognitionEventStrategy.class,
            strategy1.getClass());
    final RecordFormItem recordItem = new RecordFormItem(context, record);
    final EventStrategy strategy2 = factory.getDecorator(context, null,
            null, recordItem);
    Assert.assertNotNull(strategy2);
    Assert.assertEquals(RecordingEventStrategy.class, strategy2.getClass());
    final ObjectFormItem objectItem = new ObjectFormItem(context, object);
    final EventStrategy strategy3 = factory.getDecorator(context, null,
            null, objectItem);
    Assert.assertNotNull(strategy3);
    Assert.assertEquals(ObjectTagEventStrategy.class, strategy3.getClass());
    final InitialFormItem initialItem = new InitialFormItem(context,
            initial);
    final EventStrategy strategy4 = factory.getDecorator(context, null,
            null, initialItem);
    Assert.assertNotNull(strategy4);
    Assert.assertEquals(FormLevelRecognitionEventStrategy.class,
            strategy4.getClass());
    final EventStrategy strategy5 = factory.getDecorator(context, null,
            null, null);
    Assert.assertNull("expected a null strategy for a null input item",
            strategy5);
}