PropertyStrategy extends AbstractTagStrategy { public void execute(final VoiceXmlInterpreterContext context, final VoiceXmlInterpreter interpreter, final FormInterpretationAlgorithm fia, final FormItem item, final VoiceXmlNode node) throws JVoiceXMLEvent { context.setProperty(name, value); LOGGER.info("set property '" + name + "' to value '" + value + "'"); } PropertyStrategy(); Collection<String> getEvalAttributes(); @Override void validateAttributes(final DataModel model); void execute(final VoiceXmlInterpreterContext context,
            final VoiceXmlInterpreter interpreter,
            final FormInterpretationAlgorithm fia, final FormItem item,
            final VoiceXmlNode node); @Override void executeLocal(final VoiceXmlInterpreterContext context,
            final VoiceXmlInterpreter interpreter,
            final FormInterpretationAlgorithm fia, final FormItem item,
            final VoiceXmlNode node);  }
@Test public void testExecute() throws Exception { final VoiceXmlDocument document = createDocument(); final Vxml vxml = document.getVxml(); final Property property1 = vxml.appendChild(Property.class); final String name = "test"; final String value1 = "value1"; property1.setName(name); property1.setValue(value1); final Form form = createForm(); final Property property2 = form.appendChild(Property.class); final String value2 = "value2"; property2.setName(name); property2.setValue(value2); final VoiceXmlInterpreterContext context = getContext(); Assert.assertNull(context.getProperty(name)); final PropertyStrategy strategy1 = new PropertyStrategy(); try { executeTagStrategy(property1, strategy1); } catch (JVoiceXMLEvent e) { Assert.fail(e.getMessage()); } Assert.assertEquals(value1, context.getProperty(name)); context.enterScope(Scope.DIALOG); Assert.assertEquals(value1, context.getProperty(name)); final PropertyStrategy strategy2 = new PropertyStrategy(); try { executeTagStrategy(property2, strategy2); } catch (JVoiceXMLEvent e) { Assert.fail(e.getMessage()); } Assert.assertEquals(value2, context.getProperty(name)); context.exitScope(Scope.DIALOG); Assert.assertEquals(value1, context.getProperty(name)); }