View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.tck.testmodels.mule;
8   
9   import org.mule.DefaultMuleEvent;
10  import org.mule.DefaultMuleMessage;
11  import org.mule.api.MuleEvent;
12  import org.mule.routing.AbstractCorrelationAggregator;
13  import org.mule.routing.AggregationException;
14  import org.mule.routing.EventGroup;
15  
16  /**
17   * <code>TestResponseAggregator</code> is a mock response Agrregator object used for
18   * testing configuration
19   */
20  public class TestCorrelationAggregator extends AbstractCorrelationAggregator
21  {
22      private String testProperty;
23  
24      @Override
25      protected MuleEvent aggregateEvents(EventGroup events) throws AggregationException
26      {
27          return new DefaultMuleEvent(new DefaultMuleMessage("test", events.toMessageCollection()
28              .getMuleContext()), events.getMessageCollectionEvent());
29      }
30  
31      public String getTestProperty()
32      {
33          return testProperty;
34      }
35  
36      public void setTestProperty(String testProperty)
37      {
38          this.testProperty = testProperty;
39      }
40  }