Examples of StandardServletInputData


Examples of org.araneaframework.servlet.core.StandardServletInputData

    //Testing primitive constraint
    testForm.getElement("myLongText").setConstraint(
        new OptionalConstraint(
            new NumberInRangeConstraint(BigInteger.valueOf(20000), null)));

    StandardServletInputData input = new StandardServletInputData(request);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
    input.popScope();
   
    assertTrue("Test form must not be valid after reading from request", !testForm.convertAndValidate());
           
    //valid
   
    request = new MockHttpServletRequest();
   
    request.addParameter("testForm.__present", "true");
    request.addParameter("testForm.myCheckBox", "true");
    request.addParameter("testForm.myLongText", "40000");
    request.addParameter("testForm.myDateTime", (String) null);
   
    input = new StandardServletInputData(request);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
    input.popScope();
   
    assertTrue("Test form must be valid after reading from request", testForm.convertAndValidate());
   
    //off
   
    request = new MockHttpServletRequest();
   
    request.addParameter("testForm.__present", "true");
    request.addParameter("testForm.myCheckBox", "true");
    request.addParameter("testForm.myLongText", (String) null);
    request.addParameter("testForm.myDateTime", (String) null);
   
    input = new StandardServletInputData(request);
    input.pushScope("testForm");
    testForm._getWidget().update(input);
    input.popScope();
   
    assertTrue("Test form must be valid after reading from request", testForm.convertAndValidate());
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.