Package org.apache.commons.chain

Examples of org.apache.commons.chain.Command.execute()


           clayContext.setChild(child);
           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
           clayContext.setSymbols(displayElement.getSymbols());
          
           isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = 10", "10", child.getValue());

          
           // test a symbol value with a null value symbol replacement
View Full Code Here


           clayContext.setChild(child);
           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
           clayContext.setSymbols(displayElement.getSymbols());
          
           isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = null", null, child.getValue());


           // test a symbol value with an empty String value. 
View Full Code Here

           clayContext.setChild(child);
           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
           clayContext.setSymbols(displayElement.getSymbols());
          
           isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = null", null, child.getValue());

           //no symbol replacement for a empty string - should return
           //an empty string.  This allows components like the selectItem
View Full Code Here

           clayContext.setFacesContext(facesContext);
           clayContext.setChild(child);
           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
          
           isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = \"\"", "", child.getValue());

           //Case insensitive and reoccurring replacement
           attr.setValue("@TeSt1, @tEst1 never @test2; @test1, @teSt1 till ya @tesT3")//test multiple symbols          
View Full Code Here

           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
           // normally done in the AssignChildrenCommand
           clayContext.setSymbols(displayElement.getSymbols());
          
           isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = \"rock, rock never stop; rock, rock till ya drop\"",
                   "rock, rock never stop; rock, rock till ya drop", child.getValue());

    }
View Full Code Here

        clayContext.setDisplayElement(displayElement);
        clayContext.setSymbols(displayElement.getSymbols());
        clayContext.setJspIds(new TreeSet());
               
        Command command = new CreateComponentCommand();
        boolean isFinal = command.execute(clayContext);
        assertEquals("command finished", false, isFinal);
       
        UIComponent child = (UIComponent) clayContext.getChild();
        assertNotNull("child", child);
       
View Full Code Here

        clayContext.setSymbols(displayElement.getSymbols());
        clayContext.setJspIds(new TreeSet());
               
        command = new CreateComponentCommand();
        try {
            isFinal = command.execute(clayContext);
            assertTrue("id replacement failed", false);
        } catch (RuntimeException e) {
            assertTrue("null component id",
                    e.getMessage().startsWith("The component symbol substitution failed for id \"@wynn\""));   
        }
View Full Code Here

        clayContext.setSymbols(displayElement.getSymbols());
        clayContext.setJspIds(new TreeSet());
               
        command = new CreateComponentCommand();
        try {
            isFinal = command.execute(clayContext);
            assertTrue("id replacement failed", false);
        } catch (RuntimeException e) {
            assertTrue("missing component id",
                    e.getMessage().startsWith("The component symbol substitution failed for id \"@wynn\""));   
        }
View Full Code Here

        clayContext.setDisplayElement(displayElement);
        // normally done in the AssignChildrenCommand
        clayContext.setSymbols(displayElement.getSymbols());
               
        Command command = new PropertyValueCommand();
        boolean isFinal = command.execute(clayContext);
        assertEquals("command finished", true, isFinal);      
        assertEquals("value = 6743", "6743", child.getValue());     

   
        //create a target component
View Full Code Here

        displayElement.addSymbol(createSymbol("@{ab}", "43"));
        displayElement.addSymbol(createSymbol("@{a}", "67"));

        clayContext.setChild(child);

        isFinal = command.execute(clayContext);
        assertEquals("command finished", true, isFinal);      
        assertEquals("value = 6743", "6743", child.getValue());     


       
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.