Package org.araneaframework.tests.mock

Examples of org.araneaframework.tests.mock.TestVO


   * Tests basic Value Object reading.
   */
  public void testFormBasicVoReading() throws Exception {

    FormWidget voForm = makeVoForm();
    TestVO test = new TestVO();

    final String LIFE_IS_BEAUTIFUL = "Life is beautiful";
    final Long TEN = new Long(10);

    voForm.setValueByFullName("booleanValue", Boolean.TRUE);
    voForm.setValueByFullName("stringValue", LIFE_IS_BEAUTIFUL);
    voForm.setValueByFullName("longValue", TEN);

    BeanFormReader voReader = new BeanFormReader(voForm);

    voReader.readFormBean(test);

    log.debug("Value Object after reading from form" + test);

    assertTrue("Boolean value read properly", test.getBooleanValue().equals(Boolean.TRUE));
    assertTrue("String value read properly", test.getStringValue().equals(LIFE_IS_BEAUTIFUL));
    assertTrue("Long value read properly", test.getLongValue().equals(TEN));
  }
View Full Code Here


   * Tests hierarchical Value Object reading.
   */
  public void testFormHierarchicalVoReading() throws Exception {

    FormWidget voForm = makeVoForm();
    TestVO test = new TestVO();

    final String LIFE_IS_BEAUTIFUL = "Life is beautiful";
    final Long TEN = new Long(10);  

    voForm.setValueByFullName("subTestVO.booleanValue", Boolean.TRUE);
    voForm.setValueByFullName("subTestVO.stringValue", LIFE_IS_BEAUTIFUL);
    voForm.setValueByFullName("subTestVO.longValue", TEN);

    BeanFormReader voReader = new BeanFormReader(voForm);

    voReader.readFormBean(test);

    log.debug("Value Object after reading from form");

    assertTrue("Boolean value read properly", test.getSubTestVO().getBooleanValue().equals(Boolean.TRUE));
    assertTrue("String value read properly", test.getSubTestVO().getStringValue().equals(LIFE_IS_BEAUTIFUL));
    assertTrue("Long value read properly", test.getSubTestVO().getLongValue().equals(TEN));
  }
View Full Code Here

   * Tests basic Value Object writing.
   */
  public void testFormBasicVoWriting() throws Exception {

    FormWidget voForm = makeVoForm();
    TestVO test = new TestVO();

    final String LIFE_IS_BEAUTIFUL = "Life is beautiful";
    final Long TEN = new Long(10);

    test.setBooleanValue(Boolean.TRUE);
    test.setStringValue(LIFE_IS_BEAUTIFUL);
    test.setLongValue(TEN);

    BeanFormWriter voWriter = new BeanFormWriter(test.getClass());

    voWriter.writeFormBean(voForm, test);

    assertTrue("Boolean value written properly", voForm.getValueByFullName("booleanValue").equals(Boolean.TRUE));
    assertTrue("String value written properly", voForm.getValueByFullName("stringValue").equals(LIFE_IS_BEAUTIFUL));
View Full Code Here

   * Tests hierarchical Value Object writing.
   */
  public void testFormHierarchicalVoWriting() throws Exception {

    FormWidget voForm = makeVoForm();
    TestVO test = new TestVO();

    final String LIFE_IS_BEAUTIFUL = "Life is beautiful";
    final Long TEN = new Long(10);

    test.setSubTestVO(new TestVO());

    test.getSubTestVO().setBooleanValue(Boolean.TRUE);
    test.getSubTestVO().setStringValue(LIFE_IS_BEAUTIFUL);
    test.getSubTestVO().setLongValue(TEN);

    BeanFormWriter voWriter = new BeanFormWriter(test.getClass());

    voWriter.writeFormBean(voForm, test);

    assertTrue("Boolean value written properly", voForm.getValueByFullName("subTestVO.booleanValue").equals(Boolean.TRUE));
    assertTrue("String value written properly", voForm.getValueByFullName("subTestVO.stringValue").equals(LIFE_IS_BEAUTIFUL));
View Full Code Here

TOP

Related Classes of org.araneaframework.tests.mock.TestVO

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.