use of org.apache.synapse.commons.executors.queues.UnboundedQueue in project wso2-synapse by wso2.
the class PriorityExecutorSerializerTest method testSerializeWithUnboundedQueues.
/**
* Test serializing a PriorityExecutor created with UnboundedQueues
*/
public void testSerializeWithUnboundedQueues() {
PriorityExecutor priorityExecutor = new PriorityExecutor();
priorityExecutor.setName("executor1");
List<InternalQueue> internalQueueList = new ArrayList<>();
internalQueueList.add(new UnboundedQueue(10));
internalQueueList.add(new UnboundedQueue(5));
MultiPriorityBlockingQueue multiPriorityBlockingQueue = new MultiPriorityBlockingQueue(internalQueueList, false, new PRRNextQueueAlgorithm());
priorityExecutor.setQueue(multiPriorityBlockingQueue);
OMElement element = PriorityExecutorSerializer.serialize(null, priorityExecutor, "http://ws.apache.org/ns/synapse");
assertEquals("Invalid serialization of PriorityExecutor", "<priorityExecutor xmlns=\"http://ws.apache.org/ns/synapse\" name=\"executor1\">" + "<queues isFixedSize=\"false\"><queue priority=\"10\" /><queue priority=\"5\" /></queues>" + "<threads max=\"100\" core=\"20\" keep-alive=\"5\" />" + "</priorityExecutor>", element.toString());
}
Aggregations