コード例 #1
0
 private static FailureType getById(String id) {
   for (FailureType type : FailureType.values()) {
     if (type.id.equals(id)) {
       return type;
     }
   }
   throw new IllegalArgumentException("Unknown failure ID: " + id);
 }
コード例 #2
0
 public static String getIdsAsString() {
   FailureType[] types = FailureType.values();
   StringBuilder builder = new StringBuilder();
   for (int i = 0; i < types.length; i++) {
     builder.append(types[i].id);
     if (i < types.length - 1) {
       builder.append(", ");
     }
   }
   return builder.toString();
 }
コード例 #3
0
 public FailureOperation(
     String message,
     FailureType type,
     SimulatorAddress workerAddress,
     String agentAddress,
     String hzAddress,
     String workerId,
     String testId,
     TestSuite testSuite,
     String cause) {
   this.message = message;
   this.type = type.name();
   this.workerAddress = (workerAddress == null) ? null : workerAddress.toString();
   this.agentAddress = agentAddress;
   this.hzAddress = hzAddress;
   this.workerId = workerId;
   this.testId = testId;
   this.testSuite = testSuite;
   this.cause = cause;
 }
コード例 #4
0
 public FailureType getType() {
   return FailureType.valueOf(type);
 }