Package org.jboss.jsfunit.jsfsession

Examples of org.jboss.jsfunit.jsfsession.JSFSession


{
   private String[] Names = {"Alex", "Jonh", "Roger"};

   public void testJsFunction() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/jsFunction.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      JSFServerSession server = jsfSession.getJSFServerSession();

      Map<String, String> param = new HashMap<String, String>();
      for (String name : Names)
      {
         HtmlElement element = (HtmlElement)client.getElement(name);
View Full Code Here


      return new TestSuite( AjaxFormTest.class );
   }

   public void testAjaxForm() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/form.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      JSFServerSession server = jsfSession.getJSFServerSession();
     
      assertEquals("Name:", server.getComponentValue("ajaxSubmitTrueForm:name"));
      assertEquals("Name:", server.getComponentValue("ajaxSubmitFalseForm:name"));
     
      client.click("SetBoth");
View Full Code Here

      return new TestSuite( ActionParamTest.class );
   }

   public void testActionParam() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/actionparam.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      JSFServerSession server = jsfSession.getJSFServerSession();
     
      client.click("SetToAlex");
      assertEquals("Alex", server.getManagedBeanValue("#{userBean.name}"));
     
      client.click("SetToJohn");
View Full Code Here

  private static final int _EXPECTED_POLLING_INTERVAL = 500;
 
 
  public void testPoll_OnOffTest() throws InterruptedException, IOException
  {
    JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/poll.jsf");
    JSFClientSession client = jsfSession.getJSFClientSession();
    RichFacesClient ajaxClient = new RichFacesClient(client);
    JSFServerSession server = jsfSession.getJSFServerSession();

    // Get the backing bean to check activity
    PollBean pb = (PollBean)server.getManagedBeanValue(_POLLBEAN);
    assertNotNull("Can't find PollBean",pb);
    // Make sure polling is enabled
View Full Code Here

  }
 
  public void testPoll_StillRunning() throws InterruptedException, IOException
  {
    JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/inplaceInput.jsf")// Anything but the Polling page
    JSFClientSession client = jsfSession.getJSFClientSession();
    RichFacesClient ajaxClient = new RichFacesClient(client);
    JSFServerSession server = jsfSession.getJSFServerSession();
   
    // Get the backing bean to check activity
    PollBean pb = (PollBean)server.getManagedBeanValue(_POLLBEAN);
    assertNotNull("Can't find PollBean",pb);
    // Make sure the date is NOT updating
View Full Code Here

*/
public class AjaxIncludeTest extends ServletTestCase
{
   public void testWizard() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/include.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      JSFServerSession server = jsfSession.getJSFServerSession();
     
      client.setValue("fn", "Stan");
      client.setValue("ln", "Silvert");
      client.setValue("comp", "JBoss");
      client.click("wizardNext");
View Full Code Here

*/
public class AjaxOutputPanelTest extends ServletTestCase
{
   public void testLayoutNone() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/outputPanel.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      JSFServerSession server = jsfSession.getJSFServerSession();

      client.type("text1", 'f');
      client.type("text1", 'o');
      client.type("text1", 'o');
     
View Full Code Here

*/
public class RichInputNumberSliderTest extends ServletTestCase
{
   public void testNumberSliders() throws IOException
   {
      JSFSession jsfSession = JSFSessionFactory.makeSession("/richfaces/inputNumberSlider.jsf");
      JSFClientSession client = jsfSession.getJSFClientSession();
      RichFacesClient ajaxClient = new RichFacesClient(client);
      JSFServerSession server = jsfSession.getJSFServerSession();
     
      ajaxClient.setInputNumberSlider("slider1", "45");
      ajaxClient.setInputNumberSlider("slider2", "55");
      ajaxClient.setInputNumberSlider("slider3", "945");
      client.click("submit");
View Full Code Here

   private static boolean printRenderedOutput = false;

   @Test
   public void submittedConferenceShouldBeSaved() throws Exception
   {
      JSFSession jsfSession = new JSFSession("/submit.jsf");
     
      JSFServerSession server = jsfSession.getJSFServerSession();
      assertEquals("/submit.xhtml", server.getCurrentViewID());
     
      assertEquals(null, server.getManagedBeanValue("#{conference.title}"));
      assertEquals(null, server.getManagedBeanValue("#{conference.startDate}"));
      assertEquals(null, server.getManagedBeanValue("#{conference.endDate}"));
      assertEquals(null, server.getManagedBeanValue("#{conference.location}"));
      assertEquals(null, server.getManagedBeanValue("#{conference.topic}"));
     
      JSFClientSession client = jsfSession.getJSFClientSession();
      if (printRenderedOutput)
      {
         System.out.println("GET /submit.jsf HTTP/1.1\n\n" + client.getPageAsText());
      }
View Full Code Here

      validateManagedBeanValueOnIndexPage();
   }

   protected void validateManagedBeanValueOnIndexPage() throws Exception
   {
      JSFSession jsfSession = new JSFSession("/index.jsf");
      System.out.println("GET /index.jsf HTTP/1.1\n\n" + jsfSession.getJSFClientSession().getPageAsText());
      assertTrue(Environment.is12Compatible());
      assertTrue(Environment.is20Compatible());
      assertEquals(2, Environment.getJSFMajorVersion());
      assertEquals(0, Environment.getJSFMinorVersion());

      JSFServerSession server = jsfSession.getJSFServerSession();

      assertEquals("42", server.getManagedBeanValue("#{hitchhikersGuide.ultimateAnswer}"));
      assertEquals(ProjectStage.Development, server.getManagedBeanValue("#{hitchhikersGuide.journeyStage}"));
      assertEquals(ProjectStage.Development, server.getFacesContext().getApplication().getProjectStage());
   }
View Full Code Here

TOP

Related Classes of org.jboss.jsfunit.jsfsession.JSFSession

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.