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