0 Replies Latest reply on Dec 7, 2008 3:46 PM by wgaulke

    Testing h:selectOne and derivates in integration test

    wgaulke

      Hi there,


      I have been faced with a problem and so far found no solution for it. The forum and mailing list couldn't find a solution.


      My problem: I want to integration test h:selectOne selections. I need to obtain the values and set one selection.



      <h:selectOneMenu value="#{user.selection}">
        <s:selectItems value="#{selectionList.resultList}"
          var="_item"
          label="#{_item.name}" 
          noSelectionLabel="Please choose..."/>
        <s:convertEntity/>
      </h:selectOneMenu>




      Now how do I obtain the values of the result list in a seam test?


      List<Selection> selections =  (List<Selection>) getValue("#{selectionList.resultList}");




      didn't get the list. Also




      List<Selection> selections= (List<Selection>) Contexts.getSessionContext().get("#{selectionList.resultList}");





      did not do the job.



      How do you test these elements?
      Thanks in advance.