01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.test.activepassive;
06:
07: public class ActivePassiveCrashMode {
08: public static final String CRASH_AFTER_MUTATE = "crash-after-mutate";
09: public static final String CONTINUOUS_ACTIVE_CRASH = "continuous-active-crash";
10: public static final String RANDOM_SERVER_CRASH = "random-server-crash";
11:
12: private final String mode;
13:
14: public ActivePassiveCrashMode(String mode) {
15: if (!mode.equals(CRASH_AFTER_MUTATE)
16: && !mode.equals(CONTINUOUS_ACTIVE_CRASH)
17: && !mode.equals(RANDOM_SERVER_CRASH)) {
18: throw new AssertionError("Unrecognized crash mode [" + mode
19: + "]");
20: }
21: this .mode = mode;
22: }
23:
24: public String getMode() {
25: if (mode == null) {
26: throw new AssertionError("Mode was not set");
27: }
28: return mode;
29: }
30: }
|