View Javadoc

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