You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/02/11 16:02:43 UTC
svn commit: r743355 [1/2] - in /myfaces/core/branches/2_0_0: ./ api/
api/src/main/java/javax/faces/component/
api/src/main/javascript/META-INF/resources/javax/faces/_util/
api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/
assembly...
Author: lu4242
Date: Wed Feb 11 15:02:41 2009
New Revision: 743355
URL: http://svn.apache.org/viewvc?rev=743355&view=rev
Log:
MYFACES-2134 (merging all changes in trunk 1.2.x from revision 698037 to 743106)
Added:
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormRendererTest.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/test/utils/
- copied from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/test/utils/
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/test/utils/HtmlRenderedAttr.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/test/utils/HtmlRenderedAttr.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/test/utils/MockTestViewHandler.java
- copied unchanged from r743106, myfaces/core/trunk_1.2.x/impl/src/test/java/org/apache/myfaces/test/utils/MockTestViewHandler.java
Modified:
myfaces/core/branches/2_0_0/ (props changed)
myfaces/core/branches/2_0_0/api/pom.xml
myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIColumn.java
myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UICommand.java
myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIComponentBase.java
myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIInput.java
myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/OpenAjax.js (props changed)
myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrRequestQueue.js (props changed)
myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequest.js (props changed)
myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequestEvent.js (props changed)
myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrinidadFrameworkAdapter.js (props changed)
myfaces/core/branches/2_0_0/assembly/pom.xml
myfaces/core/branches/2_0_0/build/pom.xml
myfaces/core/branches/2_0_0/impl/pom.xml
myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_core12.vm
myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_html12.vm
myfaces/core/branches/2_0_0/impl/src/main/resources/javax/faces/Messages_fr.properties
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGridRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGroupRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlImageRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlListboxRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMenuRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlSecretRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTableRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextRendererTest.java
myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextareaRendererTest.java
myfaces/core/branches/2_0_0/pom.xml
Propchange: myfaces/core/branches/2_0_0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -1 +1 @@
-/myfaces/core/trunk_1.2.x:691297-695050
+/myfaces/core/trunk_1.2.x:691297-695050,698037-743106
Modified: myfaces/core/branches/2_0_0/api/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/pom.xml?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/pom.xml (original)
+++ myfaces/core/branches/2_0_0/api/pom.xml Wed Feb 11 15:02:41 2009
@@ -126,34 +126,31 @@
</dependencies>
</plugin>
-->
- <plugin>
- <groupId>org.apache.myfaces.buildtools</groupId>
- <artifactId>myfaces-builder-plugin</artifactId>
- <version>1.0.2</version>
- <executions>
- <execution>
- <goals>
- <goal>build-metadata</goal>
- </goals>
- </execution>
- <execution>
- <id>makecomp</id>
- <configuration>
- <jsfVersion>12</jsfVersion>
- </configuration>
- <goals>
- <goal>make-components</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
-
-
- </plugins>
- </build>
- <profiles>
- <profile>
+ <plugin>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build-metadata</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makecomp</id>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ </configuration>
+ <goals>
+ <goal>make-components</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
<!--
- Generate files that are good to have when doing a release to main
- repositories, but which are not wanted when doing a quick
@@ -253,111 +250,111 @@
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<!-- version defined in parent -->
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <artifactId>jsp-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.buildtools</groupId>
- <artifactId>myfaces-builder-annotations</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- <version>5.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.shale</groupId>
- <artifactId>shale-test</artifactId>
- <version>1.0.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- <version>1.2.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock-cglib</artifactId>
- <version>1.2.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.3</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- <plugin>
- <artifactId>maven-changelog-plugin</artifactId>
- <version>2.1</version>
- <reportSets>
- <reportSet>
- <id>dual-report</id>
- <configuration>
- <type>range</type>
- <range>30</range>
- </configuration>
- <reports>
- <report>changelog</report>
- <report>file-activity</report>
- <report>dev-activity</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.2</version>
- </plugin>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>jsp-api</artifactId>
+ <groupId>javax.servlet</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-annotations</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>5.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shale</groupId>
+ <artifactId>shale-test</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <version>1.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock-cglib</artifactId>
+ <version>1.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-changelog-plugin</artifactId>
+ <version>2.1</version>
+ <reportSets>
+ <reportSet>
+ <id>dual-report</id>
+ <configuration>
+ <type>range</type>
+ <range>30</range>
+ </configuration>
+ <reports>
+ <report>changelog</report>
+ <report>file-activity</report>
+ <report>dev-activity</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
<!-- override PMD settings to set targetJdk -->
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIColumn.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIColumn.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIColumn.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIColumn.java Wed Feb 11 15:02:41 2009
@@ -20,7 +20,7 @@
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFacet;
-
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
/**
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*
@@ -55,7 +55,18 @@
return getFacet(HEADER_FACET_NAME);
}
- // ------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+ /**
+ * Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer
+ * component. The id is not necessarily unique across all components in the current view.
+ */
+ @JSFProperty(literalOnly=true, rtexprvalue=false)
+ @Override
+ public String getId()
+ {
+ return super.getId();
+ }
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
public static final String COMPONENT_TYPE = "javax.faces.Column";
public static final String COMPONENT_FAMILY = "javax.faces.Column";
Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UICommand.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UICommand.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UICommand.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UICommand.java Wed Feb 11 15:02:41 2009
@@ -88,7 +88,6 @@
*
* @deprecated Use getActionExpression() instead.
*/
- @Deprecated
public MethodBinding getAction()
{
MethodExpression actionExpression = getActionExpression();
@@ -107,7 +106,6 @@
/**
* @deprecated Use setActionExpression instead.
*/
- @Deprecated
public void setAction(MethodBinding action)
{
if (action != null)
@@ -259,7 +257,6 @@
*
* @deprecated
*/
- @Deprecated
@JSFProperty(stateHolder = true, returnSignature = "void", methodSignature = "javax.faces.event.ActionEvent")
public MethodBinding getActionListener()
{
@@ -276,7 +273,9 @@
return null;
}
- @Deprecated
+ /**
+ * @deprecated
+ */
@JSFProperty(returnSignature="void",methodSignature="javax.faces.event.ActionEvent")
public void setActionListener(MethodBinding actionListener)
{
Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIComponentBase.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIComponentBase.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIComponentBase.java Wed Feb 11 15:02:41 2009
@@ -260,8 +260,8 @@
* Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer
* component. The id is not necessarily unique across all components in the current view.
*/
- @Override
- @JSFProperty(literalOnly = true)
+ @JSFProperty
+ (rtexprvalue = true)
public String getId()
{
return _id;
Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIInput.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIInput.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/component/UIInput.java Wed Feb 11 15:02:41 2009
@@ -622,8 +622,10 @@
return null;
}
- /** See getValidator. */
- @Deprecated
+ /** See getValidator.
+ *
+ * @deprecated
+ */
public void setValidator(MethodBinding validator)
{
this._validator = validator;
@@ -696,7 +698,6 @@
*
* @deprecated
*/
- @Deprecated
@JSFProperty(stateHolder = true, returnSignature = "void", methodSignature = "javax.faces.event.ValueChangeEvent")
public MethodBinding getValueChangeListener()
{
@@ -717,7 +718,6 @@
*
* @deprecated
*/
- @Deprecated
public void setValueChangeListener(MethodBinding valueChangeListener)
{
this._valueChangeListener = valueChangeListener;
Propchange: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/OpenAjax.js
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -0,0 +1 @@
+/myfaces/core/trunk_1.2.x/api/src/main/javascript/META-INF/resources/javax/faces/_util/OpenAjax.js:698037-743106
Propchange: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrRequestQueue.js
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -0,0 +1 @@
+/myfaces/core/trunk_1.2.x/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrRequestQueue.js:698037-743106
Propchange: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequest.js
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -0,0 +1 @@
+/myfaces/core/trunk_1.2.x/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequest.js:698037-743106
Propchange: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequestEvent.js
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -0,0 +1 @@
+/myfaces/core/trunk_1.2.x/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrXmlRequestEvent.js:698037-743106
Propchange: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrinidadFrameworkAdapter.js
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 15:02:41 2009
@@ -0,0 +1 @@
+/myfaces/core/trunk_1.2.x/api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/_TrinidadFrameworkAdapter.js:698037-743106
Modified: myfaces/core/branches/2_0_0/assembly/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/assembly/pom.xml?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/assembly/pom.xml (original)
+++ myfaces/core/branches/2_0_0/assembly/pom.xml Wed Feb 11 15:02:41 2009
@@ -39,13 +39,13 @@
<artifactItem>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
<classifier>javadoc</classifier>
</artifactItem>
<artifactItem>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
<classifier>javadoc</classifier>
</artifactItem>
<!--
@@ -73,7 +73,7 @@
<artifactItem>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
<classifier>tlddoc</classifier>
</artifactItem>
@@ -92,13 +92,13 @@
<artifactItem>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
<classifier>sources</classifier>
</artifactItem>
<artifactItem>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
@@ -118,7 +118,7 @@
<descriptors>
<descriptor>src/main/assembly/coresrc.xml</descriptor>
</descriptors>
- <finalName>myfaces-core-${version}-src</finalName>
+ <finalName>myfaces-core-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>target/assembly/out</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
@@ -134,7 +134,7 @@
<descriptors>
<descriptor>${basedir}/src/main/assembly/corebin.xml</descriptor>
</descriptors>
- <finalName>myfaces-core-${version}-bin</finalName>
+ <finalName>myfaces-core-${project.version}-bin</finalName>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>target/assembly/out</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
@@ -167,13 +167,13 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
Modified: myfaces/core/branches/2_0_0/build/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/build/pom.xml?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/build/pom.xml (original)
+++ myfaces/core/branches/2_0_0/build/pom.xml Wed Feb 11 15:02:41 2009
@@ -84,4 +84,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: myfaces/core/branches/2_0_0/impl/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/pom.xml?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/pom.xml (original)
+++ myfaces/core/branches/2_0_0/impl/pom.xml Wed Feb 11 15:02:41 2009
@@ -40,9 +40,10 @@
<id>makemyfacesmetadata</id>
<configuration>
<!-- Qdox 1.6.3 does not parse inner enums on classes
- so we have to exclude some files temporally. -->
- <includes>**/*.java,/**/*.java</includes>
- <excludes>**/FacesCompositeELResolver.java,/**/FacesCompositeELResolver.java</excludes>
+ so we have to exclude some files temporally.
+ Added linux case (paths start with /) to filter temporally too-->
+ <includes>/**/*.java,**/*.java</includes>
+ <excludes>/**/FacesCompositeELResolver.java,**/FacesCompositeELResolver.java</excludes>
</configuration>
<goals>
<goal>build-metadata</goal>
@@ -180,81 +181,117 @@
</executions>
</plugin>
-->
- <plugin>
- <!--
- - The shared-impl project generates a modified version of the "shared" module
- - source and classes. The result is a jar full of files in the "shared_impl"
- - package that we can merge into the jar for this project.
- -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>dependency-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>unpack-shared-impl</id>
- <phase>process-classes</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.myfaces.shared</groupId>
- <artifactId>myfaces-shared-impl</artifactId>
- <version>${myfaces-shared.version}</version>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>unpack-shared-impl-sources</id>
- <phase>process-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.myfaces.shared</groupId>
- <artifactId>myfaces-shared-impl</artifactId>
- <version>${myfaces-shared.version}</version>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/shared_sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <!--
- - Add the unpacked shared sources directory as source directory into the pom datastructure,
- - so that the -source jar includes them too; every .class file in the jar should have its
- - source in the -source jar.
- -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>process-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/shared_sources</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<profiles>
<profile>
+ <!-- This profile use a shared dependency rather than unpack the
+ code directly. The ideal is that this profile is active when the
+ version of this library is snapshot, but unfortunately there is
+ no way to activate it (see http://jira.codehaus.org/browse/MNG-3826).
+ Existing problems on maven 2.0.x architecture makes impossible do it.
+ For now the solution is trigger it manually using the property
+ -Ddev=true -->
+ <id>add-shared-dependency</id>
+ <activation>
+ <property>
+ <name>dev</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-impl</artifactId>
+ <version>${myfaces-shared.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>unpack-shared</id>
+ <activation>
+ <property>
+ <name>!dev</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <!--
+ - The shared-impl project generates a modified version of the "shared" module
+ - source and classes. The result is a jar full of files in the "shared_impl"
+ - package that we can merge into the jar for this project.
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>dependency-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>unpack-shared-impl</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-impl</artifactId>
+ <version>${myfaces-shared.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-shared-impl-sources</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-impl</artifactId>
+ <version>${myfaces-shared.version}</version>
+ <classifier>sources</classifier>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/shared_sources</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--
+ - Add the unpacked shared sources directory as source directory into the pom datastructure,
+ - so that the -source jar includes them too; every .class file in the jar should have its
+ - source in the -source jar.
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/shared_sources</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<!--
- Whenever the full website is generated, the command
- mvn -Pgenerate-site site
@@ -554,6 +591,6 @@
</repositories>
<properties>
- <myfaces-shared.version>3.0.5-SNAPSHOT</myfaces-shared.version>
+ <myfaces-shared.version>3.0.5</myfaces-shared.version>
</properties>
</project>
Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java Wed Feb 11 15:02:41 2009
@@ -260,6 +260,12 @@
catch (NoSuchMethodException e)
{
log.error("Configuration objects do not support clean-up. Update aborted");
+
+ // We still want to update the timestamp to avoid running purge on every subsequent
+ // request after this one.
+ //
+ lastUpdate = System.currentTimeMillis();
+
return;
}
catch (IllegalAccessException e)
@@ -277,21 +283,30 @@
private void purgeConfiguration() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
{
- Method purgeMethod;
-
+ final Class<?>[] NO_PARAMETER_TYPES = new Class[]{};
+ final Object[] NO_PARAMETERS = new Object[]{};
+
+ Method appFactoryPurgeMethod;
+ Method renderKitPurgeMethod;
+ Method lifecyclePurgeMethod;
+
+ // Check that we have access to all of the necessary purge methods before purging anything
+ //
ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
- purgeMethod = applicationFactory.getClass().getMethod("purgeApplication", (Class<?>[])null);
- purgeMethod.invoke(applicationFactory, (Object[])null);
+ appFactoryPurgeMethod = applicationFactory.getClass().getMethod("purgeApplication", NO_PARAMETER_TYPES);
RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
- purgeMethod = renderKitFactory.getClass().getMethod("purgeRenderKit", (Class<?>[])null);
- purgeMethod.invoke(renderKitFactory, (Object[])null);
+ renderKitPurgeMethod = renderKitFactory.getClass().getMethod("purgeRenderKit", NO_PARAMETER_TYPES);
+
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ lifecyclePurgeMethod = lifecycleFactory.getClass().getMethod("purgeLifecycle", NO_PARAMETER_TYPES);
+ // If there was no exception so far, now we can purge
+ //
+ appFactoryPurgeMethod.invoke(applicationFactory, NO_PARAMETERS);
+ renderKitPurgeMethod.invoke(renderKitFactory, NO_PARAMETERS);
RuntimeConfig.getCurrentInstance(_externalContext).purge();
-
- LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
- purgeMethod = lifecycleFactory.getClass().getMethod("purgeLifecycle", (Class<?>[])null);
- purgeMethod.invoke(lifecycleFactory, (Object[])null);
+ lifecyclePurgeMethod.invoke(lifecycleFactory, NO_PARAMETERS);
// factories and serial factory need not be purged...
}
@@ -534,19 +549,22 @@
for (Map.Entry<String, URL> entry : facesConfigs.entrySet())
{
- InputStream stream = openStreamWithoutCache(entry.getValue());
+ InputStream stream = null;
try
{
+ stream = openStreamWithoutCache(entry.getValue());
if (log.isInfoEnabled())
{
log.info("Reading config : " + entry.getKey());
}
-
getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey()));
}
finally
{
- stream.close();
+ if (stream != null)
+ {
+ stream.close();
+ }
}
}
}
@@ -571,14 +589,12 @@
{
log.info("Reading config " + systemId);
}
-
getDispenser().feed(getUnmarshaller().getFacesConfig(stream, systemId));
stream.close();
}
}
- private List<String> getConfigFilesList()
- {
+ private List<String> getConfigFilesList() {
String configFiles = _externalContext.getInitParameter(FacesServlet.CONFIG_FILES_ATTR);
List<String> configFilesList = new ArrayList<String>();
if (configFiles != null)
Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java Wed Feb 11 15:02:41 2009
@@ -124,11 +124,13 @@
{
if (converter.getConverterId() != null)
{
- converterById.put(converter.getConverterId(), converter.getConverterClass());
+ converterById.put(converter.getConverterId(),converter
+ .getConverterClass());
}
else
{
- converterByClass.put(converter.getForClass(), converter.getConverterClass());
+ converterByClass.put(converter.getForClass(),converter
+ .getConverterClass());
}
converterConfigurationByClassName.put(converter.getConverterClass(), converter);
Modified: myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_core12.vm
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_core12.vm?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_core12.vm (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_core12.vm Wed Feb 11 15:02:41 2009
@@ -77,6 +77,7 @@
#elseif ($property.isLiteralOnly())
<rtexprvalue>false</rtexprvalue>
#else
+#if ( "$!property.isRtexprvalue()" == "")
#set ($type = $utils.getClassFromFullClass($property.className))
#if ($type == "String")
<deferred-value></deferred-value>
@@ -89,6 +90,9 @@
<type>$property.className</type>
</deferred-value>
#end
+#else
+ <rtexprvalue>$property.isRtexprvalue().booleanValue()</rtexprvalue>
+#end
#end
</attribute>
#end
Modified: myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_html12.vm
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_html12.vm?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_html12.vm (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/resources/META-INF/myfaces_html12.vm Wed Feb 11 15:02:41 2009
@@ -77,6 +77,7 @@
#elseif ($property.isLiteralOnly())
<rtexprvalue>false</rtexprvalue>
#else
+#if ( "$!property.isRtexprvalue()" == "")
#set ($type = $utils.getClassFromFullClass($property.className))
#if ($type == "String")
<deferred-value></deferred-value>
@@ -85,6 +86,9 @@
<type>$property.className</type>
</deferred-value>
#end
+#else
+ <rtexprvalue>$property.isRtexprvalue().booleanValue()</rtexprvalue>
+#end
#end
</attribute>
#end
Modified: myfaces/core/branches/2_0_0/impl/src/main/resources/javax/faces/Messages_fr.properties
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/resources/javax/faces/Messages_fr.properties?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/resources/javax/faces/Messages_fr.properties (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/resources/javax/faces/Messages_fr.properties Wed Feb 11 15:02:41 2009
@@ -48,7 +48,7 @@
javax.faces.validator.LengthValidator.MAXIMUM_detail = "{1}": La donn\u00e9e a plus que les {0} caract\u00e9res maximum authoris\u00e9s.
javax.faces.validator.LengthValidator.MINIMUM = Erreur de Validation
-javax.faces.validator.LengthValidator.MINIMUM_detail = "{1}": La donn\u00e9e a moins que les {0} caract\u00e9res maximum requis.
+javax.faces.validator.LengthValidator.MINIMUM_detail = "{1}": La donn\u00e9e doit comporter au moins {0} caract\u00e9res.
javax.faces.validator.LongRangeValidator.LIMIT = Erreur de Validation
javax.faces.validator.LongRangeValidator.LIMIT_detail = La donn\u00e9e ne peut \u00e9tre convertie dans le bon type.
@@ -57,7 +57,7 @@
javax.faces.validator.LongRangeValidator.MAXIMUM_detail = "{1}": La donn\u00e9e est sup\u00e9rieur au maximum authoris\u00e9 de ''{0}''.
javax.faces.validator.LongRangeValidator.MINIMUM = Erreur de Validation
-javax.faces.validator.LongRangeValidator.MINIMUM_detail = "{1}": La donn\u00e9e est inf\u00e9rieur au maximum authoris\u00e9 de ''{0}''.
+javax.faces.validator.LongRangeValidator.MINIMUM_detail = "{1}": La donn\u00e9e est inf\u00e9rieur au minimum authoris\u00e9 de ''{0}''.
javax.faces.validator.LongRangeValidator.TYPE = Erreur de Validation
javax.faces.validator.LongRangeValidator.TYPE_detail = "{0}": La donn\u00e9e n''est pas du bon type.
@@ -124,4 +124,4 @@
org.apache.myfaces.ticker.NOCONNECTION_detail = Peut-\u00eatre \u00eates-vous derri\u00e8re un firewall
org.apache.myfaces.ISBN.INVALID = Erreur de Validation
-org.apache.myfaces.ISBN.INVALID_detail = La valeur saisie ({0}) n''est pas une code ISBN correct.
\ No newline at end of file
+org.apache.myfaces.ISBN.INVALID_detail = La valeur saisie ({0}) n''est pas une code ISBN correct.
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,31 +1,37 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.myfaces.renderkit.html;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
-import javax.faces.component.UISelectItems;
+import javax.faces.component.UISelectItem;
import javax.faces.component.html.HtmlSelectBooleanCheckbox;
import javax.faces.component.html.HtmlSelectManyCheckbox;
-import javax.faces.model.SelectItem;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -41,8 +47,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlCheckboxRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -64,114 +74,70 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
selectManyCheckbox = null;
+ selectBooleanCheckbox = null;
writer = null;
}
- public void testSelectManyDefault() throws Exception
- {
- List<SelectItem> items = new ArrayList<SelectItem>();
- items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
-
- UISelectItems selectItems = new UISelectItems();
- selectItems.setValue(items);
-
- selectManyCheckbox.getChildren().add(selectItems);
-
- selectManyCheckbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"checkbox\" name=\"j_id0\" value=\"mars\"/><label for=\"j_id0:0\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"checkbox\" name=\"j_id0\" value=\"jupiter\"/><label for=\"j_id0:1\"> jupiter</label></td>" +
- "</tr></table>", output);
- }
-
- public void testSelectManySelectItemWithoutValue() throws Exception
- {
- List<SelectItem> items = new ArrayList<SelectItem>();
- items.add(new SelectItem(null, "mars"));
- items.add(new SelectItem(null, "jupiter"));
-
- UISelectItems selectItems = new UISelectItems();
- selectItems.setValue(items);
-
- selectManyCheckbox.getChildren().add(selectItems);
-
- selectManyCheckbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"checkbox\" name=\"j_id0\"/><label for=\"j_id0:0\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"checkbox\" name=\"j_id0\"/><label for=\"j_id0:1\"> jupiter</label></td>" +
- "</tr></table>", output);
- }
-
- public void testSelectManyDisabledEnabledClass() throws Exception
- {
- List<SelectItem> items = new ArrayList<SelectItem>();
- SelectItem disabledItem = new SelectItem("mars", "mars");
- disabledItem.setDisabled(true);
-
- items.add(disabledItem);
- items.add(new SelectItem("jupiter", "jupiter"));
-
- UISelectItems selectItems = new UISelectItems();
- selectItems.setValue(items);
-
- selectManyCheckbox.getChildren().add(selectItems);
-
- selectManyCheckbox.setEnabledClass("enabledClass");
- selectManyCheckbox.setDisabledClass("disabledClass");
-
- selectManyCheckbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"checkbox\" name=\"j_id0\" disabled=\"disabled\" value=\"mars\"/><label for=\"j_id0:0\" class=\"disabledClass\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"checkbox\" name=\"j_id0\" value=\"jupiter\"/><label for=\"j_id0:1\" class=\"enabledClass\"> jupiter</label></td>" +
- "</tr></table>", output);
- }
-
- public void testSelectManyStylePassthru() throws Exception
+ public void testSelectManyHtmlPropertyPassTru() throws Exception
{
- List<SelectItem> items = new ArrayList<SelectItem>();
- items.add(new SelectItem(null, "mars"));
- items.add(new SelectItem(null, "jupiter"));
-
- UISelectItems selectItems = new UISelectItems();
- selectItems.setValue(items);
-
- selectManyCheckbox.getChildren().add(selectItems);
-
- selectManyCheckbox.setStyle("color: red");
-
- selectManyCheckbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table style=\"color: red\"><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"checkbox\" name=\"j_id0\"/><label for=\"j_id0:0\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"checkbox\" name=\"j_id0\"/><label for=\"j_id0:1\"> jupiter</label></td>" +
- "</tr></table>", output);
- }
-
- public void testSelectBooleanStylePassthru() throws Exception
- {
- selectBooleanCheckbox.setValue(true);
- selectBooleanCheckbox.setStyle("color: red;");
-
- selectBooleanCheckbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<input type=\"checkbox\" name=\"j_id0\" checked=\"checked\" value=\"true\" style=\"color: red;\"/>", output);
- }
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange"),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style", 1),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 1),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ UISelectItem item = new UISelectItem();
+ item.setItemLabel("mars");
+ item.setItemValue("mars");
+ selectManyCheckbox.getChildren().add(item);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectManyCheckbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testSelectBooleanHtmlPropertyPasstru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ selectBooleanCheckbox.setSelected(true);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectBooleanCheckbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+
+ }
}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGridRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGridRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGridRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGridRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,13 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.myfaces.renderkit.html;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
import javax.faces.component.UIColumn;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
-import java.io.StringWriter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author: baranda $)
@@ -26,8 +50,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlGridRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -49,7 +77,7 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
panelGrid = null;
@@ -71,7 +99,9 @@
panelGrid.getChildren().add(col1);
panelGrid.getChildren().add(col2);
- panelGrid.encodeAll(facesContext);
+ panelGrid.encodeBegin(facesContext);
+ panelGrid.encodeChildren(facesContext);
+ panelGrid.encodeEnd(facesContext);
facesContext.renderResponse();
String output = writer.getWriter().toString();
@@ -80,37 +110,25 @@
"</tbody></table>", output);
}
- public void testRenderTableWithCaption() throws Exception
- {
- HtmlOutputText captionText = new HtmlOutputText();
- captionText.setValue("captionText");
-
- panelGrid.getFacets().put("caption", captionText);
- panelGrid.setCaptionClass("captionClass");
- panelGrid.setCaptionStyle("captionStyle");
-
- UIColumn col1 = new UIColumn();
- HtmlOutputText col1Text = new HtmlOutputText();
- col1Text.setValue("col1Text");
-
- UIColumn col2 = new UIColumn();
- HtmlOutputText col2Text = new HtmlOutputText();
- col2Text.setValue("col2Text");
-
- col1.getChildren().add(col1Text);
- col2.getChildren().add(col2Text);
- panelGrid.getChildren().add(col1);
- panelGrid.getChildren().add(col2);
-
- panelGrid.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table>" + LINE_SEPARATOR +
- "<caption class=\"captionClass\" style=\"captionStyle\">captionText</caption><tbody><tr><td>col1Text</td></tr>" + LINE_SEPARATOR +
- "<tr><td>col2Text</td></tr>" + LINE_SEPARATOR +
- "</tbody></table>", output);
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGrid, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-
-}
\ No newline at end of file
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGrid, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGroupRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGroupRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGroupRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlGroupRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,27 +1,36 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.myfaces.renderkit.html;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGroup;
-import java.io.StringWriter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -30,7 +39,6 @@
public class HtmlGroupRendererTest extends AbstractJsfTestCase
{
private static String PANEL_CHILD_TEXT = "PANEL";
- private static String STYLE_CLASS = "myStyleClass";
private MockResponseWriter writer ;
private HtmlPanelGroup panelGroup;
@@ -39,8 +47,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlGroupRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -65,37 +77,31 @@
}
- protected void tearDown() throws Exception
+ public void tearDown()throws Exception
{
super.tearDown();
writer = null;
}
-
- public void testLayout_Default() throws Exception
- {
- assertNull(panelGroup.getLayout());
-
- panelGroup.setStyleClass(STYLE_CLASS);
-
- panelGroup.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals("<span class=\""+STYLE_CLASS+"\">PANEL</span>", output);
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
- public void testLayout_Block() throws Exception
- {
- panelGroup.setLayout("block");
-
- panelGroup.setStyleClass(STYLE_CLASS);
-
- panelGroup.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals("<div class=\""+STYLE_CLASS+"\">PANEL</div>", output);
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlImageRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlImageRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlImageRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlImageRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,12 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.myfaces.renderkit.html;
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlGraphicImage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
-import javax.faces.component.html.HtmlGraphicImage;
-import java.io.StringWriter;
-
/**
* @author Bruno Aranda (latest modification by $Author: baranda $)
* @version $Revision: 451814 $ $Date: 2006-10-01 22:28:42 +0100 (dom, 01 oct 2006) $
@@ -15,13 +39,17 @@
{
private MockResponseWriter writer ;
private HtmlGraphicImage graphicImage;
-
+
public HtmlImageRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlImageRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -38,7 +66,7 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
graphicImage = null;
@@ -47,24 +75,45 @@
public void testRenderDefault() throws Exception
{
+ String imgUrl = "http://www.apache.org/images/feather.gif";
+ String src = facesContext.getApplication().getViewHandler().getResourceURL(facesContext, imgUrl);
+
graphicImage.setId("img1");
- graphicImage.setValue("http://myfaces.apache.org");
- graphicImage.encodeAll(facesContext);
+ graphicImage.setValue(imgUrl);
+ graphicImage.encodeBegin(facesContext);
+ graphicImage.encodeChildren(facesContext);
+ graphicImage.encodeEnd(facesContext);
facesContext.renderResponse();
String output = writer.getWriter().toString();
- assertEquals("<img id=\"img1\" src=\"nullhttp://myfaces.apache.org\"/>", output);
+ assertEquals("<img id=\"img1\" src=\"" + src + "\"/>", output);
}
- public void testRenderNoValue() throws Exception
- {
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
graphicImage.setId("img1");
-
- graphicImage.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<img id=\"img1\"/>", output);
+ graphicImage.setValue("http://www.apache.org/images/feather.gif");
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ graphicImage, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-}
\ No newline at end of file
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ graphicImage.setId("img1");
+ graphicImage.setValue("http://www.apache.org/images/feather.gif");
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ graphicImage, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,27 +1,42 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.myfaces.renderkit.html;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
import javax.faces.component.UIForm;
import javax.faces.component.html.HtmlCommandLink;
-import java.io.StringWriter;
+import javax.faces.component.html.HtmlOutputLink;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.shared_impl.config.MyfacesConfig;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockExternalContext;
+import org.apache.shale.test.mock.MockHttpServletRequest;
+import org.apache.shale.test.mock.MockHttpServletResponse;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
+import org.apache.shale.test.mock.MockServletContext;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -31,107 +46,175 @@
{
private MockResponseWriter writer;
- private HtmlCommandLink link;
+ private HtmlCommandLink commandLink;
+ private HtmlOutputLink outputLink;
public HtmlLinkRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlLinkRendererTest.class);
+ }
- @Override
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
UIForm form = new UIForm();
- link = new HtmlCommandLink();
+ commandLink = new HtmlCommandLink();
+ outputLink = new HtmlOutputLink();
+ outputLink.setValue("http://someurl");
- form.getChildren().add(link);
+ form.getChildren().add(commandLink);
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
facesContext.getRenderKit().addRenderer(
- link.getFamily(),
- link.getRendererType(),
+ commandLink.getFamily(),
+ commandLink.getRendererType(),
+ new HtmlLinkRenderer());
+ facesContext.getRenderKit().addRenderer(
+ form.getFamily(),
+ form.getRendererType(),
+ new HtmlFormRenderer());
+ facesContext.getRenderKit().addRenderer(
+ outputLink.getFamily(),
+ outputLink.getRendererType(),
new HtmlLinkRenderer());
}
- @Override
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
writer = null;
}
-
- public void testLinkDisabled() throws Exception
+
+ public void testHtmlPropertyPassTru() throws Exception
{
- link.setDisabled(true);
- link.setValue("HelloLink");
- link.setStyleClass("linkClass");
- link.setTarget("testTarget");
- link.setId("foo1");
-
- HtmlLinkRenderer renderer = new HtmlLinkRenderer();
- renderer.encodeBegin(facesContext, link);
- renderer.encodeChildren(facesContext, link);
- renderer.encodeEnd(facesContext, link);
-
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals("<span id=\"" + link.getClientId(facesContext) + "\" target=\"testTarget\" class=\"linkClass\">HelloLink</span>", output);
- }
-
- public void testLinkPassthrough() throws Exception
- {
- link.setAccesskey("accesskey");
- link.setCharset("charset");
- link.setCoords("coords");
- link.setDir("dir");
- link.setHreflang("hreflang");
- link.setLang("lang");
- link.setOnblur("onblur");
- link.setOndblclick("ondblclick");
- link.setOnfocus("onfocus");
- link.setOnkeydown("onkeydown");
- link.setOnkeypress("onkeypress");
- link.setOnkeyup("onkeyup");
- link.setOnmousedown("onmousedown");
- link.setOnmousemove("onmousemove");
- link.setOnmouseout("onmouseout");
- link.setOnmouseover("onmouseover");
- link.setOnmouseup("onmouseup");
- link.setRel("rel");
- link.setRev("rev");
- link.setShape("shape");
- link.setStyle("style");
- link.setTabindex("tabindex");
- link.setTitle("title");
- link.setType("type");
-
- HtmlLinkRenderer renderer = new HtmlLinkRenderer();
- renderer.encodeBegin(facesContext, link);
- renderer.encodeChildren(facesContext, link);
- renderer.encodeEnd(facesContext, link);
-
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- // just get what is rendered in the <a> element
- output = output.substring(output.indexOf("<a href"));
-
- assertEquals("<a href=\"#\" onclick=\"return oamSubmitForm('j_id1','j_id1:j_id0');\" " +
- "accesskey=\"accesskey\" charset=\"charset\" coords=\"coords\" hreflang=\"hreflang\" " +
- "rel=\"rel\" rev=\"rev\" shape=\"shape\" tabindex=\"tabindex\" type=\"type\" " +
- "ondblclick=\"ondblclick\" onmousedown=\"onmousedown\" onmouseup=\"onmouseup\" " +
- "onmouseover=\"onmouseover\" onmousemove=\"onmousemove\" onmouseout=\"onmouseout\" " +
- "onkeypress=\"onkeypress\" onkeydown=\"onkeydown\" onkeyup=\"onkeyup\" dir=\"dir\" " +
- "lang=\"lang\" title=\"title\" onfocus=\"onfocus\" onblur=\"onblur\" style=\"style\"></a>", output);
-
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick",
+ "onclick=\"var cf = function(){onclick};var oamSF = function(){return oamSubmitForm('j_id1','j_id1:j_id0');};return (cf()==false)? false : oamSF();\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ commandLink.setValue("outputdata");
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ commandLink, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testJSNotAllowedHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+
+ commandLink.setValue("outputdata");
+
+ MockServletContext servletContext = new MockServletContext();
+ servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "false");
+ MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
+ new MockHttpServletRequest(), new MockHttpServletResponse());
+ MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
+ facesContext.setExternalContext(mockExtCtx);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ commandLink, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testOutputLink() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ outputLink, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
}