View Javadoc

1   package org.apache.maven.surefire.booter.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 510866 2007-02-23 08:13:49Z brett $
29   * @since 2.1
30   */
31  public class OutputConsumerProxy
32      implements OutputConsumer
33  {
34  
35      private 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.setOutputConsumer( outputConsumer );
45      }
46  
47      /**
48       * {@link OutputConsumer} that calls will be delegated to
49       *
50       * @param outputConsumer the proxied {@link OutputConsumer}
51       */
52      public void setOutputConsumer( OutputConsumer outputConsumer )
53      {
54          this.outputConsumer = outputConsumer;
55      }
56  
57      /**
58       * {@link OutputConsumer} that calls will be delegated to
59       *
60       * @return the proxied {@link OutputConsumer}
61       */
62      public OutputConsumer getOutputConsumer()
63      {
64          return outputConsumer;
65      }
66  
67      /**
68       * Delegate to proxied {@link OutputConsumer}
69       */
70      public void consumeHeaderLine( String line )
71      {
72          getOutputConsumer().consumeHeaderLine( line );
73      }
74  
75      /**
76       * Delegate to proxied {@link OutputConsumer}
77       */
78      public void consumeMessageLine( String line )
79      {
80          getOutputConsumer().consumeMessageLine( line );
81      }
82  
83      /**
84       * Delegate to proxied {@link OutputConsumer}
85       */
86      public void consumeFooterLine( String line )
87      {
88          getOutputConsumer().consumeFooterLine( line );
89      }
90  
91      /**
92       * Delegate to proxied {@link OutputConsumer}
93       */
94      public void consumeOutputLine( String line )
95      {
96          getOutputConsumer().consumeOutputLine( line );
97      }
98  
99      /**
100      * Delegate to proxied {@link OutputConsumer}
101      */
102     public void testSetStarting( ReportEntry reportEntry )
103     {
104         getOutputConsumer().testSetStarting( reportEntry );
105     }
106 
107     /**
108      * Delegate to proxied {@link OutputConsumer}
109      */
110     public void testSetCompleted()
111     {
112         getOutputConsumer().testSetCompleted();
113     }
114 
115 }