1 package org.sapia.taskman; 2 3 6 public class TestTaskOutput implements TaskOutput { 7 private int _count = 0; 8 private boolean _closed; 9 10 13 public TestTaskOutput() { 14 super(); 15 } 16 17 20 public void close() { 21 if(_closed) { 22 throw new IllegalStateException ("Task output already closed"); 23 } 24 25 _closed = true; 26 } 27 28 31 public TaskOutput debug(Object message) { 32 return this; 33 } 34 35 38 public TaskOutput error(Object message, Throwable err) { 39 return this; 40 } 41 42 45 public TaskOutput error(Object message) { 46 return this; 47 } 48 49 52 public TaskOutput error(Throwable err) { 53 return this; 54 } 55 56 59 public TaskOutput info(Object message) { 60 return this; 61 } 62 63 66 public void setTaskName(String name) { 67 } 68 69 72 public TaskOutput warning(Object message) { 73 return this; 74 } 75 76 int count() { 77 return _count; 78 } 79 80 void reset() { 81 _count = 0; 82 } 83 84 void inc() { 85 _count++; 86 } 87 88 boolean closed() { 89 return _closed; 90 } 91 } 92 | Popular Tags |