Package org.jboss.seam.faces

Examples of org.jboss.seam.faces.Switcher


        throws Exception
    {
        new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 0;
                assert switcher.getConversationIdOrOutcome() == null;
            }
        }.run();
       
       
        final String conv1 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
            }
        }.run();
       
        final String conv2 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 2;
            }
        }.run();
       
        final String conv3 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 3;
            }
        }.run();
   
        new FacesRequest() {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 3;
               
                List<SelectItem> items = switcher.getSelectItems();
                List<String> values = new ArrayList<String>();
                for (SelectItem item: items) {
                    assert item.getLabel().equals("page description");
                    values.add((String) item.getValue());
                }
               
                assert values.contains(conv1);
                assert values.contains(conv2);
                assert values.contains(conv3);
            }
        }.run();
       
        new FacesRequest("/pageWithDescription.xhtml", conv1) {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().endConversation(true);
            }
        }.run();
       
        new FacesRequest("/pageWithDescription.xhtml", conv2) {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().endConversation(true);
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
                assert switcher.getSelectItems().get(0).getLabel().equals("page description");
                assert switcher.getSelectItems().get(0).getValue().equals(conv3);
            }
        }.run();
       
        new FacesRequest("/pageWithAnotherDescription.xhtml", conv3) {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
               
                assert switcher.getSelectItems().get(0).getLabel().equals("another page description");
                assert switcher.getSelectItems().get(0).getValue().equals(conv3);
            }
        }.run();
    }
View Full Code Here


        throws Exception
    {
        new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 0;
                assert switcher.getConversationIdOrOutcome() == null;
            }
        }.run();
       
       
        final String conv1 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
            }
        }.run();
       
        final String conv2 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 2;
            }
        }.run();
       
        final String conv3 = new FacesRequest("/pageWithDescription.xhtml") {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().beginConversation();
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 3;
            }
        }.run();
   
        new FacesRequest() {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 3;
               
                List<SelectItem> items = switcher.getSelectItems();
                List<String> values = new ArrayList<String>();
                for (SelectItem item: items) {
                    assert item.getLabel().equals("page description");
                    values.add((String) item.getValue());
                }
               
                assert values.contains(conv1);
                assert values.contains(conv2);
                assert values.contains(conv3);
            }
        }.run();
       
        new FacesRequest("/pageWithDescription.xhtml", conv1) {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().endConversation(true);
            }
        }.run();
       
        new FacesRequest("/pageWithDescription.xhtml", conv2) {
            @Override
            protected void invokeApplication() throws Exception {
                Manager.instance().endConversation(true);
            }
           
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
                assert switcher.getSelectItems().get(0).getLabel().equals("page description");
                assert switcher.getSelectItems().get(0).getValue().equals(conv3);
            }
        }.run();
       
        new FacesRequest("/pageWithAnotherDescription.xhtml", conv3) {
            @Override
            protected void renderResponse() throws Exception {
                Switcher switcher = (Switcher) getValue("#{switcher}");
                assert switcher.getSelectItems().size() == 1;
               
                assert switcher.getSelectItems().get(0).getLabel().equals("another page description");
                assert switcher.getSelectItems().get(0).getValue().equals(conv3);
            }
        }.run();
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.faces.Switcher

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.