@AfterClass public void destroy() throws RemoteException { if (isMessageProcessorExist) { messageProcessorClient.deleteMessageProcessor(MESSAGE_PROCESSOR_NAME); } if (isMessageStoreExist) { messageStoreAdminClient.deleteMessageStore(MESSAGE_STORE_NAME); } }
// since Registry persistence is no longer available @Test( groups = {"wso2.esb"}, description = "Test message Processor media type - text/xml", enabled = false) public void messageProcessorMediaTypeTest() throws Exception { String messageStoreName = "xyz"; OMElement messageStore = AXIOMUtil.stringToOM( "<messageStore xmlns=\"http://ws.apache.org/ns/synapse\" name=\"" + messageStoreName + "\">" + "<parameter name=\"abc\">10</parameter>" + "</messageStore>"); messageStoreAdminClient.addMessageStore(messageStore); isMessageStoreExist = true; Thread.sleep(1000); OMElement messageProcessor = AXIOMUtil.stringToOM( "<messageProcessor xmlns=\"http://ws.apache.org/ns/synapse\" " + "class=\"org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor\" " + "name=\"" + MESSAGE_PROCESSOR_NAME + "\" messageStore=\"" + messageStoreName + "\">" + "<parameter name=\"abc\">100</parameter>" + "</messageProcessor>"); messageProcessorClient.addMessageProcessor(messageProcessor); isMessageProcessorExist = true; // addEndpoint is a a asynchronous call, it will take some time to write to a registry Thread.sleep(10000); MetadataBean metadata = resourceAdmin.getMetadata( "/_system/config/repository/synapse/default/synapse-message-processors/" + MESSAGE_PROCESSOR_NAME); Assert.assertEquals( metadata.getMediaType(), "text/xml", "Media Type mismatched for Message Processor"); }