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 2013/04/17 01:10:48 UTC
svn commit: r1468663 - in /myfaces: core/trunk/
core/trunk/api/src/main/java/javax/faces/component/
core/trunk/impl/src/main/java/org/apache/myfaces/application/
core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/
core/trunk/impl/sr...
Author: lu4242
Date: Tue Apr 16 23:10:47 2013
New Revision: 1468663
URL: http://svn.apache.org/r1468663
Log:
merge revisions 1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143 until make 2.2.x trunk
Added:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/TempDirFileCacheResourceLoader.java
- copied unchanged from r1461879, myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/TempDirFileCacheResourceLoader.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/impl/ResourceMarkDeleteTest.java
- copied unchanged from r1461890, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/impl/ResourceMarkDeleteTest.java
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/ (props changed)
- copied from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/ (props changed)
- copied from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/ (props changed)
- copied from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/a.js
- copied unchanged from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/a.js
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/x.js
- copied unchanged from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/x.js
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/test_conditional_include_resources.xhtml
- copied unchanged from r1461890, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/test_conditional_include_resources.xhtml
Modified:
myfaces/core/trunk/ (props changed)
myfaces/core/trunk/api/src/main/java/javax/faces/component/_ViewAttributeMap.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultResourceHandlerSupport.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java (props changed)
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java (props changed)
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java (props changed)
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java (props changed)
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java (props changed)
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
myfaces/core/trunk/impl/src/main/resources/META-INF/faces-config20.vm (props changed)
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java (props changed)
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java (props changed)
myfaces/core/trunk/parent/pom.xml (contents, props changed)
myfaces/core/trunk/parent/src/ (props changed)
myfaces/core/trunk/pom.xml
myfaces/core/trunk/shared/ (props changed)
myfaces/core/trunk/shared-public/pom.xml (props changed)
myfaces/core/trunk/shared-public/src/ (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java (props changed)
myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit/ (props changed)
myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/context/flash/FlashImplTest.java
myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtilsTest.java
Propchange: myfaces/core/trunk/
------------------------------------------------------------------------------
Merged /myfaces/core/trunk:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_ViewAttributeMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_ViewAttributeMap.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_ViewAttributeMap.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_ViewAttributeMap.java Tue Apr 16 23:10:47 2013
@@ -18,6 +18,7 @@
*/
package javax.faces.component;
+import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
@@ -27,8 +28,10 @@ import java.util.Set;
*
* @author Leonardo Uribe
*/
-class _ViewAttributeMap implements Map<String, Object>
+class _ViewAttributeMap implements Map<String, Object>, Serializable
{
+ private static final long serialVersionUID = -9106832109394257866L;
+
//private static final String RESET_SAVE_STATE_MODE_KEY =
// "oam.view.resetSaveStateMode";
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultResourceHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultResourceHandlerSupport.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultResourceHandlerSupport.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultResourceHandlerSupport.java Tue Apr 16 23:10:47 2013
@@ -22,6 +22,7 @@ import javax.faces.application.ProjectSt
import javax.faces.context.FacesContext;
import org.apache.myfaces.resource.InternalClassLoaderResourceLoader;
+import org.apache.myfaces.resource.TempDirFileCacheResourceLoader;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.resource.BaseResourceHandlerSupport;
import org.apache.myfaces.shared.resource.ClassLoaderResourceLoader;
@@ -55,27 +56,57 @@ public class DefaultResourceHandlerSuppo
if (_resourceLoaders == null)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
- //The ExternalContextResourceLoader has precedence over
- //ClassLoaderResourceLoader, so it goes first.
- String renderedJSFJS = WebConfigParamUtils.getStringInitParameter(facesContext.getExternalContext(),
- InternalClassLoaderResourceLoader.MYFACES_JSF_MODE,
- ResourceUtils.JSF_MYFACES_JSFJS_NORMAL);
-
- if (facesContext.isProjectStage(ProjectStage.Development) ||
- !renderedJSFJS.equals(ResourceUtils.JSF_MYFACES_JSFJS_NORMAL))
+
+ if (TempDirFileCacheResourceLoader.isValidCreateTemporalFiles(facesContext))
{
- _resourceLoaders = new ResourceLoader[] {
- new ExternalContextResourceLoader(RESOURCES),
- new InternalClassLoaderResourceLoader(META_INF_INTERNAL_RESOURCES),
- new ClassLoaderResourceLoader(META_INF_RESOURCES)
- };
+ //The ExternalContextResourceLoader has precedence over
+ //ClassLoaderResourceLoader, so it goes first.
+ String renderedJSFJS = WebConfigParamUtils.getStringInitParameter(facesContext.getExternalContext(),
+ InternalClassLoaderResourceLoader.MYFACES_JSF_MODE,
+ ResourceUtils.JSF_MYFACES_JSFJS_NORMAL);
+
+ if (facesContext.isProjectStage(ProjectStage.Development) ||
+ !renderedJSFJS.equals(ResourceUtils.JSF_MYFACES_JSFJS_NORMAL))
+ {
+ _resourceLoaders = new ResourceLoader[] {
+ new TempDirFileCacheResourceLoader(new ExternalContextResourceLoader(RESOURCES)),
+ new TempDirFileCacheResourceLoader(
+ new InternalClassLoaderResourceLoader(META_INF_INTERNAL_RESOURCES)),
+ new TempDirFileCacheResourceLoader(new ClassLoaderResourceLoader(META_INF_RESOURCES))
+ };
+ }
+ else
+ {
+ _resourceLoaders = new ResourceLoader[] {
+ new TempDirFileCacheResourceLoader(new ExternalContextResourceLoader(RESOURCES)),
+ new TempDirFileCacheResourceLoader(new ClassLoaderResourceLoader(META_INF_RESOURCES))
+ };
+ }
}
else
- {
- _resourceLoaders = new ResourceLoader[] {
- new ExternalContextResourceLoader(RESOURCES),
- new ClassLoaderResourceLoader(META_INF_RESOURCES)
- };
+ {
+ //The ExternalContextResourceLoader has precedence over
+ //ClassLoaderResourceLoader, so it goes first.
+ String renderedJSFJS = WebConfigParamUtils.getStringInitParameter(facesContext.getExternalContext(),
+ InternalClassLoaderResourceLoader.MYFACES_JSF_MODE,
+ ResourceUtils.JSF_MYFACES_JSFJS_NORMAL);
+
+ if (facesContext.isProjectStage(ProjectStage.Development) ||
+ !renderedJSFJS.equals(ResourceUtils.JSF_MYFACES_JSFJS_NORMAL))
+ {
+ _resourceLoaders = new ResourceLoader[] {
+ new ExternalContextResourceLoader(RESOURCES),
+ new InternalClassLoaderResourceLoader(META_INF_INTERNAL_RESOURCES),
+ new ClassLoaderResourceLoader(META_INF_RESOURCES)
+ };
+ }
+ else
+ {
+ _resourceLoaders = new ResourceLoader[] {
+ new ExternalContextResourceLoader(RESOURCES),
+ new ClassLoaderResourceLoader(META_INF_RESOURCES)
+ };
+ }
}
}
return _resourceLoaders;
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java Tue Apr 16 23:10:47 2013
@@ -83,10 +83,12 @@ public class ResourceHandlerImpl extends
*/
@JSFWebConfigParam(since="2.1.10, 2.0.16", defaultValue="2048", group="resources")
public static final String INIT_PARAM_RESOURCE_BUFFER_SIZE = "org.apache.myfaces.RESOURCE_BUFFER_SIZE";
- private static final int INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT = 2048;
+ public static final int INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT = 2048;
private Boolean _allowSlashLibraryName;
private int _resourceBufferSize = -1;
+
+ private String[] _excludedResourceExtensions;
@Override
public Resource createResource(String resourceName)
@@ -403,7 +405,10 @@ public class ResourceHandlerImpl extends
{
int count = pipeBytes(in, out, buffer);
//set the content lenght
- httpServletResponse.setContentLength(count);
+ if (!httpServletResponse.isCommitted())
+ {
+ httpServletResponse.setContentLength(count);
+ }
}
finally
{
@@ -542,20 +547,20 @@ public class ResourceHandlerImpl extends
return localePrefix;
}
- protected boolean isResourceIdentifierExcluded(FacesContext context,
- String resourceIdentifier)
+ protected boolean isResourceIdentifierExcluded(FacesContext context, String resourceIdentifier)
{
- String value = context.getExternalContext().getInitParameter(
- RESOURCE_EXCLUDES_PARAM_NAME);
- if (value == null)
+ if (_excludedResourceExtensions == null)
{
- value = RESOURCE_EXCLUDES_DEFAULT_VALUE;
+ String value = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(),
+ RESOURCE_EXCLUDES_PARAM_NAME,
+ RESOURCE_EXCLUDES_DEFAULT_VALUE);
+
+ _excludedResourceExtensions = StringUtils.splitShortString(value, ' ');
}
- //TODO: optimize this code
- String[] extensions = StringUtils.splitShortString(value, ' ');
- for (int i = 0; i < extensions.length; i++)
+
+ for (int i = 0; i < _excludedResourceExtensions.length; i++)
{
- if (resourceIdentifier.endsWith(extensions[i]))
+ if (resourceIdentifier.endsWith(_excludedResourceExtensions[i]))
{
return true;
}
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java Tue Apr 16 23:10:47 2013
@@ -225,6 +225,7 @@ public class AnnotationConfigurator
if (renderKit == null)
{
renderKit = new org.apache.myfaces.config.impl.digester.elements.RenderKit();
+ renderKit.setId(renderKitId);
facesConfig.addRenderKit(renderKit);
}
@@ -492,6 +493,7 @@ public class AnnotationConfigurator
if (renderKit == null)
{
renderKit = new org.apache.myfaces.config.impl.digester.elements.RenderKit();
+ renderKit.setId(renderKitId);
facesConfig.addRenderKit(renderKit);
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java Tue Apr 16 23:10:47 2013
@@ -319,17 +319,20 @@ final class DefaultFaceletContext extend
if (uniqueIdFromIterator == null)
{
getFaceletCompositionContext().generateUniqueId(_uniqueIdBuilder);
- _uniqueIdBuilder.append("_");
- _uniqueIdBuilder.append(_prefix);
// Since two different facelets are used to build the metadata, it is necessary
// to trim the "base" part from the returned unique id, to ensure the components will be
// refreshed properly. Note the "base" part is the one that allows to ensure
// uniqueness between two different facelets with the same <f:metadata>, but since by
// spec view metadata sections cannot live on template client facelets, this case is
// just not possible.
+ // MYFACES-3709 It was also noticed that in some cases, the prefix should also
+ // be excluded from the id. The prefix is included if the metadata section is
+ // applied inside an included section (by ui:define and ui:insert for example).
if (!getFaceletCompositionContext().isInMetadataSection())
{
_uniqueIdBuilder.append("_");
+ _uniqueIdBuilder.append(_prefix);
+ _uniqueIdBuilder.append("_");
_uniqueIdBuilder.append(base);
}
uniqueIdFromIterator = _uniqueIdBuilder.toString();
Propchange: myfaces/core/trunk/impl/src/main/resources/META-INF/faces-config20.vm
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/main/resources/META-INF/faces-config20.vm:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/
------------------------------------------------------------------------------
bugtraq:number = true
Propchange: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/
------------------------------------------------------------------------------
bugtraq:number = true
Propchange: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/impl/resources/js/
------------------------------------------------------------------------------
bugtraq:number = true
Modified: myfaces/core/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/parent/pom.xml?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/parent/pom.xml (original)
+++ myfaces/core/trunk/parent/pom.xml Tue Apr 16 23:10:47 2013
@@ -112,6 +112,26 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-scm-publish-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <pubScmUrl>${siteScmPublish.url}</pubScmUrl>
+ <tryUpdate>true</tryUpdate>
+ <checkoutDirectory>${scmCheckout.path}</checkoutDirectory>
+ <content>\${siteContent.path}</content>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <stagingRepositoryId>myfaces-local-staging</stagingRepositoryId>
+ <stagingSiteURL>${siteDeploy.url}</stagingSiteURL>
+ </configuration>
+ </plugin>
+
</plugins>
<pluginManagement>
@@ -176,7 +196,7 @@
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
- <version>3.0</version>
+ <version>3.1</version>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
@@ -591,12 +611,30 @@
</repositories>
+ <!--
<distributionManagement>
<site>
<id>apache.website</id>
<name>Apache Website</name>
<url>scpexe://people.apache.org/www/myfaces.apache.org/core21/</url>
</site>
- </distributionManagement>
+ </distributionManagement>-->
+ <distributionManagement>
+ <site>
+ <id>myfaces-local-staging</id>
+ <name>Apache Website</name>
+ <url>scp://localhost/${user.home}/myfaces-site/${siteModule.path}</url>
+ </site>
+ </distributionManagement>
+ <properties>
+ <siteModule.path>core21</siteModule.path>
+ <site.mainDirectory>${user.home}/myfaces-site/checkout</site.mainDirectory>
+ <siteContent.path>${user.home}/myfaces-site/site/${siteModule.path}</siteContent.path>
+ <!-- it's a default location for performance reason (not checkout the content all the time)
+ you can override this value in your settings. -->
+ <scmCheckout.path>\${site.mainDirectory}/${siteModule.path}</scmCheckout.path>
+ <siteDeploy.url>file://${user.home}/myfaces-site/site/${siteModule.path}</siteDeploy.url>
+ <siteScmPublish.url>scm:svn:https://svn.apache.org/repos/asf/myfaces/site/publish/</siteScmPublish.url>
+ </properties>
</project>
Propchange: myfaces/core/trunk/parent/pom.xml
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/parent/pom.xml:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/parent/src/
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/parent/src:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Modified: myfaces/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/pom.xml?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/pom.xml (original)
+++ myfaces/core/trunk/pom.xml Tue Apr 16 23:10:47 2013
@@ -71,6 +71,35 @@
</extension>
</extensions>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.1</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-scm-publish-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <pubScmUrl>${siteScmPublish.url}</pubScmUrl>
+ <tryUpdate>true</tryUpdate>
+ <checkoutDirectory>${scmCheckout.path}</checkoutDirectory>
+ <content>\${siteContent.path}</content>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <stagingRepositoryId>myfaces-local-staging</stagingRepositoryId>
+ <stagingSiteURL>${siteDeploy.url}</stagingSiteURL>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
<profiles>
@@ -149,6 +178,7 @@
</repositories>
+ <!--
<distributionManagement>
<site>
<id>apache.website</id>
@@ -156,5 +186,27 @@
<url>scpexe://people.apache.org/www/myfaces.apache.org/core20/module</url>
</site>
</distributionManagement>
+ -->
+ <!-- To deploy the site, use site:stage-deploy goal and commit changes manually on
+ https://svn.apache.org/repos/asf/myfaces/site/publish/
+
+ -->
+ <distributionManagement>
+ <site>
+ <id>myfaces-local-staging</id>
+ <name>Apache Website</name>
+ <url>scp://localhost/${user.home}/myfaces-site/${siteModule.path}</url>
+ </site>
+ </distributionManagement>
+ <properties>
+ <siteModule.path>core21/module</siteModule.path>
+ <site.mainDirectory>${user.home}/myfaces-site/checkout</site.mainDirectory>
+ <siteContent.path>${user.home}/myfaces-site/site/${siteModule.path}</siteContent.path>
+ <!-- it's a default location for performance reason (not checkout the content all the time)
+ you can override this value in your settings. -->
+ <scmCheckout.path>\${site.mainDirectory}/${siteModule.path}</scmCheckout.path>
+ <siteDeploy.url>file://${user.home}/myfaces-site/site/${siteModule.path}</siteDeploy.url>
+ <siteScmPublish.url>scm:svn:https://svn.apache.org/repos/asf/myfaces/site/publish/</siteScmPublish.url>
+ </properties>
</project>
\ No newline at end of file
Propchange: myfaces/core/trunk/shared/
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/pom.xml
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/pom.xml:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Propchange: myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit/
------------------------------------------------------------------------------
Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit:r1433542,1448215,1448221,1449029,1449777,1451580,1455392,1461879,1461883,1461890,1461893,1461916,1462113,1467143
Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java (original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java Tue Apr 16 23:10:47 2013
@@ -189,7 +189,10 @@ public class ResourceUtils
// Check if this is an ajax request. If so, we don't need to include it, because that was
// already done and in the worst case, jsf script was already loaded on the page.
- if (facesContext.getPartialViewContext() != null && facesContext.getPartialViewContext().isAjaxRequest())
+ if (facesContext.getPartialViewContext() != null &&
+ (facesContext.getPartialViewContext().isPartialRequest() ||
+ facesContext.getPartialViewContext().isAjaxRequest() )
+ )
{
return;
}
@@ -246,7 +249,10 @@ public class ResourceUtils
//we only are allowed to do this on partial requests
//because on normal requests a static viewroot still could mean that a full page refresh is performed
//only in a ppr case this means we have the script already loaded and parsed
- if (facesContext.getPartialViewContext() != null && facesContext.getPartialViewContext().isPartialRequest())
+ if (facesContext.getPartialViewContext() != null &&
+ (facesContext.getPartialViewContext().isPartialRequest() ||
+ facesContext.getPartialViewContext().isAjaxRequest() )
+ )
{
return;
}
Modified: myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/context/flash/FlashImplTest.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/context/flash/FlashImplTest.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/context/flash/FlashImplTest.java (original)
+++ myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/context/flash/FlashImplTest.java Tue Apr 16 23:10:47 2013
@@ -30,26 +30,27 @@ import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.myfaces.test.base.junit4.AbstractJsfTestCase;
-import org.apache.myfaces.test.base.AbstractViewControllerTestCase;
import org.apache.myfaces.test.mock.MockExternalContext20;
import org.apache.myfaces.test.mock.MockFacesContext20;
import org.apache.myfaces.test.mock.MockHttpServletRequest;
import org.apache.myfaces.test.mock.MockHttpServletResponse;
+import org.junit.Assert;
+import org.junit.Test;
/**
* Tests for FlashImpl.
* @author Jakob Korherr (latest modification by $Author$)
* @version $Revision$ $Date$
*/
-public class FlashImplTest extends AbstractViewControllerTestCase
+public class FlashImplTest extends AbstractJsfTestCase
{
private FlashImpl _flash;
- public FlashImplTest(String name)
+ public FlashImplTest()
{
- super(name);
}
@Override
@@ -63,7 +64,7 @@ public class FlashImplTest extends Abstr
}
@Override
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -71,7 +72,7 @@ public class FlashImplTest extends Abstr
}
@Override
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
_flash = null;
@@ -83,6 +84,7 @@ public class FlashImplTest extends Abstr
* and correctly stores the values in it.
* @throws Exception
*/
+ @Test
public void testSessionMapWrapperSubKeyMap() throws Exception
{
// set phase to RESTORE_VIEW to create the flash tokens on doPrePhaseActions()
@@ -103,7 +105,7 @@ public class FlashImplTest extends Abstr
FlashImpl.SEPARATOR_CHAR + renderToken + "testkey1";
// Assertion
- assertEquals("The render FlashMap must use the session Map to store the values.",
+ Assert.assertEquals("The render FlashMap must use the session Map to store the values.",
"testvalue1", session.getAttribute(sessionMapKey));
}
@@ -112,6 +114,7 @@ public class FlashImplTest extends Abstr
* @throws Exception
*/
@SuppressWarnings("unchecked")
+ @Test
public void testKeepValueNormalPostback() throws Exception
{
// simulate JSF lifecycle:
@@ -172,7 +175,7 @@ public class FlashImplTest extends Abstr
// _flash.get() will ask the execute FlashMap for the value
// and this must be the render FlashMap of the previous request,
// thus it must contain the value from the previous request.
- assertEquals("flashvalue", _flash.get("flashkey"));
+ Assert.assertEquals("flashvalue", _flash.get("flashkey"));
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -180,14 +183,14 @@ public class FlashImplTest extends Abstr
// _flash.get() also references to the execute FlashMap, but
// this one has to be cleared by now, thus it must be null.
- assertNull("Execute FlashMap must have been cleared", _flash.get("flashkey"));
+ Assert.assertNull("Execute FlashMap must have been cleared", _flash.get("flashkey"));
// get the execute Map of the second postback (FlashImpl internals)
Map<String, Object> executeMap = (Map<String, Object>) externalContext
.getRequestMap().get(FlashImpl.FLASH_EXECUTE_MAP);
// must be empty
- assertTrue("The execute Map of the second postback must have been cleared",
+ Assert.assertTrue("The execute Map of the second postback must have been cleared",
executeMap.isEmpty());
}
@@ -196,6 +199,7 @@ public class FlashImplTest extends Abstr
* @throws Exception
*/
@SuppressWarnings("unchecked")
+ @Test
public void testKeepValuePostRedirectGet() throws Exception
{
// simulate JSF lifecycle:
@@ -237,7 +241,7 @@ public class FlashImplTest extends Abstr
// set redirect to true, this happens by the NavigationHandler in phase 5
_flash.setRedirect(true);
- assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
+ Assert.assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
_flash.isRedirect());
// note that setRedirect(true) was called, thus the cleanup happens
@@ -259,7 +263,7 @@ public class FlashImplTest extends Abstr
_flash.doPrePhaseActions(facesContext);
// check isRedirect();
- assertTrue("setRedirect(true) was called on the previous request, "
+ Assert.assertTrue("setRedirect(true) was called on the previous request, "
+ " and we are in the execute portion of the lifecycle, "
+ " thus isRedirect() must be true.",
_flash.isRedirect());
@@ -268,14 +272,14 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
// check isRedirect();
- assertFalse("setRedirect(true) was called on the previous request, "
+ Assert.assertFalse("setRedirect(true) was called on the previous request, "
+ " but we are already in the render portion of the lifecycle, "
+ " thus isRedirect() must be false.",
_flash.isRedirect());
// _flash.get() will ask the execute FlashMap and this one
// must contain the key used in keep()
- assertEquals("flashvalue", _flash.get("flashkey"));
+ Assert.assertEquals("flashvalue", _flash.get("flashkey"));
_flash.doPostPhaseActions(facesContext);
@@ -295,7 +299,7 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
// check isRedirect();
- assertFalse("setRedirect(true) was called on the pre-previous request, "
+ Assert.assertFalse("setRedirect(true) was called on the pre-previous request, "
+ " thus isRedirect() must be false again.",
_flash.isRedirect());
@@ -304,7 +308,7 @@ public class FlashImplTest extends Abstr
// thus it must not contain the value from the previous request,
// because the value was on the previous request's execute FlashMap
// and not on the previous request's render FlashMap.
- assertNull(_flash.get("flashkey"));
+ Assert.assertNull(_flash.get("flashkey"));
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -315,7 +319,7 @@ public class FlashImplTest extends Abstr
.getRequestMap().get(FlashImpl.FLASH_EXECUTE_MAP);
// must be empty
- assertTrue("The execute Map of the second postback must have been cleared",
+ Assert.assertTrue("The execute Map of the second postback must have been cleared",
executeMap.isEmpty());
}
@@ -323,6 +327,7 @@ public class FlashImplTest extends Abstr
* Tests the functionality of keepMessages in a normal postback scenario.
* @throws Exception
*/
+ @Test
public void testKeepMessagesNormalPostback() throws Exception
{
// simulate JSF lifecycle:
@@ -364,12 +369,12 @@ public class FlashImplTest extends Abstr
facesContext.addMessage(null, messageNoClientId);
// now the FacesContext must contain 2 messages
- assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(2, facesContext.getMessageList().size());
// keep messages
_flash.setKeepMessages(true);
- assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ Assert.assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ "must be true.", _flash.isKeepMessages());
// simulate JSF lifecycle
@@ -385,18 +390,18 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(true);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
_flash.doPrePhaseActions(facesContext);
// now the messages must be here again
- assertEquals(2, facesContext.getMessageList().size());
- assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
- assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
+ Assert.assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
+ Assert.assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
- assertFalse("setKeepMessages(true) was not called on this request, thus "
+ Assert.assertFalse("setKeepMessages(true) was not called on this request, thus "
+ "isKeepMessages() must be false.", _flash.isKeepMessages());
// simulate JSF lifecycle
@@ -412,7 +417,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(true);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
@@ -420,7 +425,7 @@ public class FlashImplTest extends Abstr
// the messages must still be gone here, because setKeepMessages(true)
// was not called on the previous request
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -433,6 +438,7 @@ public class FlashImplTest extends Abstr
* then not from the GET to the next postback.
* @throws Exception
*/
+ @Test
public void testKeepMessagesPostRedirectGet() throws Exception
{
// simulate JSF lifecycle:
@@ -474,16 +480,16 @@ public class FlashImplTest extends Abstr
facesContext.addMessage(null, messageNoClientId);
// now the FacesContext must contain 2 messages
- assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(2, facesContext.getMessageList().size());
// keep messages
_flash.setKeepMessages(true);
- assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ Assert.assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ "must be true.", _flash.isKeepMessages());
// set redirect to true, this happens by the NavigationHandler in phase 5
_flash.setRedirect(true);
- assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
+ Assert.assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
_flash.isRedirect());
// note that setRedirect(true) was called, thus the cleanup happens
@@ -499,7 +505,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(false);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
// Note that doPrePhaseActions() is called on RESTORE_VIEW even
@@ -511,12 +517,12 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
// now the messages must be here again
- assertEquals(2, facesContext.getMessageList().size());
- assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
- assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
+ Assert.assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
+ Assert.assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
// check isKeepMessages()
- assertFalse("setKeepMessages(true) was not called on this request, thus "
+ Assert.assertFalse("setKeepMessages(true) was not called on this request, thus "
+ "isKeepMessages() must be false.", _flash.isKeepMessages());
_flash.doPostPhaseActions(facesContext);
@@ -530,7 +536,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(true);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
@@ -541,7 +547,7 @@ public class FlashImplTest extends Abstr
// now the FacesContext must contain 0 messages, because
// setKeepMessages(true) was not called on the GET-request
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -554,6 +560,7 @@ public class FlashImplTest extends Abstr
* then also from the GET to the next postback.
* @throws Exception
*/
+ @Test
public void testKeepMessagesPostRedirectGetTwoTimes() throws Exception
{
// simulate JSF lifecycle:
@@ -595,16 +602,16 @@ public class FlashImplTest extends Abstr
facesContext.addMessage(null, messageNoClientId);
// now the FacesContext must contain 2 messages
- assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(2, facesContext.getMessageList().size());
// keep messages
_flash.setKeepMessages(true);
- assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ Assert.assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ "must be true.", _flash.isKeepMessages());
// set redirect to true, this happens by the NavigationHandler in phase 5
_flash.setRedirect(true);
- assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
+ Assert.assertTrue("setRedirect(true) was just called, thus isRedirect() must be true",
_flash.isRedirect());
// note that setRedirect(true) was called, thus the cleanup happens
@@ -620,7 +627,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(false);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
// Note that doPrePhaseActions() is called on RESTORE_VIEW even
@@ -632,17 +639,17 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
// now the messages must be here again
- assertEquals(2, facesContext.getMessageList().size());
- assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
- assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
+ Assert.assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
+ Assert.assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
// check isKeepMessages()
- assertFalse("setKeepMessages(true) was not called on this request, thus "
+ Assert.assertFalse("setKeepMessages(true) was not called on this request, thus "
+ "isKeepMessages() must be false.", _flash.isKeepMessages());
// keep messages - again
_flash.setKeepMessages(true);
- assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ Assert.assertTrue("setKeepMessages(true) was just called, thus isKeepMessages() "
+ "must be true.", _flash.isKeepMessages());
_flash.doPostPhaseActions(facesContext);
@@ -656,7 +663,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(true);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
@@ -666,9 +673,9 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
// now the messages must be here again
- assertEquals(2, facesContext.getMessageList().size());
- assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
- assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
+ Assert.assertEquals(2, facesContext.getMessageList().size());
+ Assert.assertEquals(Arrays.asList(messageClientId), facesContext.getMessageList("clientId"));
+ Assert.assertEquals(Arrays.asList(messageNoClientId), facesContext.getMessageList(null));
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -683,7 +690,7 @@ public class FlashImplTest extends Abstr
((MockFacesContext20) facesContext).setPostback(true);
// now the FacesContext must contain 0 messages (new request, new FacesContext)
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RESTORE_VIEW);
@@ -694,7 +701,7 @@ public class FlashImplTest extends Abstr
// now the FacesContext must contain 0 messages, because
// setKeepMessages(true) was not called on the previous postback
- assertEquals(0, facesContext.getMessageList().size());
+ Assert.assertEquals(0, facesContext.getMessageList().size());
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -705,53 +712,57 @@ public class FlashImplTest extends Abstr
* Test if setRedirect(true) works via _flash.put("redirect", true)
* and if isRedirect() is equal to _flash.get("redirect").
*/
+ @Test
public void testSetRedirect()
{
- assertFalse(_flash.isRedirect());
- assertFalse((Boolean) _flash.get("redirect"));
+ Assert.assertFalse(_flash.isRedirect());
+ Assert.assertFalse((Boolean) _flash.get("redirect"));
_flash.put("redirect", true);
- assertTrue(_flash.isRedirect());
- assertTrue((Boolean) _flash.get("redirect"));
+ Assert.assertTrue(_flash.isRedirect());
+ Assert.assertTrue((Boolean) _flash.get("redirect"));
}
/**
* Test if setKeepMessages(true) works via _flash.put("keepMessages", true)
* and if isKeepMessages() is equal to _flash.get("keepMessages").
*/
+ @Test
public void testSetKeepMessages()
{
- assertFalse(_flash.isKeepMessages());
- assertFalse((Boolean) _flash.get("keepMessages"));
+ Assert.assertFalse(_flash.isKeepMessages());
+ Assert.assertFalse((Boolean) _flash.get("keepMessages"));
_flash.put("keepMessages", true);
- assertTrue(_flash.isKeepMessages());
- assertTrue((Boolean) _flash.get("keepMessages"));
+ Assert.assertTrue(_flash.isKeepMessages());
+ Assert.assertTrue((Boolean) _flash.get("keepMessages"));
}
/**
* Tests the functionality of putNow().
*/
@SuppressWarnings("unchecked")
+ @Test
public void testPutNow()
{
Map<String, Object> requestMap = externalContext.getRequestMap();
// requestMap must NOT contain the key
- assertNull(requestMap.get("flashkey"));
+ Assert.assertNull(requestMap.get("flashkey"));
_flash.putNow("flashkey", "flashvalue");
// requestMap must contain the key
- assertEquals("flashvalue", requestMap.get("flashkey"));
+ Assert.assertEquals("flashvalue", requestMap.get("flashkey"));
}
/**
* Tests keep()
* @throws Exception
*/
+ @Test
public void testKeep() throws Exception
{
// simulate JSF lifecycle:
@@ -814,7 +825,7 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
// the value must be in the executeMap
- assertEquals("flashvalue", _flash.get("flashkey"));
+ Assert.assertEquals("flashvalue", _flash.get("flashkey"));
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -827,6 +838,7 @@ public class FlashImplTest extends Abstr
* Like testKeep(), but without calling keep() to keep the value.
* @throws Exception
*/
+ @Test
public void testNotKeep() throws Exception
{
// simulate JSF lifecycle:
@@ -887,7 +899,7 @@ public class FlashImplTest extends Abstr
facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
// render FlashMap must be empty
- assertNull(_flash.get("flashkey"));
+ Assert.assertNull(_flash.get("flashkey"));
// simulate JSF lifecycle
facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
@@ -900,6 +912,7 @@ public class FlashImplTest extends Abstr
* Tests if the reading functions use _getFlashMapForReading()
* and if the writing functions use _getFlashMapForWriting().
*/
+ @Test
public void testMapMethodsUseDifferentMaps() throws Exception
{
// simulate JSF lifecycle:
@@ -937,7 +950,7 @@ public class FlashImplTest extends Abstr
// in this configuration put() and get() are executed on different maps
// there must not be a value with the key "flashkey"
- assertNull(_flash.get("flashkey"));
+ Assert.assertNull(_flash.get("flashkey"));
// put() always references the active FlashMap,
// which is the render FlashMap in this case (phase is render response)
@@ -945,7 +958,7 @@ public class FlashImplTest extends Abstr
// there must still not be a value with the key "flashkey"
// NOTE that get still references the execute FlashMap
- assertNull(_flash.get("flashkey"));
+ Assert.assertNull(_flash.get("flashkey"));
_flash.doPostPhaseActions(facesContext);
}
@@ -953,6 +966,7 @@ public class FlashImplTest extends Abstr
/**
* Tests the implementation of the methods from the java.util.Map interface.
*/
+ @Test
public void testMapMethods()
{
// ensure that _getActiveFlashMap() returns the execute FlashMap
@@ -1000,13 +1014,13 @@ public class FlashImplTest extends Abstr
*/
private void _noElementAssertions()
{
- assertTrue(_flash.isEmpty());
- assertEquals(0, _flash.size());
- assertFalse(_flash.containsKey("flashkey"));
- assertFalse(_flash.containsValue("flashvalue"));
- assertEquals(Collections.emptySet(), _flash.keySet());
- assertNull(_flash.get("flashkey"));
- assertTrue(_flash.values().isEmpty());
+ Assert.assertTrue(_flash.isEmpty());
+ Assert.assertEquals(0, _flash.size());
+ Assert.assertFalse(_flash.containsKey("flashkey"));
+ Assert.assertFalse(_flash.containsValue("flashvalue"));
+ Assert.assertEquals(Collections.emptySet(), _flash.keySet());
+ Assert.assertNull(_flash.get("flashkey"));
+ Assert.assertTrue(_flash.values().isEmpty());
}
/**
@@ -1014,13 +1028,13 @@ public class FlashImplTest extends Abstr
*/
private void _oneElementAssertions()
{
- assertFalse(_flash.isEmpty());
- assertEquals(1, _flash.size());
- assertTrue(_flash.containsKey("flashkey"));
- assertTrue(_flash.containsValue("flashvalue"));
- assertEquals(new HashSet<String>(Arrays.asList("flashkey")), _flash.keySet());
- assertEquals("flashvalue", _flash.get("flashkey"));
- assertTrue(_flash.values().contains("flashvalue"));
+ Assert.assertFalse(_flash.isEmpty());
+ Assert.assertEquals(1, _flash.size());
+ Assert.assertTrue(_flash.containsKey("flashkey"));
+ Assert.assertTrue(_flash.containsValue("flashvalue"));
+ Assert.assertEquals(new HashSet<String>(Arrays.asList("flashkey")), _flash.keySet());
+ Assert.assertEquals("flashvalue", _flash.get("flashkey"));
+ Assert.assertTrue(_flash.values().contains("flashvalue"));
}
/**
@@ -1036,7 +1050,7 @@ public class FlashImplTest extends Abstr
Cookie renderTokenCookie = response.getCookie(FlashImpl.FLASH_RENDER_MAP_TOKEN);
// the Cookie must exist
- assertNotNull(renderTokenCookie);
+ Assert.assertNotNull(renderTokenCookie);
// check for the redirect-cookie
Cookie redirectCookie = response.getCookie(FlashImpl.FLASH_REDIRECT);
@@ -1049,6 +1063,8 @@ public class FlashImplTest extends Abstr
setUpExternalContext();
setUpFacesContext();
+ facesContext.setApplication(application);
+
// add the cookie to the new request
request.addCookie(renderTokenCookie);
Modified: myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtilsTest.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtilsTest.java?rev=1468663&r1=1468662&r2=1468663&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtilsTest.java (original)
+++ myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtilsTest.java Tue Apr 16 23:10:47 2013
@@ -48,7 +48,7 @@ public class HtmlRendererUtilsTest exten
ClientBehaviorEvents.CLICK, params, ClientBehaviorEvents.ACTION, params, behaviors, null,
null));
- Assert.assertEquals("return jsf.util.chain(document.getElementById('j_id0'), event,'huhn', 'suppe');",
+ Assert.assertEquals("return jsf.util.chain(document.getElementById('j_id__v_0'), event,'huhn', 'suppe');",
HtmlRendererUtils.buildBehaviorChain(facesContext,
component, ClientBehaviorEvents.CLICK, params, ClientBehaviorEvents.ACTION, params, behaviors, "huhn",
"suppe"));
@@ -70,7 +70,7 @@ public class HtmlRendererUtilsTest exten
behaviors.put(ClientBehaviorEvents.CLICK, Arrays.asList(submittingBehavior));
- Assert.assertEquals("jsf.util.chain(document.getElementById('j_id0'), event,'huhn', 'script()', 'suppe'); return false;",
+ Assert.assertEquals("jsf.util.chain(document.getElementById('j_id__v_0'), event,'huhn', 'script()', 'suppe'); return false;",
HtmlRendererUtils.buildBehaviorChain(facesContext,
component,
ClientBehaviorEvents.CLICK, params, ClientBehaviorEvents.ACTION, params, behaviors, "huhn",
@@ -87,4 +87,4 @@ public class HtmlRendererUtilsTest exten
Assert.assertEquals("var foo = \\'bar \\\\\\' \\'", HtmlRendererUtils.escapeJavaScriptForChain("var foo = 'bar \\' '"));
}
-}
\ No newline at end of file
+}