Package com.agiletec.plugins.jpsurvey.apsadmin.survey

Examples of com.agiletec.plugins.jpsurvey.apsadmin.survey.QuestionAction


    }
  }
 
  public void testTrashQuestion() throws Throwable {
    String result = null;
    QuestionAction action = null;
    try {
      this.setUserOnSession("admin");
     
      // test with no question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.INPUT, result);
     
      // test with no question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      this.addParameter("QuestionId", -1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (QuestionAction) this.getAction();
      assertNotNull(action.getQuestions());
      assertTrue(action.getQuestions().isEmpty());
     
      // test with valid question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      this.addParameter("QuestionId", 1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (QuestionAction) this.getAction();
      assertNotNull(action.getQuestion());
      assertEquals(3, action.getQuestion().getChoices().size());
    } catch (Throwable t) {
      throw t;
    }
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpsurvey.apsadmin.survey.QuestionAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.