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.report.RunMode;
22  
23  import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_SYSPROPS;
24  
25  /**
26   * The event of system property.
27   *
28   * @since 3.0.0-M5
29   */
30  public final class SystemPropertyEvent extends Event {
31      private final RunMode runMode;
32      private final Long testRunId;
33      private final String key;
34      private final String value;
35  
36      public SystemPropertyEvent(RunMode runMode, Long testRunId, String key, String value) {
37          super(BOOTERCODE_SYSPROPS);
38          this.runMode = runMode;
39          this.testRunId = testRunId;
40          this.key = key;
41          this.value = value;
42      }
43  
44      public RunMode getRunMode() {
45          return runMode;
46      }
47  
48      public Long getTestRunId() {
49          return testRunId;
50      }
51  
52      public String getKey() {
53          return key;
54      }
55  
56      public String getValue() {
57          return value;
58      }
59  
60      @Override
61      public boolean isControlCategory() {
62          return false;
63      }
64  
65      @Override
66      public boolean isConsoleCategory() {
67          return false;
68      }
69  
70      @Override
71      public boolean isConsoleErrorCategory() {
72          return false;
73      }
74  
75      @Override
76      public boolean isStandardStreamCategory() {
77          return false;
78      }
79  
80      @Override
81      public boolean isSysPropCategory() {
82          return true;
83      }
84  
85      @Override
86      public boolean isTestCategory() {
87          return false;
88      }
89  
90      @Override
91      public boolean isJvmExitError() {
92          return false;
93      }
94  }