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 SKIPPED runtime state.
42 public final static int SKIPPED
= 1;
45 * This is a private indicator for a user defined runtime state
47 private final static int USER_DEFINED
= 4;
52 * The constant represents FAILED state.
54 public final static boolean FAILED
= false;
59 * The field is holding state of the status.
61 private final boolean state
;
64 * The field is holding reason of the status.
66 private final int runState
;
69 * This is the run state: either SKIPPED, PASSED, etc.
70 * or user defined. Deriving classes can overwrite it for own run states.
72 protected String runStateString
;
75 * The constructor initialize state and reason field.
77 protected SimpleStatus( int runState
, boolean state
) {
79 this.runState
= runState
;
80 if ( runState
== PASSED
) {
81 runStateString
= "PASSED";
82 } else if ( runState
== SKIPPED
) {
83 runStateString
= "SKIPPED";
84 } else if ( runState
== EXCEPTION
) {
85 runStateString
= "EXCEPTION";
87 runStateString
= "UNKNOWN";
92 * The constructor initialize state and reson field.
94 protected SimpleStatus(String runStateString
, boolean state
) {
96 this.runState
= USER_DEFINED
;
97 this.runStateString
= runStateString
;
101 * getState implementation. Just returns the state field value.
103 public boolean getState() {
108 * getRunState() implementation. Just returns th runState field value.
110 public int getRunState() {
115 * getReason implementation. Just returns the reason field value.
117 public String
getRunStateString() {
118 return runStateString
;
122 * Get the ressult: passed or failed.
124 public String
getStateString() {