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

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


    this.setSurveyManager((ISurveyManager) this.getService(SurveySystemConstants.SURVEY_MANAGER));   
  }

  public void testList() throws Throwable {
    String result = null;
    SurveyImageAction action = null;
    try {
      this.setUserOnSession("admin");
      this.initAction("/do/jpsurvey/Survey", "list");
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (SurveyImageAction) this.getAction();
      assertNotNull(action.getCategoryRoot());     
    } catch (Throwable t) {
      throw t;
    }
  }
View Full Code Here


    }
  }
 
  public void testAssociateSurveyImage() throws Throwable {
    String result = null;
    SurveyImageAction action = null;
    try {
      this.setUserOnSession("admin");
     
      // test with no survey id
      this.initAction("/do/jpsurvey/Survey", "associateSurveyImage");
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.INPUT, result);
     
      // test with unknown survey id
      this.initAction("/do/jpsurvey/Survey", "associateSurveyImage");
      this.addParameter("surveyId", -1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (SurveyImageAction) this.getAction();
      assertNotNull(action.getTitles());
      assertTrue(action.getTitles().isEmpty());
     
      // test with normal survey ID
      this.initAction("/do/jpsurvey/Survey", "associateSurveyImage");
      this.addParameter("surveyId", 1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (SurveyImageAction) this.getAction();
      assertNotNull(action.getTitles());
      assertEquals(2, action.getTitles().size());
     
    } catch (Throwable t) {
      throw t;
    }
  }
View Full Code Here

    }
  }
 
  public void testJoinImage() throws Throwable {
    String result = null;
    SurveyImageAction action = null;
    Survey backup = null;
    Survey survey = null;
    try {
      this.setUserOnSession("admin");
     
      // test on unknown non existent survey
      this.initAction("/do/jpsurvey/Survey", "joinImage");
      this.addParameter("resourceId", "IMG69");
      this.addParameter("surveyId", -1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (SurveyImageAction) this.getAction();     
      assertNotNull(action.getResources());
      assertFalse(action.getResources().isEmpty());
     
      // test on effective survey
      backup = this.getSurveyManager().loadSurvey(1);
      if (null != backup) {
        this.initAction("/do/jpsurvey/Survey", "joinImage");
        this.addParameter("resourceId", "IMG069");
        this.addParameter("surveyId", 1);
        result = this.executeAction();
        assertNotNull(result);
        assertEquals(Action.SUCCESS, result);
        action = (SurveyImageAction) this.getAction();     
        assertNotNull(action.getResources());
        assertFalse(action.getResources().isEmpty());
        survey = this.getSurveyManager().loadSurvey(1);
        assertEquals("IMG069", survey.getImageId());
      }     
    } catch (Throwable t) {
      throw t;
View Full Code Here

TOP

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

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.