コード例 #1
0
  // since Registry persistence is no longer available
  @Test(
      groups = {"wso2.esb"},
      description = "Test Priority Executor media type - text/xml",
      enabled = false)
  public void priorityExecutorMediaTypeTest() throws Exception {

    OMElement priorityConfig =
        AXIOMUtil.stringToOM(
            "<priority-executor xmlns=\"http://ws.apache.org/ns/synapse\" "
                + "name=\""
                + PRIORITY_EXECUTOR_NAME
                + "\">"
                + "<queues>"
                + "<queue size=\"10\" priority=\"1\" />"
                + "<queue size=\"5\" priority=\"2\" />"
                + "</queues>"
                + "<threads max=\"100\" core=\"20\" "
                + "keep-alive=\"5\" />"
                + "</priority-executor>");
    priorityMediationAdminClient.addPriorityMediator(PRIORITY_EXECUTOR_NAME, priorityConfig);
    isPriorityExecutorExist = 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-executors/"
                + PRIORITY_EXECUTOR_NAME);
    Assert.assertEquals(
        metadata.getMediaType(), "text/xml", "Media Type mismatched for PriorityExecutor");
  }
コード例 #2
0
 // 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");
 }