parent
47af8b4522
commit
6feb7f87dc
@ -0,0 +1,43 @@
|
|||||||
|
package space.kklochko.simple_jbdd.tests.commands;
|
||||||
|
|
||||||
|
import space.kklochko.simple_jbdd.tests.Test;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
public abstract class AbstractTestCommand<T extends Test> {
|
||||||
|
protected String type;
|
||||||
|
protected String label;
|
||||||
|
|
||||||
|
public AbstractTestCommand(String label) {
|
||||||
|
setLabel(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract boolean test();
|
||||||
|
|
||||||
|
public Map<String, String> getLabels() {
|
||||||
|
Map<String, String> labels = new TreeMap<String, String>();
|
||||||
|
labels.put(getType(), this.getLabel());
|
||||||
|
return labels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void setObject(T object);
|
||||||
|
|
||||||
|
public abstract T getObject();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
package space.kklochko.simple_jbdd.tests.commands;
|
||||||
|
|
||||||
|
import space.kklochko.simple_jbdd.tests.Test;
|
||||||
|
|
||||||
|
public class SimpleTestCommand<T extends Test> extends AbstractTestCommand<T> {
|
||||||
|
protected T object;
|
||||||
|
|
||||||
|
public SimpleTestCommand(String label, T object) {
|
||||||
|
super(label);
|
||||||
|
setObject(object);
|
||||||
|
setType("Title");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean test() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setObject(T object) {
|
||||||
|
this.object = object;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getObject() {
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue