Package org.araneaframework.servlet.core

Examples of org.araneaframework.servlet.core.StandardServletInputData


    MockLifeCycle.begin(parent);
   
    req = new MockHttpServletRequest();
    res = new MockHttpServletResponse();
   
    input = new StandardServletInputData(req);
    output = new StandardServletOutputData(req, res);
   
    path = MockUtil.getPath();
  }
View Full Code Here


  }
 
  public void testActionGetsCalled() throws Exception {
    String pathStr = "i.am.a.path.who.are.you";
    req.addParameter(StandardServiceContainerService.ACTION_PATH_INPUT_DATA_PARAMETER, pathStr);
    input = new StandardServletInputData(req);
   
    parent._getService().action(path, input, output);
    assertTrue(child.getActionCalled());
    assertTrue(pathStr.equals(child.getPath().toString()));
  }
View Full Code Here

    assertTrue(child.getActionCalled());
    assertTrue(pathStr.equals(child.getPath().toString()));
  }
 
  public void testActionDoesNotGetCalled() throws Exception {
    input = new StandardServletInputData(req);
   
    parent._getService().action(path, input, output);
    assertFalse(child.getActionCalled());
  }
View Full Code Here

    MockLifeCycle.begin(parent);
   
    req = new MockHttpServletRequest();
    res = new MockHttpServletResponse();
   
    input = new StandardServletInputData(req);
    output = new StandardServletOutputData(req, res);
  }
View Full Code Here

  }
 
  public void testTranslatesRenderToAction() throws Exception {
    String pathStr = "i.am.a.path";
    req.addParameter(StandardServiceAdapterWidget.ACTION_PATH_INPUT_DATA_PARAMETER, pathStr);
    input = new StandardServletInputData(req);
   
    parent._getWidget().update(input);
    parent._getWidget().event(MockUtil.getPath(), input);
    parent._getWidget().render(output);
    assertTrue(child.getActionCalled());
View Full Code Here

  }
 
  //check how long the name is :)
  public void testDoesNotTranslateRenderToActionWithEmptyPath() throws Exception {
    req.addParameter(StandardServiceAdapterWidget.ACTION_PATH_INPUT_DATA_PARAMETER, "");
    input = new StandardServletInputData(req);
   
    parent._getWidget().update(input);
    parent._getWidget().event(MockUtil.getPath(), input);
    parent._getWidget().render(output);
    assertTrue(child.getActionCalled());
View Full Code Here

    MockLifeCycle.begin(service, new StandardEnvironment(null, map));
   
    req = new MockHttpServletRequest();
    res = new MockHttpServletResponse();
   
    input = new StandardServletInputData(req);
    output = new StandardServletOutputData(req, res);
  }
View Full Code Here

    validRequest.addParameter("testForm.myDateTime.time", "01:01");
    validRequest.addParameter("testForm.hierarchyTest.myTextarea", "blah");
    validRequest.addParameter("testForm.hierarchyTest.mySelect", "2");

    //Trying to read from a valid request
    StandardServletInputData input = new StandardServletInputData(validRequest);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
   
    Date reqDate = (new SimpleDateFormat("dd.MM.yyyy hh:mm")).parse("11.10.2015 01:01");

    //Checking that reading from request works
View Full Code Here

    invalidRequest.addParameter("testForm.myDateTime.date", "HA-HA");
    invalidRequest.addParameter("testForm.myDateTime.time", "BLAH");
    invalidRequest.addParameter("testForm.hierarchyTest.myTextarea", "");   

    //Testing that invalid requests are read right
    StandardServletInputData input = new StandardServletInputData(invalidRequest);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
   
    assertTrue("Test form must not be valid after reading from request", !testForm.convertAndValidate());
  }
View Full Code Here

    mandatoryMissingRequest.addParameter("testForm.myDateTime.date", "11.10.2015");
    mandatoryMissingRequest.addParameter("testForm.myDateTime.time", "01:01");
    mandatoryMissingRequest.addParameter("testForm.hierarchyTest.mySelect", "2");

    //Testing that mandatory items are processed right
    StandardServletInputData input = new StandardServletInputData(mandatoryMissingRequest);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
   
    assertTrue("Test form must not be valid after reading from request", !testForm.convertAndValidate());
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.servlet.core.StandardServletInputData

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.