Package org.rendersnake.servlet

Examples of org.rendersnake.servlet.FormDataPopulator


import junit.framework.TestCase;

public class FormDataPopulatorTest extends TestCase {

    public void testPerson(){
        FormDataPopulator pop = new FormDataPopulator();
        Person p = new Person();
        MockHttpRequest request = new MockHttpRequest();
        request.parameters.put("name"+FormHandler.VAR_NAME_POSTFIX,"me");
        request.parameters.put("age"+FormHandler.VAR_NAME_POSTFIX,"12");
        request.parameters.put("isMale"+FormHandler.VAR_NAME_POSTFIX,"false");
        request.parameters.put("hidden","notshown");
       
        pop.populate(request, p);
       
        assertEquals(p.name, "me");
        assertEquals(p.age, 12);
        assertEquals(p.isMale, false);
    }
View Full Code Here


        assertEquals(p.age, 12);
        assertEquals(p.isMale, false);
    }
    public void testSetFails(){
        Logger.getLogger(FormDataPopulator.class.getName()).setLevel(Level.FINE);
        FormDataPopulator pop = new FormDataPopulator();
        Person p = new Person();
        MockHttpRequest request = new MockHttpRequest();
        request.parameters.put("age"+FormHandler.VAR_NAME_POSTFIX,"twentyfour");
        pop.populate(request, p);
    }
View Full Code Here

TOP

Related Classes of org.rendersnake.servlet.FormDataPopulator

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.