You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ml...@apache.org on 2013/08/05 19:48:33 UTC
[1/8] git commit: TAP5-2070 hook new test apps into test chain
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 <ml...@apache.org>
Authored: Mon Aug 5 19:45:03 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 @@
<package name="org.apache.tapestry5.integration.pagetester"/>
</packages>
</test>
+
+ <test name="Activation Context Tests" enabled="true">
+ <parameter name="tapestry.web-app-folder" value="src/test/activationctx"/>
+ <packages>
+ <package name="org.apache.tapestry5.integration.activationctx"/>
+ </packages>
+ </test>
+
+ <test name="Activation Context Tests 2 old behavior" enabled="true">
+ <parameter name="tapestry.web-app-folder" value="src/test/activationctx2"/>
+ <packages>
+ <package name="org.apache.tapestry5.integration.activationctx2"/>
+ </packages>
+ </test>
+
</suite>
[4/8] git commit: TAP5-2070 tests on basic check on activation
context with new annotation
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:40:41 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 <EventContext: Unwanted, 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)",
+ "Unwanted", "context")
);
static
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
index 368f159..8232ede 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
@@ -1,4 +1,4 @@
-// Copyright 2008 The Apache Software Foundation
+// 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.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
index a168227..62e787b 100644
--- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
@@ -1,10 +1,9 @@
-<html t:type="Border"
- xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
- <h1>Page called with an unknown activation context</h1>
+ <h1>Page called without activation context</h1>
<p>
You should never see me if use an activation context
</p>
-</html>
\ No newline at end of file
+</t:border>
\ No newline at end of file
[8/8] git commit: TAP5-2070 show new pages in main intergation test
app
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:42:33 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 @@
<ul>
<li t:type="loop" source="itemsForKey()" value="item">
- <t:pagelink page="prop:item.pageName">${item.label}</t:pagelink>
+ <t:pagelink page="prop:item.pageName" context="item.context">${item.label}</t:pagelink>
-- ${item.description}
</li>
</ul>
[8/8] git commit: TAP5-2070 show new pages in main intergation test
app
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:42:33 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 @@
<ul>
<li t:type="loop" source="itemsForKey()" value="item">
- <t:pagelink page="prop:item.pageName">${item.label}</t:pagelink>
+ <t:pagelink page="prop:item.pageName" context="item.context">${item.label}</t:pagelink>
-- ${item.description}
</li>
</ul>
[4/8] git commit: TAP5-2070 tests on basic check on activation
context with new annotation
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:40:41 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 <EventContext: Unwanted, 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)",
+ "Unwanted", "context")
);
static
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
index 368f159..8232ede 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.java
@@ -1,4 +1,4 @@
-// Copyright 2008 The Apache Software Foundation
+// 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.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae1d117/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
index a168227..62e787b 100644
--- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/UnknownActivationContextDemo.tml
@@ -1,10 +1,9 @@
-<html t:type="Border"
- xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
- <h1>Page called with an unknown activation context</h1>
+ <h1>Page called without activation context</h1>
<p>
You should never see me if use an activation context
</p>
-</html>
\ No newline at end of file
+</t:border>
\ No newline at end of file
[3/8] git commit: update copyright notice
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:39:04 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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.
[3/8] git commit: update copyright notice
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:39:04 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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)
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:44:27 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..45415d9
--- /dev/null
+++ b/tapestry-core/src/test/activationctx2/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Activation Context Test App 2</display-name>
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.apache.tapestry5.integration.activationctx2</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-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 0000000..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/tapestry5/integration/activationctx2/components/Layout.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java
new file mode 100644
index 0000000..f4beb15
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java
@@ -0,0 +1,19 @@
+// 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.components;
+
+public class Layout
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
new file mode 100644
index 0000000..21af37b
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
@@ -0,0 +1,19 @@
+// 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.pages;
+
+public class ContextChecked
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
new file mode 100644
index 0000000..dab867b
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
@@ -0,0 +1,22 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck(false)
+public class ContextUnchecked
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
new file mode 100644
index 0000000..ca5276a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
@@ -0,0 +1,32 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+/**
+ * TAP5-2070 Integration test index page
+ */
+@UnknownActivationContextCheck(false)
+public class Index
+{
+ public String[] getTwoValues()
+ {
+ return new String[] {
+ "One",
+ "Two"
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
new file mode 100644
index 0000000..3ff209d
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
@@ -0,0 +1,35 @@
+// 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.services;
+
+import org.apache.tapestry5.MetaDataConstants;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+
+/**
+ *
+ */
+public class AppModule
+{
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+ configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");
+
+ // Enable by default the check on activation context parameters
+ configuration.add(MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK, "true");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
new file mode 100644
index 0000000..0084db4
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
@@ -0,0 +1,21 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+ <head>
+ <title>LinkTrans: ${componentresources.pagename}</title>
+ </head>
+ <body>
+ <h1>${componentresources.pagename}</h1>
+
+ <t:body/>
+
+ <hr/>
+
+ <ul>
+ <li>
+ <t:pagelink page="index">back to index</t:pagelink>
+ </li>
+ <li>
+ <t:pagelink page="${componentResources.pageName}">refresh</t:pagelink>
+ </li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
new file mode 100644
index 0000000..2a8852d
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only without activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
new file mode 100644
index 0000000..0f20814
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see with all context you like...
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
new file mode 100644
index 0000000..c80070b
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
@@ -0,0 +1,26 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <ul>
+ <li>
+ <t:pagelink page="contextchecked">Context checked correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextchecked" context="literal:error">Context checked error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="contextunchecked">Context unchecked without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextunchecked" context="literal:one">Context unchecked with one</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextunchecked" context="twoValues">Context unchecked with two</t:pagelink>
+ </li>
+ </ul>
+
+</t:layout>
\ No newline at end of file
[6/8] git commit: TAP5-2070 new page for base tests
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:41:32 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..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 0000000..8e59be7
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
@@ -0,0 +1,13 @@
+<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+ <h1>Page called with correct activation context</h1>
+
+ <p>
+ You should never see me if use an erroneous activation context
+ </p>
+
+ <p>
+ ${activationContext}
+ </p>
+
+</t:border>
\ No newline at end of file
[7/8] git commit: TAP5-2070 new test integration app for activation
context check with inverse behavior (all enabled, some excluded)
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:44:27 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..45415d9
--- /dev/null
+++ b/tapestry-core/src/test/activationctx2/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Activation Context Test App 2</display-name>
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.apache.tapestry5.integration.activationctx2</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-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 0000000..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/tapestry5/integration/activationctx2/components/Layout.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java
new file mode 100644
index 0000000..f4beb15
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/components/Layout.java
@@ -0,0 +1,19 @@
+// 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.components;
+
+public class Layout
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
new file mode 100644
index 0000000..21af37b
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.java
@@ -0,0 +1,19 @@
+// 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.pages;
+
+public class ContextChecked
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
new file mode 100644
index 0000000..dab867b
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.java
@@ -0,0 +1,22 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck(false)
+public class ContextUnchecked
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
new file mode 100644
index 0000000..ca5276a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/pages/Index.java
@@ -0,0 +1,32 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+/**
+ * TAP5-2070 Integration test index page
+ */
+@UnknownActivationContextCheck(false)
+public class Index
+{
+ public String[] getTwoValues()
+ {
+ return new String[] {
+ "One",
+ "Two"
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
new file mode 100644
index 0000000..3ff209d
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx2/services/AppModule.java
@@ -0,0 +1,35 @@
+// 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.services;
+
+import org.apache.tapestry5.MetaDataConstants;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+
+/**
+ *
+ */
+public class AppModule
+{
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+ configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");
+
+ // Enable by default the check on activation context parameters
+ configuration.add(MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK, "true");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
new file mode 100644
index 0000000..0084db4
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/components/Layout.tml
@@ -0,0 +1,21 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+ <head>
+ <title>LinkTrans: ${componentresources.pagename}</title>
+ </head>
+ <body>
+ <h1>${componentresources.pagename}</h1>
+
+ <t:body/>
+
+ <hr/>
+
+ <ul>
+ <li>
+ <t:pagelink page="index">back to index</t:pagelink>
+ </li>
+ <li>
+ <t:pagelink page="${componentResources.pageName}">refresh</t:pagelink>
+ </li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
new file mode 100644
index 0000000..2a8852d
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextChecked.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only without activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
new file mode 100644
index 0000000..0f20814
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/ContextUnchecked.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see with all context you like...
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2d5fb4b7/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
new file mode 100644
index 0000000..c80070b
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx2/pages/Index.tml
@@ -0,0 +1,26 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <ul>
+ <li>
+ <t:pagelink page="contextchecked">Context checked correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextchecked" context="literal:error">Context checked error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="contextunchecked">Context unchecked without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextunchecked" context="literal:one">Context unchecked with one</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="contextunchecked" context="twoValues">Context unchecked with two</t:pagelink>
+ </li>
+ </ul>
+
+</t:layout>
\ No newline at end of file
[2/8] git commit: TAP5-2070 new test integration app for activation
context check
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:43:46 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..d42a684
--- /dev/null
+++ b/tapestry-core/src/test/activationctx/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Activation Context Test App</display-name>
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.apache.tapestry5.integration.activationctx</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-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 0000000..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 404");
+ }
+
+ @Test
+ public void two_context_with_one()
+ {
+ openLinks("Two context error");
+
+ assertTextPresent("HTTP ERROR 404");
+ }
+
+ @Test
+ public void two_context_with_two()
+ {
+ openLinks("Two context correct");
+
+ assertTextPresent("You are able to see me only with two parameters in the activation context");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
new file mode 100644
index 0000000..1caa518
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
@@ -0,0 +1,19 @@
+// 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.components;
+
+public class Layout
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
new file mode 100644
index 0000000..39dc050
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
@@ -0,0 +1,30 @@
+// 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.pages;
+
+/**
+ * TAP5-2070 Integration test index page
+ */
+public class Index
+{
+
+ public String[] getTwoValues()
+ {
+ return new String[] {
+ "One",
+ "Two"
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
new file mode 100644
index 0000000..9492f74
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
@@ -0,0 +1,23 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class NoContext
+{
+
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
new file mode 100644
index 0000000..e49070a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
@@ -0,0 +1,25 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.PageActivationContext;
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class OneContext
+{
+ @PageActivationContext
+ private String activationContext;
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
new file mode 100644
index 0000000..74f73a8
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
@@ -0,0 +1,26 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class TwoContext
+{
+ void onActivate(String one, String two)
+ {
+ // Do some nifty stuff...
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
new file mode 100644
index 0000000..4d4541a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
@@ -0,0 +1,30 @@
+// 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.services;
+
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+
+/**
+ *
+ */
+public class AppModule
+{
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
new file mode 100644
index 0000000..0084db4
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
@@ -0,0 +1,21 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+ <head>
+ <title>LinkTrans: ${componentresources.pagename}</title>
+ </head>
+ <body>
+ <h1>${componentresources.pagename}</h1>
+
+ <t:body/>
+
+ <hr/>
+
+ <ul>
+ <li>
+ <t:pagelink page="index">back to index</t:pagelink>
+ </li>
+ <li>
+ <t:pagelink page="${componentResources.pageName}">refresh</t:pagelink>
+ </li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
new file mode 100644
index 0000000..d6fc3f7
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
@@ -0,0 +1,39 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <ul>
+ <li>
+ <t:pagelink page="nocontext">No context correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="nocontext" context="literal:one">No context error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="onecontext">One context without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="onecontext" context="literal:one">One context correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="onecontext" context="twoValues">One context error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="twocontext">Two context without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="twocontext" context="literal:one">Two context error</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="twocontext" context="twoValues">Two context correct</t:pagelink>
+ </li>
+ </ul>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
new file mode 100644
index 0000000..2a8852d
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only without activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
new file mode 100644
index 0000000..a1ce81a
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only with one parameter in the activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
new file mode 100644
index 0000000..cf24c2a
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only with two parameters in the activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
[2/8] git commit: TAP5-2070 new test integration app for activation
context check
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:43:46 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..d42a684
--- /dev/null
+++ b/tapestry-core/src/test/activationctx/WEB-INF/web.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Activation Context Test App</display-name>
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.apache.tapestry5.integration.activationctx</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-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 0000000..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 404");
+ }
+
+ @Test
+ public void two_context_with_one()
+ {
+ openLinks("Two context error");
+
+ assertTextPresent("HTTP ERROR 404");
+ }
+
+ @Test
+ public void two_context_with_two()
+ {
+ openLinks("Two context correct");
+
+ assertTextPresent("You are able to see me only with two parameters in the activation context");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
new file mode 100644
index 0000000..1caa518
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/components/Layout.java
@@ -0,0 +1,19 @@
+// 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.components;
+
+public class Layout
+{
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
new file mode 100644
index 0000000..39dc050
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/Index.java
@@ -0,0 +1,30 @@
+// 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.pages;
+
+/**
+ * TAP5-2070 Integration test index page
+ */
+public class Index
+{
+
+ public String[] getTwoValues()
+ {
+ return new String[] {
+ "One",
+ "Two"
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
new file mode 100644
index 0000000..9492f74
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/NoContext.java
@@ -0,0 +1,23 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class NoContext
+{
+
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
new file mode 100644
index 0000000..e49070a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/OneContext.java
@@ -0,0 +1,25 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.PageActivationContext;
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class OneContext
+{
+ @PageActivationContext
+ private String activationContext;
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
new file mode 100644
index 0000000..74f73a8
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/pages/TwoContext.java
@@ -0,0 +1,26 @@
+// 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.pages;
+
+import org.apache.tapestry5.annotations.UnknownActivationContextCheck;
+
+@UnknownActivationContextCheck
+public class TwoContext
+{
+ void onActivate(String one, String two)
+ {
+ // Do some nifty stuff...
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
new file mode 100644
index 0000000..4d4541a
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/activationctx/services/AppModule.java
@@ -0,0 +1,30 @@
+// 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.services;
+
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+
+/**
+ *
+ */
+public class AppModule
+{
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
new file mode 100644
index 0000000..0084db4
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/components/Layout.tml
@@ -0,0 +1,21 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+ <head>
+ <title>LinkTrans: ${componentresources.pagename}</title>
+ </head>
+ <body>
+ <h1>${componentresources.pagename}</h1>
+
+ <t:body/>
+
+ <hr/>
+
+ <ul>
+ <li>
+ <t:pagelink page="index">back to index</t:pagelink>
+ </li>
+ <li>
+ <t:pagelink page="${componentResources.pageName}">refresh</t:pagelink>
+ </li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
new file mode 100644
index 0000000..d6fc3f7
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/Index.tml
@@ -0,0 +1,39 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <ul>
+ <li>
+ <t:pagelink page="nocontext">No context correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="nocontext" context="literal:one">No context error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="onecontext">One context without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="onecontext" context="literal:one">One context correct</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="onecontext" context="twoValues">One context error</t:pagelink>
+ </li>
+
+
+ <li>
+ <t:pagelink page="twocontext">Two context without</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="twocontext" context="literal:one">Two context error</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="twocontext" context="twoValues">Two context correct</t:pagelink>
+ </li>
+ </ul>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
new file mode 100644
index 0000000..2a8852d
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/NoContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only without activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
new file mode 100644
index 0000000..a1ce81a
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/OneContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only with one parameter in the activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e058593/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
new file mode 100644
index 0000000..cf24c2a
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/activationctx/pages/TwoContext.tml
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are able to see me only with two parameters in the activation context
+ </p>
+
+</t:layout>
\ No newline at end of file
[5/8] git commit: TAP5-2070 better to take no activation handler
method as a way to accept empty activation context
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 18:17:02 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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);
[5/8] git commit: TAP5-2070 better to take no activation handler
method as a way to accept empty activation context
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 18:17:02 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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
Posted by ml...@apache.org.
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 <ml...@apache.org>
Authored: Mon Aug 5 19:41:32 2013 +0200
Committer: Massimo Lusetti <ml...@apache.org>
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 0000000..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 0000000..8e59be7
--- /dev/null
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/KnownActivationContextDemo.tml
@@ -0,0 +1,13 @@
+<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+ <h1>Page called with correct activation context</h1>
+
+ <p>
+ You should never see me if use an erroneous activation context
+ </p>
+
+ <p>
+ ${activationContext}
+ </p>
+
+</t:border>
\ No newline at end of file