01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: /*
20: * Created on Dec 9, 2003
21: *
22: */
23: package org.apache.jmeter.testelement;
24:
25: import org.apache.jmeter.testelement.property.IntegerProperty;
26:
27: /**
28: * @version $Revision: 493779 $ $Date: 2007-01-07 17:46:38 +0000 (Sun, 07 Jan 2007) $
29: */
30: public abstract class OnErrorTestElement extends AbstractTestElement {
31: /* Action to be taken when a Sampler error occurs */
32: public final static int ON_ERROR_CONTINUE = 0;
33:
34: public final static int ON_ERROR_STOPTHREAD = 1;
35:
36: public final static int ON_ERROR_STOPTEST = 2;
37:
38: /* Property name */
39: public final static String ON_ERROR_ACTION = "OnError.action";
40:
41: protected OnErrorTestElement() {
42: super ();
43: }
44:
45: public void setErrorAction(int value) {
46: setProperty(new IntegerProperty(ON_ERROR_ACTION, value));
47: }
48:
49: public int getErrorAction() {
50: int value = getPropertyAsInt(ON_ERROR_ACTION);
51: return value;
52: }
53:
54: public boolean isContinue() {
55: int value = getErrorAction();
56: return value == ON_ERROR_CONTINUE;
57: }
58:
59: public boolean isStopThread() {
60: int value = getErrorAction();
61: return value == ON_ERROR_STOPTHREAD;
62: }
63:
64: public boolean isStopTest() {
65: int value = getErrorAction();
66: return value == ON_ERROR_STOPTEST;
67: }
68: }
|