use of org.apache.synapse.startup.quartz.QuartzTaskManager in project wso2-synapse by wso2.
the class TaskManagerFactoryTest method testCreateTaskManager2.
/**
* test createTaskManager with parameter specified for OMElement
*
* @throws XMLStreamException - XMLStreamException.
*/
@Test
public void testCreateTaskManager2() throws XMLStreamException {
String inputXML = "<taskManager provider=\"org.apache.synapse.startup.quartz.QuartzTaskManager\">" + "<parameter xmlns=\"http://ws.apache.org/ns/synapse\" name =\"test\"> test </parameter>" + "</taskManager>";
OMElement element = AXIOMUtil.stringToOM(inputXML);
TaskManager taskManager = TaskManagerFactory.createTaskManager(element, null);
Assert.assertTrue("TaskManager is not created.", taskManager instanceof QuartzTaskManager);
}
use of org.apache.synapse.startup.quartz.QuartzTaskManager in project wso2-synapse by wso2.
the class TaskManagerSerializerTest method testCase.
/**
* Test serializetaskManager method by asserting resulting OMElement.
*
* @throws XMLStreamException
*/
@Test
public void testCase() throws XMLStreamException {
String input = "<template xmlns=\"http://ws.apache.org/ns/synapse\" name=\"HelloWordLogger\">\n" + " <sequence>\n" + " <log level=\"full\">\n" + " <property xmlns:ns2=\"http://org.apache.synapse/xsd\" name=\"message\" " + "expression=\"$func:message\"></property>\n" + " </log>\n" + " </sequence>\n" + "</template>";
OMElement element = AXIOMUtil.stringToOM(input);
TaskManager taskManager = new QuartzTaskManager();
Properties properties = new Properties();
properties.setProperty("name", "testName");
taskManager.setConfigurationProperties(properties);
OMElement omElement = TaskManagerSerializer.serializetaskManager(element, taskManager);
Assert.assertEquals("asserting localName inserted by the method", "taskManager", omElement.getLocalName());
Iterator iter = omElement.getChildElements();
while (iter.hasNext()) {
OMElementImpl impl = (OMElementImpl) iter.next();
Assert.assertEquals("asserting localName inserted by the method", "parameter", impl.getLocalName());
}
}
Aggregations