[jira] [Commented] (TAP5-2070) Respond with a HTTP 404 if the page is activated with an activation context not explicitly supported by the page itself

2013-08-05 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13729783#comment-13729783
 ] 

Hudson commented on TAP5-2070:
--

FAILURE: Integrated in tapestry-trunk-freestyle #1127 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1127/])
TAP5-2070 better to take no activation handler method as a way to accept empty 
activation context (mlusetti: rev 28e3321f7865fb74cd36c78f3911bfbd9750ae77)
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
TAP5-2070 tests on basic check on activation context with new annotation 
(mlusetti: rev 0ae1d1170f93f7570a3340a0d07185c79a300acb)
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
TAP5-2070 new page for base tests (mlusetti: rev 
7de82f531c875bf916385c5dc1fedd64687af7d6)
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
TAP5-2070 show new pages in main intergation test app (mlusetti: rev 
83fcdca312281c36399ed69773f55d677e05f6fd)
* tapestry-core/src/test/app1/Index.tml
TAP5-2070 new test integration app for activation context check (mlusetti: rev 
7e058593bf074416bd8af97a66a1dc770021e8bd)
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
* tapestry-core/src/test/activationctx/WEB-INF/web.xml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/ActivationContextintegrationTests.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
TAP5-2070 new test integration app for activation context check with inverse 
behavior (all enabled, some excluded) (mlusetti: rev 
2d5fb4b77e7250b5d12ba23fc1a48075b429d034)
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
* tapestry-core/src/test/activationctx2/WEB-INF/web.xml
* 
tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/ActivationContextIntegrationTests2.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java
TAP5-2070 hook new test apps into test chain (mlusetti: rev 
a9173f9a7c86f2b65fa2b4d9f1b430f2e40a161b)
* tapestry-core/src/test/conf/testng.xml


> Respond with a HTTP 404 if the page is activated with an activation context 
> not explicitly supported by the page itself
> ---
>
> Key: TAP5-2070
> URL: https://issues.apache.org/jira/browse/TAP5-2070
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Massimo Lusetti
>A

[1/8] git commit: TAP5-2070 hook new test apps into test chain

2013-08-05 Thread mlusetti
Updated Branches:
  refs/heads/master 8d24cbdd2 -> a9173f9a7


TAP5-2070 hook new test apps into test chain


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/a9173f9a
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/a9173f9a
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/a9173f9a

Branch: refs/heads/master
Commit: a9173f9a7c86f2b65fa2b4d9f1b430f2e40a161b
Parents: 2d5fb4b
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:45:03 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 tapestry-core/src/test/conf/testng.xml | 15 +++
 1 file changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a9173f9a/tapestry-core/src/test/conf/testng.xml
--
diff --git a/tapestry-core/src/test/conf/testng.xml 
b/tapestry-core/src/test/conf/testng.xml
index 0fc5add..9e8921a 100644
--- a/tapestry-core/src/test/conf/testng.xml
+++ b/tapestry-core/src/test/conf/testng.xml
@@ -102,4 +102,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 



[5/8] git commit: TAP5-2070 better to take no activation handler method as a way to accept empty activation context

2013-08-05 Thread mlusetti
TAP5-2070 better to take no activation handler method as a way to accept empty 
activation context


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/28e3321f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/28e3321f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/28e3321f

Branch: refs/heads/master
Commit: 28e3321f7865fb74cd36c78f3911bfbd9750ae77
Parents: 8d24cbd
Author: Massimo Lusetti 
Authored: Mon Aug 5 18:17:02 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../apache/tapestry5/internal/services/PageActivatorImpl.java  | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/28e3321f/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
index 3b7742b..5ebdc7c 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
@@ -50,10 +50,14 @@ public class PageActivatorImpl implements PageActivator
 
boolean handled = 
pageResources.triggerContextEvent(EventConstants.ACTIVATE, activationContext, 
callback);
 
+   boolean acceptEmpty = 
!pageResources.getComponentModel().handlesEvent(EventConstants.ACTIVATE) &&
+   
activationContext.getCount() == 0;
+
boolean checkUnknown = 
metaDataLocator.findMeta(MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK,

pageResources, Boolean.class);
 
-   if ( !handled && checkUnknown && 
!pageResources.getComponentModel().handleActivationEventContext())
+   if ( !handled && !acceptEmpty && checkUnknown &&
+   
!pageResources.getComponentModel().handleActivationEventContext())
{
logger.info("Page {} required an exact activation 
context, let's handle this", pageResources.getPageName());

unknownActivationContextHandler.handleUnknownContext(pageResources, 
activationContext);



[6/8] git commit: TAP5-2070 new page for base tests

2013-08-05 Thread mlusetti
TAP5-2070 new page for base tests


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7de82f53
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7de82f53
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7de82f53

Branch: refs/heads/master
Commit: 7de82f531c875bf916385c5dc1fedd64687af7d6
Parents: 0ae1d11
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:41:32 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../app1/pages/KnownActivationContextDemo.java  | 28 
 .../app1/pages/KnownActivationContextDemo.tml   | 13 +
 2 files changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7de82f53/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.java
new file mode 100644
index 000..8e10172
--- /dev/null
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.java
@@ -0,0 +1,28 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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
+//
+// 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.tapestry5.integration.app1.pages;
+
+import org.apache.tapestry5.annotations.PageActivationContext;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class KnownActivationContextDemo
+{
+   @PageActivationContext
+   @Property
+   private String activationContext;
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7de82f53/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
--
diff --git 
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
 
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
new file mode 100644
index 000..8e59be7
--- /dev/null
+++ 
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
@@ -0,0 +1,13 @@
+http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
+
+Page called with correct activation context
+
+
+You should never see me if use an erroneous activation context
+
+
+
+${activationContext}
+
+
+
\ No newline at end of file



[3/8] git commit: update copyright notice

2013-08-05 Thread mlusetti
update copyright notice


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/953f9a33
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/953f9a33
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/953f9a33

Branch: refs/heads/master
Commit: 953f9a339dd31588b948ad583aeca3c20f87cb87
Parents: 28e3321
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:39:04 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../tapestry5/annotations/UnknownActivationContextCheck.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/953f9a33/tapestry-core/src/main/java/org/apache/tapestry5/annotations/UnknownActivationContextCheck.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/annotations/UnknownActivationContextCheck.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/annotations/UnknownActivationContextCheck.java
index 7752693..609f16b 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/annotations/UnknownActivationContextCheck.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/annotations/UnknownActivationContextCheck.java
@@ -1,4 +1,4 @@
-// Copyright 2008, 2009 The Apache Software Foundation
+// Copyright 2008, 2009, 2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.



[7/8] git commit: TAP5-2070 new test integration app for activation context check with inverse behavior (all enabled, some excluded)

2013-08-05 Thread mlusetti
TAP5-2070 new test integration app for activation context check with inverse 
behavior (all enabled, some excluded)


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/2d5fb4b7
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/2d5fb4b7
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/2d5fb4b7

Branch: refs/heads/master
Commit: 2d5fb4b77e7250b5d12ba23fc1a48075b429d034
Parents: 7e05859
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:44:27 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../src/test/activationctx2/WEB-INF/web.xml | 19 ++
 .../ActivationContextIntegrationTests2.java | 64 
 .../activationctx2/components/Layout.java   | 19 ++
 .../activationctx2/pages/ContextChecked.java| 19 ++
 .../activationctx2/pages/ContextUnchecked.java  | 22 +++
 .../integration/activationctx2/pages/Index.java | 32 ++
 .../activationctx2/services/AppModule.java  | 35 +++
 .../activationctx2/components/Layout.tml| 21 +++
 .../activationctx2/pages/ContextChecked.tml |  7 +++
 .../activationctx2/pages/ContextUnchecked.tml   |  7 +++
 .../integration/activationctx2/pages/Index.tml  | 26 
 11 files changed, 271 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/activationctx2/WEB-INF/web.xml
--
diff --git a/tapestry-core/src/test/activationctx2/WEB-INF/web.xml 
b/tapestry-core/src/test/activationctx2/WEB-INF/web.xml
new file mode 100644
index 000..45415d9
--- /dev/null
+++ b/tapestry-core/src/test/activationctx2/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+
+http://java.sun.com/dtd/web-app_2_3.dtd";>
+
+  Activation Context Test App 2
+  
+tapestry.app-package
+org.apache.tapestry5.integration.activationctx2
+  
+  
+app
+org.apache.tapestry5.TapestryFilter
+  
+  
+app
+/*
+  
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/ActivationContextIntegrationTests2.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/ActivationContextIntegrationTests2.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/ActivationContextIntegrationTests2.java
new file mode 100644
index 000..1939788
--- /dev/null
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/ActivationContextIntegrationTests2.java
@@ -0,0 +1,64 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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
+//
+// 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.tapestry5.integration.activationctx2;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * To test TAP5-2070
+ */
+public class ActivationContextIntegrationTests2 extends TapestryCoreTestCase
+{
+   @Test
+   public void checked_context_correct()
+   {
+   openLinks("Context checked correct");
+
+   assertTextPresent("You are able to see me only without 
activation context");
+   }
+
+   @Test
+   public void checked_context_error()
+   {
+   openLinks("Context checked error");
+
+   assertTextPresent("HTTP ERROR 404");
+   }
+
+   @Test
+   public void unchecked_context_empty()
+   {
+   openLinks("Context unchecked without");
+
+   assertTextPresent("You are able to see with all context you 
like...");
+   }
+
+   @Test
+   public void unchecked_context_one()
+   {
+   openLinks("Context unchecked with one");
+
+   assertTextPresent("You are able to see with all context you 
like...");
+   }
+
+   @Test
+   public void unchecked_context_two()
+   {
+   openLinks("Context unchecked with two");
+
+   assertTextPresent("You are able to see with all context you 
like...");
+   }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/ta

[2/8] git commit: TAP5-2070 new test integration app for activation context check

2013-08-05 Thread mlusetti
TAP5-2070 new test integration app for activation context check


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7e058593
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7e058593
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7e058593

Branch: refs/heads/master
Commit: 7e058593bf074416bd8af97a66a1dc770021e8bd
Parents: 83fcdca
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:43:46 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../src/test/activationctx/WEB-INF/web.xml  | 19 +
 .../ActivationContextintegrationTests.java  | 88 
 .../activationctx/components/Layout.java| 19 +
 .../integration/activationctx/pages/Index.java  | 30 +++
 .../activationctx/pages/NoContext.java  | 23 +
 .../activationctx/pages/OneContext.java | 25 ++
 .../activationctx/pages/TwoContext.java | 26 ++
 .../activationctx/services/AppModule.java   | 30 +++
 .../activationctx/components/Layout.tml | 21 +
 .../integration/activationctx/pages/Index.tml   | 39 +
 .../activationctx/pages/NoContext.tml   |  7 ++
 .../activationctx/pages/OneContext.tml  |  7 ++
 .../activationctx/pages/TwoContext.tml  |  7 ++
 13 files changed, 341 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/activationctx/WEB-INF/web.xml
--
diff --git a/tapestry-core/src/test/activationctx/WEB-INF/web.xml 
b/tapestry-core/src/test/activationctx/WEB-INF/web.xml
new file mode 100644
index 000..d42a684
--- /dev/null
+++ b/tapestry-core/src/test/activationctx/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+
+http://java.sun.com/dtd/web-app_2_3.dtd";>
+
+  Activation Context Test App
+  
+tapestry.app-package
+org.apache.tapestry5.integration.activationctx
+  
+  
+app
+org.apache.tapestry5.TapestryFilter
+  
+  
+app
+/*
+  
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/ActivationContextintegrationTests.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/ActivationContextintegrationTests.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/ActivationContextintegrationTests.java
new file mode 100644
index 000..da6be55
--- /dev/null
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/ActivationContextintegrationTests.java
@@ -0,0 +1,88 @@
+// Copyright 2013 The Apache Software Foundation
+//
+// 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
+//
+// 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.tapestry5.integration.activationctx;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * To test TAP5-2070
+ */
+public class ActivationContextintegrationTests extends TapestryCoreTestCase
+{
+   @Test
+   public void no_context_correct()
+   {
+   openLinks("No context correct");
+
+   assertTextPresent("You are able to see me only without 
activation context");
+   }
+
+   @Test
+   public void no_context_error()
+   {
+   openLinks("No context error");
+
+   assertTextPresent("HTTP ERROR 404");
+   }
+
+   @Test
+   public void one_context_without()
+   {
+   openLinks("One context without");
+
+   assertTextPresent("HTTP ERROR 404");
+   }
+
+   @Test
+   public void one_context_with_one()
+   {
+   openLinks("One context correct");
+
+   assertTextPresent("You are able to see me only with one 
parameter in the activation context");
+   }
+
+   @Test
+   public void one_context_with_two()
+   {
+   openLinks("One context error");
+
+   assertTextPresent("HTTP ERROR 404");
+   }
+
+   @Test
+   public void two_context_without()
+   {
+   openLinks("Two context without");
+
+   assertTextPresent("HTTP ERROR 40

[4/8] git commit: TAP5-2070 tests on basic check on activation context with new annotation

2013-08-05 Thread mlusetti
TAP5-2070 tests on basic check on activation context with new annotation


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0ae1d117
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0ae1d117
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0ae1d117

Branch: refs/heads/master
Commit: 0ae1d1170f93f7570a3340a0d07185c79a300acb
Parents: 953f9a3
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:40:41 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 .../integration/app1/CoreBehaviorsTests.java| 24 
 .../tapestry5/integration/app1/pages/Index.java | 12 +++---
 .../pages/UnknownActivationContextDemo.java |  2 +-
 .../app1/pages/UnknownActivationContextDemo.tml |  7 +++---
 4 files changed, 37 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
index 51c1683..f738e90 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
@@ -1684,4 +1684,28 @@ public class CoreBehaviorsTests extends 
TapestryCoreTestCase
 
 assertTextPresent("Component Event Link Decorated: true");
 }
+
+   /**
+* TAP5-2070
+*/
+   @Test
+   public void unknown_activation_context_demo()
+   {
+   openLinks("Unknown Activation Context Demo");
+
+   assertText("//title", "Error 404 Activation context 
" +
+   " unrecognized for page class 
org.apache.tapestry5.integration.app1.pages.UnknownActivationContextDemo");
+   }
+
+   /**
+* TAP5-2070
+*/
+   @Test
+   public void known_activation_context_demo()
+   {
+   openLinks("Known Activation Context Demo");
+
+   assertTextPresent("Page called with correct activation context",
+   "You should never see me if use an erroneous 
activation context");
+   }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index a8a9fa2..0735233 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software 
Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The Apache 
Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -40,12 +40,14 @@ public class Index
 public final String pageName;
 public final String label;
 public final String description;
+   public final Object[] context;
 
-public Item(String pageName, String label, String description)
+public Item(String pageName, String label, String description, 
Object... context)
 {
 this.pageName = pageName;
 this.label = label;
 this.description = description;
+   this.context = context;
 }
 
 public int compareTo(Item o)
@@ -520,7 +522,11 @@ public class Index
 
 new Item("FormLinkParameters", "FormLinkParameters Demo", 
"Form link parameters should be unescaped for a hidden field"),
 
-   new 
Item("UnknownActivationContextDemo", "Unknown Activation Context Demo", "Page 
refuse to serve if called with an unknown activation context")
+   new Item("KnownActivationContextDemo", 
"Known Activation Context Demo", "Page is displayed normally if called without 
context (TAP5-2070)",
+   "Exact"),
+
+   new 
Item("UnknownActivationContextDemo", "Unknown Activation Context Demo", "Page 
refuse to serve if called with an unknown activation context (TAP5-2070

[8/8] git commit: TAP5-2070 show new pages in main intergation test app

2013-08-05 Thread mlusetti
TAP5-2070 show new pages in main intergation test app


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/83fcdca3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/83fcdca3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/83fcdca3

Branch: refs/heads/master
Commit: 83fcdca312281c36399ed69773f55d677e05f6fd
Parents: 7de82f5
Author: Massimo Lusetti 
Authored: Mon Aug 5 19:42:33 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 19:48:15 2013 +0200

--
 tapestry-core/src/test/app1/Index.tml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/83fcdca3/tapestry-core/src/test/app1/Index.tml
--
diff --git a/tapestry-core/src/test/app1/Index.tml 
b/tapestry-core/src/test/app1/Index.tml
index a32af61..f51d4cb 100644
--- a/tapestry-core/src/test/app1/Index.tml
+++ b/tapestry-core/src/test/app1/Index.tml
@@ -32,7 +32,7 @@
 
 
 
-${item.label}
+${item.label}
 -- ${item.description}
 
 



git commit: Add some better documentation for t5/core/dom:ajaxRequest and t5/core/ajax Rename option.parameters to option.data

2013-08-05 Thread hlship
Updated Branches:
  refs/heads/master 0e2fc3605 -> 8d24cbdd2


Add some better documentation for t5/core/dom:ajaxRequest and t5/core/ajax
Rename option.parameters to option.data

Rationale: the data is only parameters for the default content type; if
the content type is changed, the data might be something else, such as
text/json content.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/8d24cbdd
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/8d24cbdd
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/8d24cbdd

Branch: refs/heads/master
Commit: 8d24cbdd2846002cf86bf4e3ca1640ec2560dfdb
Parents: 0e2fc36
Author: Howard M. Lewis Ship 
Authored: Mon Aug 5 09:51:07 2013 -0700
Committer: Howard M. Lewis Ship 
Committed: Mon Aug 5 09:51:15 2013 -0700

--
 .../coffeescript/META-INF/modules/t5/core/ajax.coffee| 11 +++
 .../META-INF/modules/t5/core/ajaxformloop.coffee |  2 +-
 .../coffeescript/META-INF/modules/t5/core/alert.coffee   |  2 +-
 .../META-INF/modules/t5/core/autocomplete.coffee |  2 +-
 .../META-INF/modules/t5/core/datefield.coffee|  4 ++--
 .../META-INF/modules/t5/core/exception-frame.coffee  |  2 +-
 .../coffeescript/META-INF/modules/t5/core/tree.coffee|  2 +-
 .../coffeescript/META-INF/modules/t5/core/zone.coffee|  2 +-
 .../org/apache/tapestry5/t5-core-dom.coffee  |  8 
 9 files changed, 23 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8d24cbdd/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
--
diff --git 
a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee 
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
index 216b633..d2c968d 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
@@ -17,6 +17,17 @@
 # Exports a single function, that invokes `t5/core/dom:ajaxRequest()` with the 
provided `url` and a modified version of the
 # `options`.
 #
+# * options.method - "post", "get", etc., default: "post".
+# * options.contentType - request content, defaults to 
"application/x-www-form-urlencoded"
+# * options.data - optional, additional key/value pairs (for the default 
content type)
+# * options.success - handler to invoke on success. Passed the ResponseWrapper 
object.
+#   Default does nothing.
+# * options.failure - handler to invoke on failure (server responds with a 
non-2xx code).
+#   Passed the response. Default will throw the exception
+# * options.exception - handler to invoke when an exception occurs (often 
means the server is unavailable).
+#   Passed the exception. Default will generate an exception message and throw 
an `Error`.
+#   Note: not really supported under jQuery, a hold-over from Prototype.
+#
 # It wraps (or provides) `success`, `exception`, and `failure` handlers, 
extended to handle a partial page render
 # response (for success), or properly log a server-side failure or client-side 
exception, including using the
 # `t5/core/exception-frame` module to display a server-side processing 
exception.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8d24cbdd/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
--
diff --git 
a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
 
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
index 1a29d1b..09f6f3b 100644
--- 
a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
+++ 
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
@@ -34,7 +34,7 @@ define ["./dom", "./events", "./console", "./ajax"],
   url = afl.attribute "data-remove-row-url"
 
   ajax url,
-parameters:
+data:
   "t:rowvalue": @attribute "data-afl-row-value"
 success: =>
   # The server has removed the row from persistent storage, lets

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8d24cbdd/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
--
diff --git 
a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee 
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
index 0466687..0a015e6 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
@@ -55,7 +55,7 @

[jira] [Commented] (TAP5-2070) Respond with a HTTP 404 if the page is activated with an activation context not explicitly supported by the page itself

2013-08-05 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13729633#comment-13729633
 ] 

Hudson commented on TAP5-2070:
--

FAILURE: Integrated in tapestry-trunk-freestyle #1125 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1125/])
TAP5-2070 actually I want to check for an exact activation handler method 
(mlusetti: rev 0e2fc3605e706c88d4c07245e9c2641cb0979bbf)
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java


> Respond with a HTTP 404 if the page is activated with an activation context 
> not explicitly supported by the page itself
> ---
>
> Key: TAP5-2070
> URL: https://issues.apache.org/jira/browse/TAP5-2070
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Massimo Lusetti
>Assignee: Massimo Lusetti
>
> The behavior from day one for pages within Tapestry is to being able to serve 
> requests that come with an activation context with more parameters that the 
> ones declared by the page itself.
> This feature lead the framework to serve requests that comes to URL which are 
> not explicitly declared by the pages, for example a page named: Super with an 
> activation event handler method like this one:
> onActivate(String character) { ... }
> will finely serve requests for:
> /super/mario
> /super/luigi
> /super/wario
> /super/waluigi
> but it will also serve requests for:
> /super/mario/luigi/wario/waluigi
> This issue is to change that behavior.
> If the page does declare a specific activation event handler method the 
> corresponding serving URLs should adhere strictly, otherwise a HTTP 404 is 
> raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: TAP5-2070 actually I want to check for an exact activation handler method

2013-08-05 Thread mlusetti
Updated Branches:
  refs/heads/master a766ff400 -> 0e2fc3605


TAP5-2070 actually I want to check for an exact activation handler method


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0e2fc360
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0e2fc360
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0e2fc360

Branch: refs/heads/master
Commit: 0e2fc3605e706c88d4c07245e9c2641cb0979bbf
Parents: a766ff4
Author: Massimo Lusetti 
Authored: Mon Aug 5 15:56:13 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 15:56:13 2013 +0200

--
 .../org/apache/tapestry5/internal/services/PageActivatorImpl.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0e2fc360/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
index 1304052..3b7742b 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
@@ -53,8 +53,7 @@ public class PageActivatorImpl implements PageActivator
boolean checkUnknown = 
metaDataLocator.findMeta(MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK,

pageResources, Boolean.class);
 
-   if ( !handled && activationContext.getCount() > 0 && 
checkUnknown &&
-   
!pageResources.getComponentModel().handleActivationEventContext())
+   if ( !handled && checkUnknown && 
!pageResources.getComponentModel().handleActivationEventContext())
{
logger.info("Page {} required an exact activation 
context, let's handle this", pageResources.getPageName());

unknownActivationContextHandler.handleUnknownContext(pageResources, 
activationContext);



git commit: fix typo

2013-08-05 Thread mlusetti
Updated Branches:
  refs/heads/master c13ed0602 -> a766ff400


fix typo


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/a766ff40
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/a766ff40
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/a766ff40

Branch: refs/heads/master
Commit: a766ff40080fea0685e56b9c42a9341c0bc83b78
Parents: c13ed06
Author: Massimo Lusetti 
Authored: Mon Aug 5 10:26:51 2013 +0200
Committer: Massimo Lusetti 
Committed: Mon Aug 5 10:26:51 2013 +0200

--
 .../java/org/apache/tapestry5/integration/app1/pages/Index.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a766ff40/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index 866ced7..a8a9fa2 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -520,7 +520,7 @@ public class Index
 
 new Item("FormLinkParameters", "FormLinkParameters Demo", 
"Form link parameters should be unescaped for a hidden field"),
 
-   new Item("UnknownAtcivationContext", 
"Unknown Activation Context Demo", "Page refuse to serve if called with an 
unknown activation context")
+   new 
Item("UnknownActivationContextDemo", "Unknown Activation Context Demo", "Page 
refuse to serve if called with an unknown activation context")
 );
 
 static