Examples of convertAndValidate()


Examples of org.araneaframework.uilib.form.control.NumberControl.convertAndValidate()

      
    MockHttpServletRequest tooBigValueRequest = new MockHttpServletRequest();
    tooBigValueRequest.addParameter("myNumberInput", "80");
   
    MockUiLibUtil.emulateHandleRequest(nc, "myNumberInput", tooBigValueRequest);
    nc.convertAndValidate();   
   
    assertTrue("Number control mustn't be valid.", !nc.isValid());
   
    nc._getComponent().destroy();
  }
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    emptyRequest.addParameter("myTextBox", "");

    TextControl tb = new TextControl();  
    tb._getComponent().init(new MockEnviroment());
    MockUiLibUtil.emulateHandleRequest(tb, "myTextBox", emptyRequest);
    tb.convertAndValidate();

    assertNull("TextBox must return null on empty request.", tb.getRawValue());

    tb._getComponent().destroy();
  }
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    correctValueRequest.addParameter("myPersonalIdInput", "38304280235");
   
    TextControl pic = new TextControl(TextType.EST_PERSONAL_ID);
    pic._getComponent().init(new MockEnviroment());
    MockUiLibUtil.emulateHandleRequest(pic, "myPersonalIdInput", correctValueRequest);
    pic.convertAndValidate();
   
    assertTrue("Personal id control must be valid.", pic.isValid());
    assertTrue("Personal id control value must be a 'String'.", pic.getRawValue() instanceof String);
    assertTrue("Personal id control value must be '38304280235'.", ((String) pic.getRawValue()).equals("38304280235"));
    
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    
    MockHttpServletRequest incorrectValueRequest = new MockHttpServletRequest();
    incorrectValueRequest.addParameter("myPersonalIdInput", "abcd");
   
    MockUiLibUtil.emulateHandleRequest(pic, "myPersonalIdInput", incorrectValueRequest);
    pic.convertAndValidate();   
   
    assertTrue("Personal id control mustn't be valid.", !pic.isValid());
   
    pic._getComponent().destroy();
  }
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

   
    tc.setMinLength(new Long(5));
    tc.setMaxLength(new Long(20));
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", correctValueRequest);
    tc.convertAndValidate();
   
    assertTrue("Textbox control must be valid.", tc.isValid());   
    assertTrue("Textbox control value must be 'i love me'.", ((String) tc.getRawValue()).equals("i love me"));
    
    //Too short
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    MockHttpServletRequest tooShortValueRequest = new MockHttpServletRequest();
    tooShortValueRequest.addParameter("myTextBox", "boo");
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", tooShortValueRequest);
    tc.convertAndValidate();   
   
    assertTrue("Textbox control mustn't be valid.", !tc.isValid());
   
    //Too long
   
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

   
    MockHttpServletRequest tooLongValueRequest = new MockHttpServletRequest();
    tooLongValueRequest.addParameter("myTextBox", "i love myself and others very very much");
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", tooLongValueRequest);  
    tc.convertAndValidate();   
   
    assertTrue("Textbox control mustn't be valid.", !tc.isValid())
         
    //min=max correct
   
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    correctValueRequest = new MockHttpServletRequest();
    correctValueRequest.addParameter("myTextBox", "1234567890");
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", correctValueRequest);
    tc.convertAndValidate();
       
    assertTrue("Textbox control must be valid.", tc.isValid());   
    assertTrue("Textbox control value must be '1234567890'.", ((String) tc.getRawValue()).equals("1234567890"));
   
    //min=max too short
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    //min=max too short

    tooShortValueRequest.addParameter("myTextBox", "123456789");
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", tooShortValueRequest);
    tc.convertAndValidate();
       
    assertTrue("Textbox control mustn't be valid.", !tc.isValid());   
   
    //min=max too long
View Full Code Here

Examples of org.araneaframework.uilib.form.control.TextControl.convertAndValidate()

    //min=max too long

    tooShortValueRequest.addParameter("myTextBox", "12345678901");
   
    MockUiLibUtil.emulateHandleRequest(tc, "myTextBox", tooShortValueRequest);  
    tc.convertAndValidate();
       
    assertTrue("Textbox control mustn't be valid.", !tc.isValid())
   
    tc._getComponent().destroy();
 
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.