Package org.springmodules.xt.ajax

Examples of org.springmodules.xt.ajax.AjaxAction.render()


    }
   
    public void testRender() throws Exception {
        AjaxAction action = new InsertContentAfterAction("testId", Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here


   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

    }
   
    public void testRender() throws Exception {
        AjaxAction action = new AppendContentAction("testId", new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
View Full Code Here

   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("wildcard", "/append-as-children/context/matcher/@matchMode", result);
View Full Code Here

   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("plain", "/append-as-children/context/matcher/@matchMode", result);
View Full Code Here

   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("selector", "/append-as-children/context/matcher/@matchMode", result);
View Full Code Here

    }
   
    public void testRender() throws Exception {
        AjaxAction action = new InsertContentBeforeAction("testId", Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-before/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
View Full Code Here

   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new InsertContentBeforeAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-before/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
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.