JBoss Rich Faces SVN: r12773 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2009-02-27 12:57:51 -0500 (Fri, 27 Feb 2009)
New Revision: 12773
Modified:
trunk/docs/userguide/en/src/main/docbook/included/column.xml
Log:
RF-6132 - the note has been added in the section and the example with the scrollableDataTable has been corrected
Modified: trunk/docs/userguide/en/src/main/docbook/included/column.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/column.xml 2009-02-27 16:30:04 UTC (rev 12772)
+++ trunk/docs/userguide/en/src/main/docbook/included/column.xml 2009-02-27 17:57:51 UTC (rev 12773)
@@ -274,26 +274,27 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:scrollableDataTable id="carList" value="#{dataTableScrollerBean.allCars}"
- sortMode="single" binding="#{dataTableScrollerBean.table}">
- <rich:column id="make" sortExpression="#{cap.state}">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Make"/>
- </f:facet>
- <h:outputText value="#{category.make}"/>
- </rich:column>
- <rich:column id="model">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Model"/>
- </f:facet>
- <h:outputText value="#{category.model}"/>
- </rich:column>
- <rich:column id="price">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Price"/>
- </f:facet>
- <h:outputText value="#{category.price}"/>
- </rich:column>
+<rich:scrollableDataTable id="carList"
+ value="#{dataTableScrollerBean.allCars}" sortMode="single"
+ binding="#{dataTableScrollerBean.table}">
+ <rich:column id="make" sortExpression="#{cap.make}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Make" />
+ </f:facet>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column id="model">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model" />
+ </f:facet>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column id="price">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Price" />
+ </f:facet>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
</rich:scrollableDataTable>
...]]></programlisting>
<!-- <figure>
@@ -413,13 +414,19 @@
Note that <emphasis><property>"sortPriority"</property></emphasis> attribute is defined in
the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component!
</para-->
- <para> The <emphasis>
- <property>"sortable"</property>
- </emphasis> attribute which is used with <emphasis
- role="bold">
- <property><rich:scrollableDataTable></property>
- </emphasis> component.</para>
-
+ <note>
+ <title>Note:</title>
+ <para>
+ The <emphasis><property>"sortBy"</property></emphasis> and the <emphasis><property>"selfSorted"</property></emphasis> attributes used with the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component.
+ Also the <emphasis><property>"selfSorted"</property></emphasis> can be used with the <emphasis role="bold"><property><rich:extendedDataTable></property></emphasis>.
+ </para>
+ <para> The <emphasis>
+ <property>"sortable"</property>
+ </emphasis> and the <emphasis><property>"sortExpression"</property></emphasis> attributes used with the <emphasis
+ role="bold">
+ <property><rich:scrollableDataTable></property>
+ </emphasis> component.</para>
+ </note>
</section>
<section id="filter">
15 years, 10 months
JBoss Rich Faces SVN: r12772 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-27 11:30:04 -0500 (Fri, 27 Feb 2009)
New Revision: 12772
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
RF-6122
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 14:41:15 UTC (rev 12771)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 16:30:04 UTC (rev 12772)
@@ -58,26 +58,24 @@
private final static String LINK_ID = "link";
+ private final static String RESET_METHOD = "#{formBean.reset}";
+
@Test
public void testAttrAjaxSubmit(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
// clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
test(BUTTON_ID, INNER_INPUT_ID, STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null,
null, null, "testAttrAjaxSubmit");
-
- resetTestData();
}
@Test
public void testAttrPrependId(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID, "1")))) {
assertFail(null, null, true, null, "testAttrPrependId");
}
-
- resetTestData();
}
/*
@@ -92,7 +90,7 @@
@Test
public void testProcessingLinks(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
clickById(getParentId() + LINK_ID.concat("2"));
@@ -100,8 +98,6 @@
if (!NEXT_TEXT.equals(getTextById(getParentId() + TEST_FIELD_ID.concat("2")))) {
assertFail(null, null, null, null, "testProcessingLinks");
}
-
- resetTestData();
}
@Test
@@ -153,6 +149,31 @@
assertEvent("onsubmit");
}
+ @Test
+ public void testMainFeature(Template template) {
+ renderPage(template, RESET_METHOD);
+ writeStatus("Check that a4j:form with a4j:htmlCommandLink fix the problem of h:commandLink component");
+ writeStatus("that cannot be re-rendered without re-rendering the whole form it belongs to.");
+
+ String parentId = getParentId() + "mainFeatureForm:";
+ String updateNonAjaxLinkId = parentId + "update_non_ajax_link";
+ String nonAjaxSubmit = parentId + "non_ajax_submit";
+ String resultId = parentId + "result";
+
+ writeStatus("First of all check a jsf non-ajax link works in general");
+ AssertTextEquals(resultId, "before submit");
+ clickCommandAndWait(nonAjaxSubmit);
+ AssertTextEquals(resultId, "after submit");
+
+ writeStatus("Rerender non-ajax link.");
+ clickAjaxCommandAndWait(updateNonAjaxLinkId);
+
+ writeStatus("Check that it still works");
+ AssertTextEquals(resultId, "before submit");
+ clickCommandAndWait(nonAjaxSubmit);
+ AssertTextEquals(resultId, "after submit");
+ }
+
private String getFullComponentId(String componentId, String index) {
return getParentId() + FORM_ID + index + ":" + componentId + index;
}
15 years, 10 months
JBoss Rich Faces SVN: r12771 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-27 09:41:15 -0500 (Fri, 27 Feb 2009)
New Revision: 12771
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
RF-6128
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 14:11:31 UTC (rev 12770)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 14:41:15 UTC (rev 12771)
@@ -136,6 +136,23 @@
tester.testBypassUpdate();
}
+ @Test
+ public void testStylesAndClassesAndHtmlAttributes(Template template){
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ writeStatus("Check styles and classes are output to client");
+
+ writeStatus("Check styleClass/style attributes");
+ String formId = getParentId() + AutoTester.COMPONENT_ID;
+ assertStyleAttributeContains(formId, "font-size: 13px", "Style attribute was not output to client");
+ assertClassAttributeContains(formId, "noclass", "Class attribute was not output to client");
+
+ writeStatus("Check component's specific HTML attributes are output to client");
+ clickAjaxCommandAndWait(getParentId() + AutoTester.COMPONENT_ID + ":submit");
+ assertEvent("onsubmit");
+ }
+
private String getFullComponentId(String componentId, String index) {
return getParentId() + FORM_ID + index + ":" + componentId + index;
}
15 years, 10 months
JBoss Rich Faces SVN: r12770 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/insert and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-02-27 09:11:31 -0500 (Fri, 27 Feb 2009)
New Revision: 12770
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java
Log:
RF-6309
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml 2009-02-27 14:11:31 UTC (rev 12770)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:insert id="componentId" src="/pages/insert/src.txt" rendered="#{autoTestBean.rendered}" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt 2009-02-27 14:11:31 UTC (rev 12770)
@@ -0,0 +1 @@
+some text
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java 2009-02-27 14:11:31 UTC (rev 12770)
@@ -0,0 +1,40 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class InsertTest extends SeleniumTestBase {
+
+ /**
+ * component is present on the page and value is output
+ */
+ @Test
+ public void testContent(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ Assert.assertEquals(selenium.getText("id=" + autoTester.getClientId(AutoTester.COMPONENT_ID)), "some text");
+ }
+
+ /**
+ * component with rendered = false is not present on the page
+ */
+ @Test
+ public void testRendered(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ autoTester.testRendered();
+ }
+
+ @Override
+ public String getTestUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/insert/insertAutoTest.xhtml";
+ }
+}
15 years, 10 months
JBoss Rich Faces SVN: r12769 - trunk/ui/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-02-27 08:53:38 -0500 (Fri, 27 Feb 2009)
New Revision: 12769
Modified:
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
Log:
https://jira.jboss.org/jira/browse/RF-5741. Updating attributes descriptions.
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2009-02-27 11:20:31 UTC (rev 12768)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2009-02-27 13:53:38 UTC (rev 12769)
@@ -1,4 +1,5 @@
&ui_component_attributes;
+&ui_component_attributes;
&html_universal_attributes;
<property disabled="true">
<name>header</name>
@@ -109,17 +110,17 @@
<property>
<name>sortIcon</name>
<classname>java.lang.String</classname>
- <description>Defines sort icon</description>
+ <description>Defines sort icon. The value for the attribute is context related.</description>
</property>
<property>
<name>sortIconAscending</name>
<classname>java.lang.String</classname>
- <description>Defines sort icon in ascending order</description>
+ <description>Defines sort icon for ascending order. The value for the attribute is context related.</description>
</property>
<property>
<name>sortIconDescending</name>
<classname>java.lang.String</classname>
- <description>Defines sort icon in descending order</description>
+ <description>Defines sort icon for descending order. The value for the attribute is context related.</description>
</property>
<property>
<name>label</name>
15 years, 10 months
JBoss Rich Faces SVN: r12768 - in trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld: service and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-02-27 06:20:31 -0500 (Fri, 27 Feb 2009)
New Revision: 12768
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
Log:
Realworld: add user shelfs and user album markups
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-02-27 11:20:24 UTC (rev 12767)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-02-27 11:20:31 UTC (rev 12768)
@@ -127,4 +127,9 @@
album.setParent(null);
childAlbums.remove(album);
}
+
+ public int getCountAlbums() {
+ return this.getChildAlbums() != null ? this.getChildAlbums().size() : 0;
+
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-02-27 11:20:24 UTC (rev 12767)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-02-27 11:20:31 UTC (rev 12768)
@@ -293,7 +293,12 @@
public void setShelfs(List<Shelf> shelfs) {
this.shelfs = shelfs;
}
+
+ public int getCountShelfs() {
+ return this.getShelfs() != null ? this.getShelfs().size() : 0;
+ }
+
public Sex getSex() {
return sex;
}
@@ -318,6 +323,4 @@
this.informAboutNews = informAboutNews;
}
-
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-02-27 11:20:24 UTC (rev 12767)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-02-27 11:20:31 UTC (rev 12768)
@@ -70,7 +70,7 @@
public static final String FILE_MANAGER = "fileManager";
public static final String ENTITY_MANAGER = "entityManager";
public static final String USER_ID = "userId";
- public static final int INITIAL_DELAY = 10000;
+ public static final int INITIAL_DELAY = 4000;
public static final int DELAY = 3000;
public static final String ALBUM_NODE_TYPE = "album";
public static final String USER_MANAGER = "userManager";
15 years, 10 months
JBoss Rich Faces SVN: r12767 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/navigation and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-02-27 06:20:24 -0500 (Fri, 27 Feb 2009)
New Revision: 12767
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfImagesPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfsPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imagePreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/mainImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
Log:
Realworld: add user shelfs and user album markups
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-27 10:27:25 UTC (rev 12766)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-27 11:20:24 UTC (rev 12767)
@@ -119,7 +119,7 @@
conversationState.setSelectedAlbum(null);
conversationState.setSelectedImage(null);
conversationState.setSelectedShelf(null);
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,NavigationEnum.IMAGE_PREVIEW);
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALL_SHELFS);
return true;
}
} catch (Exception nre) {
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-02-27 10:27:25 UTC (rev 12766)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-02-27 11:20:24 UTC (rev 12767)
@@ -27,8 +27,8 @@
SEARCH("includes/search.xhtml"),
WHAT_NEW("includes/recent.xhtml"),
ALBUM_PREVIEW("includes/albumPreview.xhtml"),
- SHELF_PREVIEW("includes/shelfPreview.xhtml"),
- ALL_SHELFS("includes/shelfs.xhtml"),
+ SHELF_PREVIEW("/includes/userAlbum.xhtml"),
+ ALL_SHELFS("/includes/userShelfs.xhtml"),
TAGS("includes/tags.xhtml"),
ALL_ALBUMS("includes/albums.xhtml"),
ALL_IMAGES("includes/images.xhtml");
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-27 10:27:25 UTC (rev 12766)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-27 11:20:24 UTC (rev 12767)
@@ -120,9 +120,14 @@
Integer index = getSelectedAlbum().getIndex(getSelectedImage());
System.out.println("Slideshow execute");
if(index == -1){
- Events.instance().raiseEvent("stopSlideshow");
- System.out.println("Slideshow stop");
- return;
+ if(getSelectedAlbum().getImages() != null && getSelectedAlbum().getImages().size() > 1){
+ System.out.println("Slideshow index will be index of first image");
+ index = getSelectedAlbum().getIndex(getSelectedAlbum().getImages().get(1));
+ }else{
+ Events.instance().raiseEvent("stopSlideshow");
+ System.out.println("Slideshow stop");
+ return;
+ }
}
UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER2_ID);
@@ -208,6 +213,18 @@
setSelectedShelf(album.getParent());
setSelectedUser(album.getOwner());
}
+
+ public void showAlbumFromShelf(Album album){
+ if(!album.isShared() && !album.getOwner().equals(user)){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
+ setSelectedAlbum(album);
+ setSelectedImage(null);
+ setSelectedShelf(album.getParent());
+ setSelectedUser(album.getOwner());
+ }
public void selectMyAlbums(){
setSelectedAlbum(null);
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-02-27 10:27:25 UTC (rev 12766)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-02-27 11:20:24 UTC (rev 12767)
@@ -322,4 +322,6 @@
show_history=Show message history
author=Author
linkManagement=Link management
-close=Close
\ No newline at end of file
+close=Close
+myAlbumShelfs=My album shelfs
+newPhotos=New photos
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-02-27 10:27:25 UTC (rev 12766)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-02-27 11:20:24 UTC (rev 12767)
@@ -263,4 +263,6 @@
show_history=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
author=\u0410\u0432\u0442\u043E\u0440
linkManagement=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0441\u044B\u043B\u043A\u0430\u043C\u0438
-close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
\ No newline at end of file
+close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
+myAlbumShelfs=\u041C\u043E\u0438 \u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u0438 \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
+newPhotos=\u041D\u043E\u0432\u044B\u0435 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/mainImage.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfImagesPreview.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfImagesPreview.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfsPreview.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfsPreview.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
15 years, 10 months
JBoss Rich Faces SVN: r12766 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-27 05:27:25 -0500 (Fri, 27 Feb 2009)
New Revision: 12766
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
RF-6124, RF-6125, RF-6126, RF-6127
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 10:23:36 UTC (rev 12765)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27 10:27:25 UTC (rev 12766)
@@ -17,18 +17,17 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ */
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
public class AjaxFormTest extends SeleniumTestBase {
- private final static String TEST_URL = "pages/ajaxForm/ajaxFormTest.xhtml";
-
private final static String FORM_ID = "a4j_form";
private static final String STANDART_FORM = "staticForm";
@@ -105,6 +104,38 @@
resetTestData();
}
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with rendered = false is not present on the page");
+ tester.testRendered();
+ }
+
+ @Test
+ public void testReRenderAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component re-renders another components");
+ tester.testReRender();
+ }
+
+ @Test
+ public void testLimitToListAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with limitToList = true skips ajaxRendered areas update");
+ tester.testLimitToList();
+ }
+
+ @Test
+ public void testBypassUpdatesAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with bypassUpdates = true skips update model values phase");
+ tester.testBypassUpdate();
+ }
+
private String getFullComponentId(String componentId, String index) {
return getParentId() + FORM_ID + index + ":" + componentId + index;
}
@@ -137,7 +168,7 @@
private void clickOnCheckbox(String checkId, String bottonId, String index) {
clickById(getParentId() + checkId + index);
- clickById(getParentId() + bottonId +index);
+ clickById(getParentId() + bottonId + index);
waitForAjaxCompletion();
}
@@ -145,7 +176,18 @@
clickAjaxCommandAndWait(getParentId() + "_form:reset");
}
+ @Override
+ public void sendAjax() {
+ clickAjaxCommandAndWait(getParentId() + AutoTester.COMPONENT_ID + ":submit");
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/ajaxForm/ajaxFormAutoTest.xhtml";
+ }
+
+ @Override
public String getTestUrl() {
- return TEST_URL;
+ return "pages/ajaxForm/ajaxFormTest.xhtml";
}
}
15 years, 10 months
JBoss Rich Faces SVN: r12765 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-27 05:23:36 -0500 (Fri, 27 Feb 2009)
New Revision: 12765
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/dataTable.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/modalPanel.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/simple.xhtml
Log:
a place for non-form components added
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/dataTable.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/dataTable.xhtml 2009-02-27 01:46:12 UTC (rev 12764)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/dataTable.xhtml 2009-02-27 10:23:36 UTC (rev 12765)
@@ -20,6 +20,7 @@
<br/>
<h:message id="_auto_messageId" for="componentId"></h:message>
</h:form>
+ <ui:insert name="outOfFormComponent" />
</h:panelGroup>
<h:outputText value="#{row}" rendered="#{templateBean.dataTableRowIndex != row}" />
</rich:column>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/modalPanel.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/modalPanel.xhtml 2009-02-27 01:46:12 UTC (rev 12764)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/modalPanel.xhtml 2009-02-27 10:23:36 UTC (rev 12765)
@@ -22,6 +22,7 @@
<br/>
<h:message id="_auto_messageId" for="componentId"></h:message>
</h:form>
+ <ui:insert name="outOfFormComponent" />
<ui:include src="../../layout/controlLayout.xhtml" />
</rich:modalPanel>
</ui:define>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/simple.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/simple.xhtml 2009-02-27 01:46:12 UTC (rev 12764)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/autotest/simple.xhtml 2009-02-27 10:23:36 UTC (rev 12765)
@@ -13,7 +13,8 @@
<ui:insert name="component" />
<br/>
<h:message id="_auto_messageId" for="componentId"></h:message>
- </h:form>
+ </h:form>
+ <ui:insert name="outOfFormComponent" />
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12764 - in branches/jsf2.0: framework/jsf-test and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-02-26 20:46:12 -0500 (Thu, 26 Feb 2009)
New Revision: 12764
Added:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingInitialContextFactoryBuilder.java
Modified:
branches/jsf2.0/framework/jsf-test/pom.xml
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcePath.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/ServerResourcePathTest.java
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/UrlResourceLoadingTest.java
branches/jsf2.0/framework/pom.xml
branches/jsf2.0/tests/ajax/pom.xml
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java
Log:
Fixed bug in the stagging test web application context pathnames.
Modified: branches/jsf2.0/framework/jsf-test/pom.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/pom.xml 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/pom.xml 2009-02-27 01:46:12 UTC (rev 12764)
@@ -23,7 +23,7 @@
<version>2.4</version>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -3,11 +3,13 @@
*/
package org.richfaces.test;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.EventListener;
import java.util.Locale;
+import java.util.Properties;
import java.util.logging.LogManager;
import javax.faces.FactoryFinder;
@@ -214,9 +216,31 @@
/**
* This template method called from the {@link #setUp()} to populate virtual server content.
- * The default implementation do nothing.
+ * The default implementation tries to load web content from directory pointed by the System property
+ * "webroot" or same property from the "/webapp.properties" file.
*/
protected void setupWebContent() {
+ String webappDirectory = System.getProperty("webroot");
+ File webFile = null;
+ if (null == webappDirectory) {
+ URL resource = this.getClass().getResource("/webapp.properties");
+ if (null != resource && "file".equals(resource.getProtocol())) {
+ Properties webProperties = new Properties();
+ try {
+ InputStream inputStream = resource.openStream();
+ webProperties.load(inputStream);
+ inputStream.close();
+ webFile = new File(resource.getPath());
+ webFile = new File(webFile.getParentFile(), webProperties.getProperty("webroot")).getAbsoluteFile();
+ facesServer.addResourcesFromDirectory("/", webFile);
+ } catch (IOException e) {
+ throw new TestException(e);
+ }
+ }
+ } else {
+ webFile = new File(webappDirectory);
+ facesServer.addResourcesFromDirectory("/", webFile);
+ }
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcePath.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcePath.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcePath.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -16,9 +16,9 @@
private static final Pattern SLASH = Pattern.compile("/");
- public static final ServerResourcePath WEB_INF=new ServerResourcePath("/WEB-INF");
+ public static final ServerResourcePath WEB_INF=new ServerResourcePath("/WEB-INF/");
- public static final ServerResourcePath META_INF=new ServerResourcePath("/META-INF");
+ public static final ServerResourcePath META_INF=new ServerResourcePath("/META-INF/");
public static final ServerResourcePath WEB_XML=new ServerResourcePath("/WEB-INF/web.xml");
public static final ServerResourcePath FACES_CONFIG=new ServerResourcePath("/WEB-INF/faces-config.xml");
@@ -45,7 +45,13 @@
if (!path.startsWith("/")) {
throw new IllegalArgumentException();
}
- pathElements = SLASH.split(path);
+ String[] split = SLASH.split(path);
+ if(split.length >1 && path.endsWith("/")){
+ pathElements = new String[split.length+1];
+ System.arraycopy(split, 0, pathElements, 0, split.length);
+ } else {
+ pathElements = split;
+ }
}
/**
@@ -53,17 +59,21 @@
* @return true for a last element in the path.
*/
public boolean isFile() {
- return pathElements.length <= 1;
+ return pathElements.length <= 1 || null == pathElements[1];
}
/**
* Name of the next element ( directory or file ) name.
- * For the "/foo/bar/baz" it should be "foo" , /bar/baz : "bar" , "/" : null.
+ * For the "/foo/bar/baz" it should be "foo/" , /bar/baz : "bar/" , "/" : null.
* @return name of the next element or null if it is last element in the chain ( file ).
*/
public String getNextElementName() {
if (pathElements.length > 1) {
- return pathElements[1];
+ String name = pathElements[1];
+ if(pathElements.length>2){
+ name+='/';
+ }
+ return name;
} else {
return null;
}
@@ -75,7 +85,7 @@
* @return next subdirectory path or null.
*/
public ServerResourcePath getNextPath() {
- if (pathElements.length > 1) {
+ if (pathElements.length > 1 && null != pathElements[1]) {
String[] nextElenemts = new String[pathElements.length - 1];
System.arraycopy(pathElements, 1, nextElenemts, 0, nextElenemts.length);
return new ServerResourcePath(nextElenemts);
@@ -90,7 +100,10 @@
if (pathElements.length > 1) {
for (int i = 1; i < pathElements.length; i++) {
String element = pathElements[i];
- str.append("/").append(element);
+ str.append("/");
+ if(null != element){
+ str.append(element);
+ }
}
} else {
str.append("/");
Added: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingInitialContextFactoryBuilder.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingInitialContextFactoryBuilder.java (rev 0)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingInitialContextFactoryBuilder.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -0,0 +1,249 @@
+/*
+ * $Id$
+ */
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package org.richfaces.test.staging;
+
+import java.util.Hashtable;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.spi.InitialContextFactory;
+import javax.naming.spi.InitialContextFactoryBuilder;
+
+/**
+ * <p class="changed_added_2_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class StagingInitialContextFactoryBuilder implements
+ InitialContextFactoryBuilder {
+
+ private static final class StagingInitialContext implements Context {
+ public Object addToEnvironment(String propName,
+ Object propVal) throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void bind(Name name, Object obj)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void bind(String name, Object obj)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void close() throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Name composeName(Name name, Name prefix)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String composeName(String name, String prefix)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Context createSubcontext(Name name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Context createSubcontext(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void destroySubcontext(Name name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void destroySubcontext(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Hashtable<?, ?> getEnvironment()
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getNameInNamespace() throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NameParser getNameParser(Name name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NameParser getNameParser(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NamingEnumeration<NameClassPair> list(Name name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NamingEnumeration<NameClassPair> list(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NamingEnumeration<Binding> listBindings(Name name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public NamingEnumeration<Binding> listBindings(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object lookup(Name name) throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object lookup(String name) throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object lookupLink(Name name) throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object lookupLink(String name)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void rebind(Name name, Object obj)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void rebind(String name, Object obj)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Object removeFromEnvironment(String propName)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void rename(Name oldName, Name newName)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void rename(String oldName, String newName)
+ throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void unbind(Name name) throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void unbind(String name) throws NamingException {
+ // TODO Auto-generated method stub
+
+ }
+ }
+
+ public static final class StagingInitialContextFactory implements
+ InitialContextFactory {
+ public Context getInitialContext(Hashtable<?, ?> environment)
+ throws NamingException {
+ // TODO Auto-generated method stub
+ return new StagingInitialContext();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.naming.spi.InitialContextFactoryBuilder#createInitialContextFactory(java.util.Hashtable)
+ */
+ public InitialContextFactory createInitialContextFactory(
+ Hashtable<?, ?> environment) throws NamingException {
+ return new StagingInitialContextFactory();
+ }
+
+}
Property changes on: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingInitialContextFactoryBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -20,6 +20,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import javax.naming.NamingException;
+import javax.naming.spi.NamingManager;
import javax.servlet.Filter;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
@@ -450,6 +452,9 @@
if (!directory.isDirectory()) {
directory = directory.getParentFile();
}
+ if(!directory.exists()){
+ throw new TestException("directory does not exist:"+directory.getAbsolutePath());
+ }
try {
addFiles(baseDirectory, directory);
} catch (MalformedURLException e) {
@@ -531,13 +536,15 @@
throws MalformedURLException {
File[] files = file.listFiles();
for (File subfile : files) {
- ServerResourcePath serverResourcePath = new ServerResourcePath("/"
- + subfile.getName());
if (subfile.isDirectory()) {
+ ServerResourcePath serverResourcePath = new ServerResourcePath("/"
+ + subfile.getName()+"/");
ServerResourcesDirectory subDir = new ServerResourcesDirectory();
baseDirectory.addResource(serverResourcePath, subDir);
addFiles(subDir, subfile);
} else {
+ ServerResourcePath serverResourcePath = new ServerResourcePath("/"
+ + subfile.getName());
UrlServerResource resource = new UrlServerResource(subfile
.toURL());
baseDirectory.addResource(serverResourcePath, resource);
@@ -749,6 +756,13 @@
} catch (ServletException e) {
throw new TestException("Servlet initialisation error ", e);
}
+ try {
+ NamingManager.setInitialContextFactoryBuilder(new StagingInitialContextFactoryBuilder());
+ } catch (NamingException e) {
+ log.warning("Error set initial context factory builder.");
+ } catch (IllegalStateException e) {
+ log.warning("Initial context factory builder already set.");
+ }
this.initialised = true;
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -10,6 +10,7 @@
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -175,11 +176,18 @@
*/
@SuppressWarnings("unchecked")
public Set getResourcePaths(String path) {
+ HashSet result=null;
ServerResource resource = getServerResource(path);
if(null != resource){
- return resource.getPaths();
+ Set<String> paths = resource.getPaths();
+ if(null != paths && paths.size()>0){
+ result = new HashSet(paths.size());
+ for (String resourcePath : paths) {
+ result.add(path+resourcePath);
+ }
+ }
}
- return null;
+ return result;
}
/* (non-Javadoc)
Modified: branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/ServerResourcePathTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/ServerResourcePathTest.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/ServerResourcePathTest.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -35,8 +35,8 @@
assertNotNull(path.getNextPath());
assertNotNull(path.getNextElementName());
assertFalse(path.isFile());
- assertEquals("WEB-INF", path.getNextElementName());
- assertEquals("/WEB-INF", path.toString());
+ assertEquals("WEB-INF/", path.getNextElementName());
+ assertEquals("/WEB-INF/", path.toString());
path = path.getNextPath();
assertNotNull(path);
assertTrue(path.isFile());
@@ -53,8 +53,8 @@
assertNotNull(path.getNextPath());
assertNotNull(path.getNextElementName());
assertFalse(path.isFile());
- assertEquals("WEB-INF", path.getNextElementName());
- assertEquals("/WEB-INF", path.toString());
+ assertEquals("WEB-INF/", path.getNextElementName());
+ assertEquals("/WEB-INF/", path.toString());
path = path.getNextPath();
assertNotNull(path);
assertTrue(path.isFile());
@@ -70,7 +70,7 @@
public void testWebXmlPath() {
ServerResourcePath path = ServerResourcePath.WEB_XML;
assertFalse(path.isFile());
- assertEquals("WEB-INF", path.getNextElementName());
+ assertEquals("WEB-INF/", path.getNextElementName());
assertEquals("/WEB-INF/web.xml", path.toString());
path = path.getNextPath();
assertNotNull(path.getNextElementName());
@@ -84,5 +84,11 @@
assertNull(path);
}
+ @Test
+ public void testDirPath() throws Exception {
+ ServerResourcePath path = new ServerResourcePath("/foo/bar");
+ assertEquals("foo/", path.getNextElementName());
+ assertEquals("bar", path.getNextPath().getNextElementName());
+ }
}
Modified: branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/UrlResourceLoadingTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/UrlResourceLoadingTest.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/staging/UrlResourceLoadingTest.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -42,7 +42,7 @@
URL resource = this.getClass().getClassLoader().getResource("java/util/Set.class");
assertNotNull(resource);
StagingServer server = new StagingServer();
- server.addResourcesFromDirectory("/WEB-INF/classes/java/util", resource);
+ server.addResourcesFromDirectory("/WEB-INF/classes/java/util/", resource);
try {
server.init();
assertNotNull(server.getContext().getResource("/WEB-INF/classes/java/util/Map.class"));
Modified: branches/jsf2.0/framework/pom.xml
===================================================================
--- branches/jsf2.0/framework/pom.xml 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/framework/pom.xml 2009-02-27 01:46:12 UTC (rev 12764)
@@ -92,7 +92,7 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
Modified: branches/jsf2.0/tests/ajax/pom.xml
===================================================================
--- branches/jsf2.0/tests/ajax/pom.xml 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/tests/ajax/pom.xml 2009-02-27 01:46:12 UTC (rev 12764)
@@ -63,7 +63,7 @@
</build>
<dependencies>
<dependency>
- <groupId>javax.faces</groupId>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<exclusions>
Modified: branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java
===================================================================
--- branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java 2009-02-26 23:55:44 UTC (rev 12763)
+++ branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java 2009-02-27 01:46:12 UTC (rev 12764)
@@ -5,11 +5,13 @@
import static org.junit.Assert.*;
+import java.net.URL;
import java.util.List;
import java.util.Locale;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
+import javax.faces.FactoryFinder;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
@@ -18,6 +20,7 @@
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
import javax.faces.component.html.HtmlDataTable;
+import javax.faces.context.FacesContextFactory;
import javax.faces.event.PhaseId;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
@@ -29,88 +32,139 @@
import org.richfaces.test.DataBean;
import org.richfaces.test.staging.HttpMethod;
-
/**
* @author asmirnov
- *
+ *
*/
public class UIDataTest extends AbstractFacesTest {
@Before
- public void setUpData(){
-
+ public void setUpData() {
+
}
@Override
protected void setupWebContent() {
- facesServer.addResource("/WEB-INF/faces-config.xml", "WEB-INF/faces-config.xml");
+ facesServer.addResource("/WEB-INF/faces-config.xml",
+ "WEB-INF/faces-config.xml");
facesServer.addResource("/test.xhtml", "test.xhtml");
}
@Override
protected UIViewRoot setupView() {
+ return null;
+ }
+
+ protected UIViewRoot createView() {
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
ELContext elContext = facesContext.getELContext();
- ExpressionFactory expressionFactory = application.getExpressionFactory();
+ ExpressionFactory expressionFactory = application
+ .getExpressionFactory();
UIViewRoot root = super.setupView();
- UIComponent output = application.createComponent(UIOutput.COMPONENT_TYPE);
+ UIComponent output = application
+ .createComponent(UIOutput.COMPONENT_TYPE);
output.setId(root.createUniqueId());
root.getChildren().add(output);
- UIData data = (UIData) application.createComponent(UIData.COMPONENT_TYPE);
+ UIData data = (UIData) application
+ .createComponent(UIData.COMPONENT_TYPE);
data.setId("data");
data.setVar("var");
- data.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{dataBean.data}", List.class));
+ data.setValueExpression("value", expressionFactory
+ .createValueExpression(elContext, "#{dataBean.data}",
+ List.class));
output.getChildren().add(data);
- UIComponent column = application.createComponent(UIColumn.COMPONENT_TYPE);
+ UIComponent column = application
+ .createComponent(UIColumn.COMPONENT_TYPE);
data.getChildren().add(column);
- UIData enclosedData = (UIData) application.createComponent(UIData.COMPONENT_TYPE);
+ UIData enclosedData = (UIData) application
+ .createComponent(UIData.COMPONENT_TYPE);
enclosedData.setId("data1");
enclosedData.setVar("var1");
- enclosedData.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{var.items}", List.class));
+ enclosedData.setValueExpression("value", expressionFactory
+ .createValueExpression(elContext, "#{var.items}", List.class));
column.getChildren().add(enclosedData);
- UIComponent enclosedColumn = application.createComponent(UIColumn.COMPONENT_TYPE);
+ UIComponent enclosedColumn = application
+ .createComponent(UIColumn.COMPONENT_TYPE);
enclosedData.getChildren().add(enclosedColumn);
- UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
+ UIForm form = (UIForm) application
+ .createComponent(UIForm.COMPONENT_TYPE);
form.setId("form");
enclosedColumn.getChildren().add(form);
- UIInput input = (UIInput) application.createComponent(UIInput.COMPONENT_TYPE);
+ UIInput input = (UIInput) application
+ .createComponent(UIInput.COMPONENT_TYPE);
input.setId("input");
- input.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{var1.name}", String.class));
+ input
+ .setValueExpression("value", expressionFactory
+ .createValueExpression(elContext, "#{var1.name}",
+ String.class));
form.getChildren().add(input);
- ///
+ // /
input = (UIInput) application.createComponent(UIInput.COMPONENT_TYPE);
input.setId("priceinput");
- input.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{var1.price}", Integer.class));
+ input.setValueExpression("value", expressionFactory
+ .createValueExpression(elContext, "#{var1.price}",
+ Integer.class));
enclosedColumn.getChildren().add(input);
input = (UIInput) application.createComponent(UIInput.COMPONENT_TYPE);
input.setId("nameinput");
- input.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{var.name}", String.class));
+ input.setValueExpression("value", expressionFactory
+ .createValueExpression(elContext, "#{var.name}", String.class));
column.getChildren().add(input);
return root;
}
-
+
@Override
protected void setupConnection() {
- this.connection.addRequestParameter(ResponseStateManager.VIEW_STATE_PARAM, "id1");
+ this.connection.addRequestParameter(
+ ResponseStateManager.VIEW_STATE_PARAM, "j_id1:j_id2");
this.connection.addRequestParameter("data:3:nameinput", "foo");
this.connection.addRequestParameter("data:5:data1:4:priceinput", "333");
- this.connection.addRequestParameter("data:6:data1:5:form", "data:6:data1:5:form");
+ this.connection.addRequestParameter("data:6:data1:5:form",
+ "data:6:data1:5:form");
this.connection.addRequestParameter("data:6:data1:5:form:input", "bar");
connection.setRequestMethod(HttpMethod.POST);
}
-
+
@Test
public void testDecode() throws Exception {
setupFacesRequest();
+ facesContext.setViewRoot(createView());
long startTime = System.currentTimeMillis();
lifecycle.execute(facesContext);
- System.err.println("Execute time "+(System.currentTimeMillis()-startTime)+"ms");
+ System.err.println("Execute time "
+ + (System.currentTimeMillis() - startTime) + "ms");
lifecycle.render(facesContext);
- DataBean dataBean = (DataBean) this.facesServer.getSession().getAttribute("dataBean");
+ DataBean dataBean = (DataBean) this.facesServer.getSession()
+ .getAttribute("dataBean");
assertNotNull(dataBean);
assertEquals("foo", dataBean.getData().get(3).getName());
- assertEquals(333, dataBean.getData().get(5).getItems().get(4).getPrice());
- assertEquals("bar", dataBean.getData().get(6).getItems().get(5).getName());
+ assertEquals(333, dataBean.getData().get(5).getItems().get(4)
+ .getPrice());
+ assertEquals("bar", dataBean.getData().get(6).getItems().get(5)
+ .getName());
}
-
+
+ @Test
+ public void testCycleRequest() throws Exception {
+ setupFacesRequest();
+ facesContext.setViewRoot(createView());
+ lifecycle.execute(facesContext);
+ lifecycle.render(facesContext);
+ facesContext.release();
+ facesContext = null;
+ connection.finish();
+ this.facesServer.getSession().removeAttribute("dataBean");
+ setupFacesRequest();
+ lifecycle.execute(facesContext);
+ assertTrue(facesContext.getViewRoot().getChildCount()>0);
+ DataBean dataBean = (DataBean) this.facesServer.getSession()
+ .getAttribute("dataBean");
+ assertNotNull(dataBean);
+ assertEquals("foo", dataBean.getData().get(3).getName());
+ assertEquals(333, dataBean.getData().get(5).getItems().get(4)
+ .getPrice());
+ assertEquals("bar", dataBean.getData().get(6).getItems().get(5)
+ .getName());
+ }
+
}
15 years, 10 months