View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.surefire.api.event;
20  
21  import org.apache.maven.surefire.api.booter.ForkedProcessEventType;
22  import org.apache.maven.surefire.api.report.ReportEntry;
23  
24  /**
25   * The base class of an event of test control.
26   *
27   * @since 3.0.0-M5
28   * @param <T> TestSetReportEntry or ReportEntry
29   */
30  public abstract class AbstractTestControlEvent<T extends ReportEntry> extends Event {
31      private final T reportEntry;
32  
33      public AbstractTestControlEvent(ForkedProcessEventType eventType, T reportEntry) {
34          super(eventType);
35          this.reportEntry = reportEntry;
36      }
37  
38      public T getReportEntry() {
39          return reportEntry;
40      }
41  
42      @Override
43      public boolean isControlCategory() {
44          return false;
45      }
46  
47      @Override
48      public boolean isConsoleCategory() {
49          return false;
50      }
51  
52      @Override
53      public boolean isConsoleErrorCategory() {
54          return false;
55      }
56  
57      @Override
58      public boolean isStandardStreamCategory() {
59          return false;
60      }
61  
62      @Override
63      public boolean isSysPropCategory() {
64          return false;
65      }
66  
67      @Override
68      public boolean isTestCategory() {
69          return true;
70      }
71  
72      @Override
73      public boolean isJvmExitError() {
74          return false;
75      }
76  }