Package org.nanocontainer.nanowar.sample.webwork1

Examples of org.nanocontainer.nanowar.sample.webwork1.CheeseActionTest


    * test that cheese action works and store cheese in service
    */
    public void testCheeseAction() throws Exception {
        DefaultCheeseService service = new DefaultCheeseService(new MemoryCheeseDao());
       
        CheeseAction action = new CheeseAction(service);
        action.getCheese().setName("gouda");
        action.getCheese().setCountry("Netherlands");
        action.setCommand("save");
        assertEquals(CheeseAction.SUCCESS,action.execute());

        // Cheddar exists already -- count 1

        assertEquals(2, service.getCheeses().size());
       
        action.setCommand("remove");
        assertEquals(CheeseAction.SUCCESS,action.execute());
       
        assertEquals(1, service.getCheeses().size());
       
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.nanowar.sample.webwork1.CheeseActionTest

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.