*/
protected Question getFakeQuestion() throws Throwable {
Question question = new Question();
String xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><properties><property key=\"test\">me</property><property key=\"test2\">me too</property></properties>";
ApsProperties prop = new ApsProperties();
Choice choice1 = this.getFakeChoice();
Choice choice2 = this.getFakeChoice();
List<Choice> choiceList = new ArrayList<Choice>();
try {
choiceList.add(choice1);
choiceList.add(choice2);
prop.loadFromXml(xml);
question.setQuestions(prop);
question.setId(2); // this will be changed when saving...
question.setMaxResponseNumber(2677);
question.setMinResponseNumber(1977);
question.setPos(0);
question.setSingleChoice(false);
question.setSurveyId(1);
choice1.setId(2); // will be changed upon saving
choice1.setPos(0);
choice1.setQuestionId(question.getId());
choice1.setId(2); // will be changed upon saving
choice2.setPos(10); // this is set on purpose to test save in sorted position method
choice2.setQuestionId(question.getId());
question.setChoices(choiceList);
} catch (Throwable t) {
throw t;
}
return question;