Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / qadevOOo / runner / lib / SimpleStatus.java
blob177bfb3f7d021da375b09b913f03585123681811
1 /*
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 .
19 package lib;
21 /**
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.
26 class SimpleStatus {
28 /**
29 * The field is holding state of the status.
31 private final boolean bSuccessful;
33 /**
34 * The field is holding reason of the status.
36 private final RunState runState;
38 /**
39 * This is the run state: either SKIPPED, COMPLETED, etc.
40 * or user defined. Deriving classes can overwrite it for own run states.
42 protected String runStateString;
44 /**
45 * The constructor initialize state and reason field.
47 protected SimpleStatus( RunState runState, boolean bSuccessful ) {
48 this.bSuccessful = bSuccessful;
49 this.runState = runState;
50 if ( runState == RunState.COMPLETED ) {
51 runStateString = "COMPLETED";
52 } else if ( runState == RunState.SKIPPED ) {
53 runStateString = "SKIPPED";
54 } else if ( runState == RunState.EXCEPTION ) {
55 runStateString = "EXCEPTION";
56 } else {
57 runStateString = "UNKNOWN";
61 /**
62 * The constructor initialize state and reason field.
64 protected SimpleStatus(String runStateString, boolean bSuccessful) {
65 this.bSuccessful = bSuccessful;
66 this.runState = RunState.USER_DEFINED;
67 this.runStateString = runStateString;
70 public boolean isSuccessful() {
71 return bSuccessful;
74 /**
75 * getRunState() implementation. Just returns th runState field value.
77 public RunState getRunState() {
78 return runState;
81 /**
82 * getReason implementation. Just returns the reason field value.
84 public String getRunStateString() {
85 return runStateString;
88 /**
89 * Get the result: passed or failed.
91 public String getStateString() {
92 if (bSuccessful)
93 return "OK";
94 return "FAILED";