1package autotest.tko; 2 3import autotest.common.Utils; 4 5import com.google.gwt.json.client.JSONObject; 6 7import java.util.ArrayList; 8import java.util.List; 9 10class ConditionTestSet extends TestSet { 11 private List<String> conditionParts = new ArrayList<String>(); 12 private JSONObject initialCondition = new JSONObject(); 13 14 public ConditionTestSet(JSONObject initialCondition) { 15 this.initialCondition = initialCondition; 16 } 17 18 public ConditionTestSet() { 19 this.initialCondition = new JSONObject(); 20 } 21 22 public void addCondition(String condition) { 23 conditionParts.add(condition); 24 } 25 26 @Override 27 public JSONObject getInitialCondition() { 28 return Utils.copyJSONObject(initialCondition); 29 } 30 31 @Override 32 public String getPartialSqlCondition() { 33 return Utils.joinStrings(" AND ", conditionParts); 34 } 35 36 @Override 37 public boolean isSingleTest() { 38 return false; 39 } 40 41 @Override 42 public int getTestIndex() { 43 throw new UnsupportedOperationException(); 44 } 45} 46