View Javadoc

1   package org.apache.maven.plugin.surefire.booterclient.output;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.surefire.report.ReportEntry;
23  
24  /**
25   * Surefire output consumer that will delegate to another {@link OutputConsumer}
26   *
27   * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
28   * @version $Id: OutputConsumerProxy.java 1039320 2010-11-26 11:48:24Z krosenvold $
29   * @since 2.1
30   */
31  public class OutputConsumerProxy
32      implements OutputConsumer
33  {
34  
35      private final OutputConsumer outputConsumer;
36  
37      /**
38       * Create a output consumer that will delegate all calls to the proxied output consumer
39       *
40       * @param outputConsumer output consumer to delegate to
41       */
42      public OutputConsumerProxy( OutputConsumer outputConsumer )
43      {
44          this.outputConsumer = outputConsumer;
45      }
46  
47      /**
48       * {@link OutputConsumer} that calls will be delegated to
49       *
50       * @return the proxied {@link OutputConsumer}
51       */
52      public OutputConsumer getOutputConsumer()
53      {
54          return outputConsumer;
55      }
56  
57      /**
58       * Delegate to proxied {@link OutputConsumer}
59       */
60      public void consumeHeaderLine( String line )
61      {
62          getOutputConsumer().consumeHeaderLine( line );
63      }
64  
65      /**
66       * Delegate to proxied {@link OutputConsumer}
67       */
68      public void consumeMessageLine( String line )
69      {
70          getOutputConsumer().consumeMessageLine( line );
71      }
72  
73      /**
74       * Delegate to proxied {@link OutputConsumer}
75       */
76      public void consumeFooterLine( String line )
77      {
78          getOutputConsumer().consumeFooterLine( line );
79      }
80  
81      /**
82       * Delegate to proxied {@link OutputConsumer}
83       */
84      public void consumeOutputLine( String line )
85      {
86          getOutputConsumer().consumeOutputLine( line );
87      }
88  
89      /**
90       * Delegate to proxied {@link OutputConsumer}
91       */
92      public void testSetStarting( ReportEntry reportEntry )
93      {
94          getOutputConsumer().testSetStarting( reportEntry );
95      }
96  
97      /**
98       * Delegate to proxied {@link OutputConsumer}
99       */
100     public void testSetCompleted()
101     {
102         getOutputConsumer().testSetCompleted();
103     }
104 
105 }