JvoiceXmlSsmlParsingStrategyFactory implements SsmlParsingStrategyFactory { public SsmlParsingStrategy getParsingStrategy(final VoiceXmlNode node) { if (node == null) { LOGGER.warn("cannot get strategy for null"); return null; } final String tag = node.getTagName(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("getting strategy for tag: '" + tag + "'"); } final SsmlParsingStrategy strategy = STRATEGIES.get(tag); if (strategy == null) { LOGGER.warn("no suitable strategy for tag: '" + tag + "'"); return null; } return (SsmlParsingStrategy) strategy.clone(); } JvoiceXmlSsmlParsingStrategyFactory(); SsmlParsingStrategy getParsingStrategy(final VoiceXmlNode node);  }
@Test public void testGetParsingStrategy() throws Exception, JVoiceXMLEvent { final String testVar = "testvalue"; final VoiceXmlDocument document = new VoiceXmlDocument(); final Vxml vxml = document.getVxml(); final Form form = vxml.appendChild(Form.class); final Block block = form.appendChild(Block.class); final Prompt prompt = block.appendChild(Prompt.class); prompt.addText("This is a test"); final Value value = prompt.appendChild(Value.class); value.setExpr(testVar); SsmlParsingStrategyFactory factory = new JvoiceXmlSsmlParsingStrategyFactory(); SsmlParsingStrategy strategy = factory.getParsingStrategy(value); Assert.assertNotNull(strategy); SsmlParsingStrategy promptStrategy = factory.getParsingStrategy(prompt); Assert.assertNull(promptStrategy); }