2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 * The class is a simple implementation of Status class. It implements simple
23 * Status behaviour: its state, reason and log are defined when creating
24 * the SimpleSTatus instance.
30 * The constatnt represents PASSED runtime state.
32 public final static int PASSED
= 0;
35 * The constant represents EXCEPTION runtime state.
37 public final static int EXCEPTION
= 3;
40 * The constant represents EXCLUDED runtime state.
42 public final static int EXCLUDED
= 2;
45 * The constant represents SKIPPED runtime state.
47 public final static int SKIPPED
= 1;
50 * This is a private indicator for a user defined runtime state
52 private final static int USER_DEFINED
= 4;
57 * The constant represents FAILED state.
59 public final static boolean FAILED
= false;
62 * The constant represents OK state.
64 public final static boolean OK
= true;
67 * The field is holding state of the status.
69 protected final boolean state
;
72 * The field is holding reason of the status.
74 protected final int runState
;
77 * This is the run state: either SKIPPED, PASSED, etc.
78 * or user defined. Deriving classes can overwrite it for own run states.
80 protected String runStateString
;
83 * The constructor initialize state and reason field.
85 protected SimpleStatus( int runState
, boolean state
) {
87 this.runState
= runState
;
88 if ( runState
== PASSED
) {
89 runStateString
= "PASSED";
90 } else if ( runState
== EXCLUDED
) {
91 runStateString
= "EXCLUDED";
92 } else if ( runState
== SKIPPED
) {
93 runStateString
= "SKIPPED";
94 } else if ( runState
== EXCEPTION
) {
95 runStateString
= "EXCEPTION";
97 runStateString
= "UNKNOWN";
102 * The constructor initialize state and reson field.
104 protected SimpleStatus(String runStateString
, boolean state
) {
106 this.runState
= USER_DEFINED
;
107 this.runStateString
= runStateString
;
111 * getState implementation. Just returns the state field value.
113 public boolean getState() {
118 * getRunState() implementation. Just returns th runState field value.
120 public int getRunState() {
125 * getReason implementation. Just returns the reason field value.
127 public String
getRunStateString() {
128 return runStateString
;
132 * Get the ressult: passed or failed.
134 public String
getStateString() {