You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/06/28 10:53:48 UTC
[1/9] git commit: Changed defaultIgnoredPackages to a Set added
varargs into the add and remove calls for the ignore packages
Updated Branches:
refs/heads/5257-css-settings 5ac5a36a9 -> abdf5c3ad
Changed defaultIgnoredPackages to a Set added varargs into the add and remove calls for the ignore packages
Updated ignorePackages to a set to filter non unique Strings. Changed
the add and remove signatures to support vararg Strings for convenience.
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0dbcc4fc
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0dbcc4fc
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0dbcc4fc
Branch: refs/heads/5257-css-settings
Commit: 0dbcc4fc097881cadbde617667ccda4189605554
Parents: 42d85ea
Author: John Sarman <jo...@gmail.com>
Authored: Thu Jun 27 06:33:14 2013 -0400
Committer: John Sarman <jo...@gmail.com>
Committed: Thu Jun 27 06:33:14 2013 -0400
----------------------------------------------------------------------
.../org/apache/wicket/cdi/CdiConfiguration.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/0dbcc4fc/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
index 96371c1..667b1a9 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
@@ -16,10 +16,10 @@
*/
package org.apache.wicket.cdi;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
-import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.spi.CreationalContext;
@@ -81,12 +81,12 @@ public class CdiConfiguration
private boolean injectBehaviors = true;
private boolean autoConversationManagement = false;
private boolean configured = false;
- private List<String> ignoredPackages;
+ private Set<String> ignoredPackages;
@PostConstruct
public void init()
{
- ignoredPackages = new ArrayList<>();
+ ignoredPackages = new TreeSet<>();
ignoredPackages.addAll(Arrays.asList(defaultIgnoredPackages));
}
@@ -199,14 +199,14 @@ public class CdiConfiguration
return ignoredPackages.toArray(ignore);
}
- public void addPackageToIgnore(String packageName )
+ public void addPackagesToIgnore(String ... packageNames )
{
- ignoredPackages.add(packageName);
+ ignoredPackages.addAll(Arrays.asList(packageNames));
}
- public void removePackageToIgnore(String packageName)
+ public void removePackageToIgnore(String ... packageNames)
{
- ignoredPackages.remove(packageName);
+ ignoredPackages.removeAll(Arrays.asList(packageNames));
}
/**
[6/9] git commit: Upgrade Jetty9
Posted by mg...@apache.org.
Upgrade Jetty9
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c66b1674
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c66b1674
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c66b1674
Branch: refs/heads/5257-css-settings
Commit: c66b1674c080cd643e9dfbdf5a52bce21feaf514
Parents: 0d134f5
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jun 28 09:40:46 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jun 28 09:40:46 2013 +0300
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/c66b1674/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6967ad6..8f9389f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mvn.build.java.version>1.7</mvn.build.java.version>
<jetty.version>8.1.11.v20130520</jetty.version>
- <jetty9.version>9.0.3.v20130506</jetty9.version>
+ <jetty9.version>9.0.4.v20130625</jetty9.version>
<spring.version>3.2.3.RELEASE</spring.version>
<servlet-api.version>3.0.1</servlet-api.version>
<maven.javadoc.version>2.8.1</maven.javadoc.version>
[2/9] git commit: Merge remote-tracking branch 'upstream/master' into
cdi-1.1-experimental
Posted by mg...@apache.org.
Merge remote-tracking branch 'upstream/master' into cdi-1.1-experimental
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a7fd8502
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a7fd8502
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a7fd8502
Branch: refs/heads/5257-css-settings
Commit: a7fd8502fa7914a8aeb8727c950c0cb863ba6dd0
Parents: 0dbcc4f 8076947
Author: John Sarman <jo...@gmail.com>
Authored: Thu Jun 27 06:46:13 2013 -0400
Committer: John Sarman <jo...@gmail.com>
Committed: Thu Jun 27 06:46:13 2013 -0400
----------------------------------------------------------------------
wicket-examples/pom.xml | 23 +++----------
.../wicket/examples/cdi/CdiApplication.java | 13 +++----
wicket-examples/src/main/webapp/WEB-INF/web.xml | 36 +++++++++++---------
wicket-experimental/wicket-cdi-1.1/pom.xml | 2 +-
.../wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml | 34 ++----------------
.../apache/wicket/cdi/AbstractCdiContainer.java | 5 ++-
.../cdi/ConversationExpiredException.java | 6 ++--
.../wicket/cdi/ComponentInjectorTest.java | 9 -----
.../wicket/cdi/weld/WeldCdiContainer.java | 6 ++--
9 files changed, 39 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
[7/9] git commit: Merge branch 'cdi-1.1-experimental' of
https://github.com/jsarman/wicket into cdi-1.1-tests
Posted by mg...@apache.org.
Merge branch 'cdi-1.1-experimental' of https://github.com/jsarman/wicket into cdi-1.1-tests
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6a3d865a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6a3d865a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6a3d865a
Branch: refs/heads/5257-css-settings
Commit: 6a3d865af097b1039704386ef1fa3f90318df4ff
Parents: c66b167 73d7cb4
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jun 28 09:41:34 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jun 28 09:41:34 2013 +0300
----------------------------------------------------------------------
wicket-examples/pom.xml | 2 +-
wicket-experimental/wicket-cdi-1.1/pom.xml | 2 +-
.../wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml | 10 +-
.../org/apache/wicket/cdi/AbstractInjector.java | 5 +
.../org/apache/wicket/cdi/CdiConfiguration.java | 90 +++++++------
.../wicket/cdi/ConversationPropagator.java | 9 ++
.../apache/wicket/cdi/CdiConfigurationTest.java | 125 +++++++++++++++++++
.../wicket/cdi/ComponentInjectorTest.java | 112 +++++++++++------
.../org/apache/wicket/cdi/MockContainer.java | 70 +++++++++++
.../apache/wicket/cdi/testapp/TestAppScope.java | 41 ++++++
.../wicket/cdi/testapp/TestApplication.java | 43 +++++++
.../cdi/testapp/TestConversationBean.java | 42 +++++++
.../cdi/testapp/TestConversationPage.html | 12 ++
.../cdi/testapp/TestConversationPage.java | 66 ++++++++++
.../org/apache/wicket/cdi/testapp/TestPage.html | 10 ++
.../org/apache/wicket/cdi/testapp/TestPage.java | 39 ++++++
.../wicket/cdi/testapp/TestQualifier.java | 36 ++++++
.../wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml | 6 +-
18 files changed, 630 insertions(+), 90 deletions(-)
----------------------------------------------------------------------
[4/9] git commit: Added return CdiConfiguration new config calls
Posted by mg...@apache.org.
Added return CdiConfiguration new config calls
Formatted File and added return CdiConfiguration to match rest of
configuration setters.
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/265934a9
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/265934a9
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/265934a9
Branch: refs/heads/5257-css-settings
Commit: 265934a9870b686d76b44a483a00836abbc6cdc4
Parents: 434a708
Author: John Sarman <jo...@gmail.com>
Authored: Thu Jun 27 16:07:08 2013 -0400
Committer: John Sarman <jo...@gmail.com>
Committed: Thu Jun 27 16:07:08 2013 -0400
----------------------------------------------------------------------
.../org/apache/wicket/cdi/CdiConfiguration.java | 78 +++++++++++---------
1 file changed, 44 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/265934a9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
index 3f82585..a7175f0 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
+
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.spi.CreationalContext;
@@ -35,25 +36,24 @@ import org.apache.wicket.request.cycle.RequestCycleListenerCollection;
/**
* Configures CDI integration
- *
+ *
* @author igor
- *
*/
@ApplicationScoped
public class CdiConfiguration
{
private static final String[] defaultIgnoredPackages = new String[]
- {
- "org.apache.wicket.markup",
- "org.apache.wicket.protocol.http",
- "org.apache.wicket.behavior",
- };
-
+ {
+ "org.apache.wicket.markup",
+ "org.apache.wicket.protocol.http",
+ "org.apache.wicket.behavior",
+ };
+
private IConversationPropagation propagation = ConversationPropagation.NONBOOKMARKABLE;
@Inject
BeanManager beanManager;
-
+
@Inject
INonContextualManager nonContextualManager;
@@ -65,7 +65,7 @@ public class CdiConfiguration
@Inject
Instance<DetachEventEmitter> detachEventEmitterSource;
-
+
@Inject
BehaviorInjector behaviorInjector;
@@ -74,7 +74,7 @@ public class CdiConfiguration
@Inject
SessionInjector sessionInjector;
-
+
private boolean injectComponents = true;
private boolean injectApplication = true;
private boolean injectSession = true;
@@ -89,10 +89,10 @@ public class CdiConfiguration
ignoredPackages = new TreeSet<>();
ignoredPackages.addAll(Arrays.asList(defaultIgnoredPackages));
}
-
+
/**
* Gets the configured bean manager
- *
+ *
* @return bean manager or {@code null} if none
*/
public BeanManager getBeanManager()
@@ -100,7 +100,10 @@ public class CdiConfiguration
return beanManager;
}
- public @Produces @Propagation IConversationPropagation getPropagation()
+ public
+ @Produces
+ @Propagation
+ IConversationPropagation getPropagation()
{
return propagation;
}
@@ -109,26 +112,28 @@ public class CdiConfiguration
* Checks if auto conversation management is enabled. See
* {@link #setAutoConversationManagement(boolean)} for details.
*/
- public @Produces @Auto Boolean isAutoConversationManagement()
+ public
+ @Produces
+ @Auto
+ Boolean isAutoConversationManagement()
{
return autoConversationManagement;
}
/**
* Toggles automatic conversation management feature.
- *
+ * <p/>
* Automatic conversation management controls the lifecycle of the conversation based on
* presence of components implementing the {@link ConversationalComponent} interface. If such
* components are found in the page a conversation is marked persistent, and if they are not the
* conversation is marked transient. This greatly simplifies the management of conversation
* lifecycle.
- *
+ * <p/>
* Sometimes it is necessary to manually control the application. For these cases, once a
* conversation is started {@link AutoConversation} bean can be used to mark the conversation as
* manually-managed.
- *
+ *
* @param enabled
- *
* @return {@code this} for easy chaining
*/
public CdiConfiguration setAutoConversationManagement(boolean enabled)
@@ -148,7 +153,7 @@ public class CdiConfiguration
return nonContextualManager;
}
-
+
public boolean isInjectComponents()
{
return injectComponents;
@@ -193,44 +198,49 @@ public class CdiConfiguration
return this;
}
- public @Produces @IgnoreList String[] getPackagesToIgnore()
+ public
+ @Produces
+ @IgnoreList
+ String[] getPackagesToIgnore()
{
String[] ignore = new String[ignoredPackages.size()];
return ignoredPackages.toArray(ignore);
}
- public void addPackagesToIgnore(String ... packageNames )
+ public CdiConfiguration addPackagesToIgnore(String... packageNames)
{
ignoredPackages.addAll(Arrays.asList(packageNames));
+ return this;
}
- public void removePackagesToIgnore(String ... packageNames)
+ public CdiConfiguration removePackagesToIgnore(String... packageNames)
{
ignoredPackages.removeAll(Arrays.asList(packageNames));
+ return this;
}
/**
* Configures the specified application
- *
+ *
* @param application
* @return
*/
public synchronized void configure(Application application)
- {
- if(configured)
+ {
+ if (configured)
{
throw new IllegalStateException("Cannot configure CdiConfiguration multiple times");
}
-
+
RequestCycleListenerCollection listeners = new RequestCycleListenerCollection();
application.getRequestCycleListeners().add(listeners);
// enable conversation propagation
if (getPropagation() != ConversationPropagation.NONE)
- {
+ {
listeners.add(conversationPropagatorSource.get());
application.getComponentPreOnBeforeRenderListeners().add(
- conversationExpiryCheckerSource.get());
+ conversationExpiryCheckerSource.get());
}
// enable detach event
@@ -263,23 +273,23 @@ public class CdiConfiguration
// enable cleanup
application.getApplicationListeners().add(
- new CdiShutdownCleaner(isInjectApplication()));
+ new CdiShutdownCleaner(isInjectApplication()));
configured = true;
}
-
+
public static CdiConfiguration get()
{
- BeanManager beanManager = CDI.current().getBeanManager();
- Iterator<Bean< ? >> iter = beanManager.getBeans(CdiConfiguration.class).iterator();
+ BeanManager beanManager = CDI.current().getBeanManager();
+ Iterator<Bean<?>> iter = beanManager.getBeans(CdiConfiguration.class).iterator();
if (!iter.hasNext())
{
throw new IllegalStateException("CDI BeanManager cannot find CdiConfiguration");
}
Bean<CdiConfiguration> bean = (Bean<CdiConfiguration>) iter.next();
CreationalContext<CdiConfiguration> ctx = beanManager.createCreationalContext(bean);
- return (CdiConfiguration) beanManager.getReference(bean, CdiConfiguration.class, ctx);
+ return (CdiConfiguration) beanManager.getReference(bean, CdiConfiguration.class, ctx);
}
}
[9/9] git commit: Merge branch 'master' into 5257-css-settings
Posted by mg...@apache.org.
Merge branch 'master' into 5257-css-settings
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/abdf5c3a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/abdf5c3a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/abdf5c3a
Branch: refs/heads/5257-css-settings
Commit: abdf5c3ad6fdb662e2370918818f1f3a0ca69445
Parents: 5ac5a36 f5d586b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jun 28 11:53:32 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jun 28 11:53:32 2013 +0300
----------------------------------------------------------------------
pom.xml | 2 +-
wicket-examples/pom.xml | 2 +-
wicket-experimental/wicket-cdi-1.1/pom.xml | 2 +-
.../wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml | 10 +--
.../org/apache/wicket/cdi/AbstractInjector.java | 5 ++
.../org/apache/wicket/cdi/CdiConfiguration.java | 90 ++++++++++---------
.../wicket/cdi/ConversationPropagator.java | 9 ++
.../apache/wicket/cdi/CdiConfigurationTest.java | 77 ++++++++++++++++
.../wicket/cdi/ComponentInjectorTest.java | 94 ++++++++------------
.../org/apache/wicket/cdi/MockCdiContainer.java | 70 +++++++++++++++
.../apache/wicket/cdi/WicketCdiTestCase.java | 78 ++++++++++++++++
.../apache/wicket/cdi/testapp/TestAppScope.java | 41 +++++++++
.../wicket/cdi/testapp/TestApplication.java | 43 +++++++++
.../cdi/testapp/TestConversationBean.java | 42 +++++++++
.../cdi/testapp/TestConversationPage.html | 12 +++
.../cdi/testapp/TestConversationPage.java | 66 ++++++++++++++
.../org/apache/wicket/cdi/testapp/TestPage.html | 10 +++
.../org/apache/wicket/cdi/testapp/TestPage.java | 39 ++++++++
.../wicket/cdi/testapp/TestQualifier.java | 36 ++++++++
.../wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml | 6 +-
20 files changed, 624 insertions(+), 110 deletions(-)
----------------------------------------------------------------------
[8/9] git commit: Rename MockContainer to MockCdiContainer. Extract
base test case for CDI tests
Posted by mg...@apache.org.
Rename MockContainer to MockCdiContainer.
Extract base test case for CDI tests
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f5d586b9
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f5d586b9
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f5d586b9
Branch: refs/heads/5257-css-settings
Commit: f5d586b9b039a4b16e6e856f1a5d9947ce737074
Parents: 6a3d865
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jun 28 10:03:42 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jun 28 10:03:42 2013 +0300
----------------------------------------------------------------------
.../apache/wicket/cdi/CdiConfigurationTest.java | 52 +------------
.../wicket/cdi/ComponentInjectorTest.java | 60 +--------------
.../org/apache/wicket/cdi/MockCdiContainer.java | 70 ++++++++++++++++++
.../org/apache/wicket/cdi/MockContainer.java | 70 ------------------
.../apache/wicket/cdi/WicketCdiTestCase.java | 78 ++++++++++++++++++++
5 files changed, 152 insertions(+), 178 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/f5d586b9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
index 2461e05..5b0bed6 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
@@ -17,69 +17,21 @@
package org.apache.wicket.cdi;
import javax.inject.Inject;
-import javax.servlet.http.HttpServletRequest;
import org.apache.wicket.cdi.testapp.TestAppScope;
-import org.apache.wicket.cdi.testapp.TestApplication;
import org.apache.wicket.cdi.testapp.TestConversationBean;
import org.apache.wicket.cdi.testapp.TestConversationPage;
-import org.apache.wicket.util.tester.WicketTester;
import org.jglue.cdiunit.AdditionalClasses;
-import org.jglue.cdiunit.CdiRunner;
-import org.jglue.cdiunit.ContextController;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
/**
* @author jsarman
*/
-@RunWith(CdiRunner.class)
-@AdditionalClasses({BehaviorInjector.class,
- CdiConfiguration.class,
- CdiShutdownCleaner.class,
- ComponentInjector.class,
- ConversationExpiryChecker.class,
- ConversationPropagator.class,
- DetachEventEmitter.class,
- NonContextualManager.class,
- SessionInjector.class,
- MockContainer.class,
- TestAppScope.class,
- TestConversationBean.class})
-public class CdiConfigurationTest extends Assert
+@AdditionalClasses({TestAppScope.class, TestConversationBean.class})
+public class CdiConfigurationTest extends WicketCdiTestCase
{
-
- private WicketTester tester;
- @Inject
- ContextController contextController;
@Inject
ConversationPropagator conversationPropagator;
- @Inject
- ComponentInjector componentInjector;
-
- @Before
- public void before()
- {
- tester = new WicketTester(new TestApplication());
- prepareRequest(tester.getRequest());
- }
-
- @After
- public void after()
- {
- tester.destroy();
- tester = null;
- }
-
- public void prepareRequest(HttpServletRequest request)
- {
- contextController.openRequest(request);
- contextController.openSession(request);
- contextController.openConversation(request);
- }
@Test
public void testApplicationScope()
http://git-wip-us.apache.org/repos/asf/wicket/blob/f5d586b9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
index fb1210e..e093ae2 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
@@ -17,82 +17,26 @@
package org.apache.wicket.cdi;
import javax.inject.Inject;
-import javax.servlet.http.HttpServletRequest;
import org.apache.wicket.cdi.testapp.TestAppScope;
-import org.apache.wicket.cdi.testapp.TestApplication;
import org.apache.wicket.cdi.testapp.TestConversationBean;
-import org.apache.wicket.cdi.testapp.TestConversationPage;
import org.apache.wicket.cdi.testapp.TestQualifier;
-
import org.apache.wicket.markup.html.WebComponent;
-import org.apache.wicket.util.tester.WicketTester;
import org.jglue.cdiunit.AdditionalClasses;
-import org.jglue.cdiunit.CdiRunner;
-import org.jglue.cdiunit.ContextController;
-import org.junit.After;
-import org.junit.Assert;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
/**
* Tests for ComponentInjector
*/
-@RunWith(CdiRunner.class)
-@AdditionalClasses({
- BehaviorInjector.class,
- CdiConfiguration.class,
- CdiShutdownCleaner.class,
- ComponentInjector.class,
- ConversationExpiryChecker.class,
- ConversationPropagator.class,
- DetachEventEmitter.class,
- NonContextualManager.class,
- SessionInjector.class,
- MockContainer.class,
- TestAppScope.class,
- TestConversationBean.class})
-public class ComponentInjectorTest extends Assert
+@AdditionalClasses({TestAppScope.class, TestConversationBean.class})
+public class ComponentInjectorTest extends WicketCdiTestCase
{
-
- private WicketTester tester;
- @Inject
- ContextController contextController;
- @Inject
- ComponentInjector componentInjector;
-
- @Before
- public void before()
- {
- tester = new WicketTester(new TestApplication());
- prepareRequest(tester.getRequest());
- }
-
- @After
- public void after()
- {
- tester.destroy();
- tester = null;
- }
-
- public void prepareRequest(HttpServletRequest request)
- {
- contextController.openRequest(request);
- contextController.openSession(request);
- contextController.openConversation(request);
- }
-
/**
* https://issues.apache.org/jira/browse/WICKET-5226
*/
@Test
public void innerNonStaticClass()
{
-
TestNonStaticComponent component = new TestNonStaticComponent("someId");
assertNull(component.dependency);
componentInjector.onInstantiation(component);
http://git-wip-us.apache.org/repos/asf/wicket/blob/f5d586b9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockCdiContainer.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockCdiContainer.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockCdiContainer.java
new file mode 100644
index 0000000..92977ca
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockCdiContainer.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.jboss.weld.context.http.HttpConversationContext;
+
+/**
+ * @author jsarman
+ */
+@ApplicationScoped
+public class MockCdiContainer extends AbstractCdiContainer
+{
+
+ @Inject
+ private Instance<HttpConversationContext> conversationContextSource;
+
+ @Override
+ public void deactivateConversationalContext(RequestCycle cycle)
+ {
+ HttpConversationContext conversationContext = conversationContextSource.get();
+ conversationContext.deactivate();
+ conversationContext.dissociate(getRequest(cycle));
+ }
+
+ /**
+ * Activates the conversational context and starts the conversation with the
+ * specified cid
+ *
+ * @param cycle
+ * @param cid
+ */
+ @Override
+ public void activateConversationalContext(RequestCycle cycle, String cid)
+ {
+ HttpConversationContext conversationContext = conversationContextSource.get();
+ conversationContext.associate(getRequest(cycle));
+ if (conversationContext.isActive())
+ {
+ // Only reactivate if transient and cid is set
+ if (conversationContext.getCurrentConversation().isTransient()
+ && cid != null && !cid.isEmpty())
+ {
+ conversationContext.deactivate();
+ conversationContext.activate(cid);
+ }
+ } else
+ {
+ conversationContext.activate(cid);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/f5d586b9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
deleted file mode 100644
index dc1ddd1..0000000
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.wicket.cdi;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-
-import org.apache.wicket.request.cycle.RequestCycle;
-import org.jboss.weld.context.http.HttpConversationContext;
-
-/**
- * @author jsarman
- */
-@ApplicationScoped
-public class MockContainer extends AbstractCdiContainer
-{
-
- @Inject
- private Instance<HttpConversationContext> conversationContextSource;
-
- @Override
- public void deactivateConversationalContext(RequestCycle cycle)
- {
- HttpConversationContext conversationContext = conversationContextSource.get();
- conversationContext.deactivate();
- conversationContext.dissociate(getRequest(cycle));
- }
-
- /**
- * Activates the conversational context and starts the conversation with the
- * specified cid
- *
- * @param cycle
- * @param cid
- */
- @Override
- public void activateConversationalContext(RequestCycle cycle, String cid)
- {
- HttpConversationContext conversationContext = conversationContextSource.get();
- conversationContext.associate(getRequest(cycle));
- if (conversationContext.isActive())
- {
- // Only reactivate if transient and cid is set
- if (conversationContext.getCurrentConversation().isTransient()
- && cid != null && !cid.isEmpty())
- {
- conversationContext.deactivate();
- conversationContext.activate(cid);
- }
- } else
- {
- conversationContext.activate(cid);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/wicket/blob/f5d586b9/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/WicketCdiTestCase.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/WicketCdiTestCase.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/WicketCdiTestCase.java
new file mode 100644
index 0000000..6d66c29
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/WicketCdiTestCase.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi;
+
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.wicket.cdi.testapp.TestApplication;
+import org.apache.wicket.util.tester.WicketTester;
+import org.jglue.cdiunit.AdditionalClasses;
+import org.jglue.cdiunit.CdiRunner;
+import org.jglue.cdiunit.ContextController;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+
+/**
+ * Base class for all CDI unit tests
+ */
+@RunWith(CdiRunner.class)
+@AdditionalClasses({
+ BehaviorInjector.class,
+ CdiConfiguration.class,
+ CdiShutdownCleaner.class,
+ ComponentInjector.class,
+ ConversationExpiryChecker.class,
+ ConversationPropagator.class,
+ DetachEventEmitter.class,
+ NonContextualManager.class,
+ SessionInjector.class,
+ MockCdiContainer.class})
+public class WicketCdiTestCase extends Assert
+{
+ protected WicketTester tester;
+
+ @Inject
+ protected ContextController contextController;
+
+ @Inject
+ protected ComponentInjector componentInjector;
+
+ @Before
+ public void before()
+ {
+ tester = new WicketTester(new TestApplication());
+ prepareRequest(tester.getRequest());
+ }
+
+ @After
+ public void after()
+ {
+ tester.destroy();
+ tester = null;
+ }
+
+ private void prepareRequest(HttpServletRequest request)
+ {
+ contextController.openRequest(request);
+ contextController.openSession(request);
+ contextController.openConversation(request);
+ }
+
+}
[3/9] git commit: Updated CdiConfiguration and added Unit Tests
Posted by mg...@apache.org.
Updated CdiConfiguration and added Unit Tests
Changed method signature for add|removePackagesToIgnore and made it
accept vararg String. Added unit tests based on JGlue. Thanks Martin
excellent suggestion. Updated version to 0.2-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/434a7089
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/434a7089
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/434a7089
Branch: refs/heads/5257-css-settings
Commit: 434a7089701ca4294260f8a2319d904c4332e2ce
Parents: a7fd850
Author: John Sarman <jo...@gmail.com>
Authored: Thu Jun 27 15:57:14 2013 -0400
Committer: John Sarman <jo...@gmail.com>
Committed: Thu Jun 27 15:57:14 2013 -0400
----------------------------------------------------------------------
wicket-examples/pom.xml | 2 +-
wicket-experimental/wicket-cdi-1.1/pom.xml | 2 +-
.../wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml | 10 +-
.../org/apache/wicket/cdi/AbstractInjector.java | 5 +
.../org/apache/wicket/cdi/CdiConfiguration.java | 2 +-
.../wicket/cdi/ConversationPropagator.java | 9 ++
.../apache/wicket/cdi/CdiConfigurationTest.java | 125 +++++++++++++++++++
.../wicket/cdi/ComponentInjectorTest.java | 112 +++++++++++------
.../org/apache/wicket/cdi/MockContainer.java | 70 +++++++++++
.../apache/wicket/cdi/testapp/TestAppScope.java | 41 ++++++
.../wicket/cdi/testapp/TestApplication.java | 43 +++++++
.../cdi/testapp/TestConversationBean.java | 42 +++++++
.../cdi/testapp/TestConversationPage.html | 12 ++
.../cdi/testapp/TestConversationPage.java | 66 ++++++++++
.../org/apache/wicket/cdi/testapp/TestPage.html | 10 ++
.../org/apache/wicket/cdi/testapp/TestPage.java | 39 ++++++
.../wicket/cdi/testapp/TestQualifier.java | 36 ++++++
.../wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml | 6 +-
18 files changed, 581 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-examples/pom.xml
----------------------------------------------------------------------
diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml
index 699886f..f280d00 100644
--- a/wicket-examples/pom.xml
+++ b/wicket-examples/pom.xml
@@ -134,7 +134,7 @@
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-cdi-1.1-weld</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/pom.xml
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/pom.xml b/wicket-experimental/wicket-cdi-1.1/pom.xml
index c0f9995..4f578f0 100644
--- a/wicket-experimental/wicket-cdi-1.1/pom.xml
+++ b/wicket-experimental/wicket-cdi-1.1/pom.xml
@@ -24,7 +24,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wicket-cdi-1.1</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Wicket CDI 1.1</name>
<description>Wicket CDI 1.1 Parent.</description>
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml
index d46b0ae..dd2106e 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/pom.xml
@@ -20,12 +20,12 @@
<parent>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-cdi-1.1</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wicket-cdi-1.1-core</artifactId>
<packaging>jar</packaging>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
<name>Wicket CDI 1.1 Core</name>
<description>
Provides integration between Wicket and CDI containers. Enables injection of
@@ -49,9 +49,9 @@
<artifactId>junit</artifactId>
</dependency>
<dependency>
- <groupId>javax.el</groupId>
- <artifactId>javax.el-api</artifactId>
- <version>2.2.4</version>
+ <groupId>org.jglue.cdi-unit</groupId>
+ <artifactId>cdi-unit</artifactId>
+ <version>2.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/AbstractInjector.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/AbstractInjector.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/AbstractInjector.java
index 63523f4..139606e 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/AbstractInjector.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/AbstractInjector.java
@@ -80,4 +80,9 @@ class AbstractInjector <T>
}
+ public String[] getIgnorePackages()
+ {
+ return ignorePackages.get();
+ }
+
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
index 667b1a9..3f82585 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java
@@ -204,7 +204,7 @@ public class CdiConfiguration
ignoredPackages.addAll(Arrays.asList(packageNames));
}
- public void removePackageToIgnore(String ... packageNames)
+ public void removePackagesToIgnore(String ... packageNames)
{
ignoredPackages.removeAll(Arrays.asList(packageNames));
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/ConversationPropagator.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/ConversationPropagator.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/ConversationPropagator.java
index e5d2b0f..9ee7ec8 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/ConversationPropagator.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/main/java/org/apache/wicket/cdi/ConversationPropagator.java
@@ -438,4 +438,13 @@ public class ConversationPropagator extends AbstractRequestCycleListener impleme
}
return null;
}
+
+ Boolean getAuto() {
+ return auto.get();
+ }
+
+ ConversationPropagation getPropagation() {
+ return (ConversationPropagation)propagationSource.get();
+ }
+
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
new file mode 100644
index 0000000..2461e05
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/CdiConfigurationTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi;
+
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.wicket.cdi.testapp.TestAppScope;
+import org.apache.wicket.cdi.testapp.TestApplication;
+import org.apache.wicket.cdi.testapp.TestConversationBean;
+import org.apache.wicket.cdi.testapp.TestConversationPage;
+import org.apache.wicket.util.tester.WicketTester;
+import org.jglue.cdiunit.AdditionalClasses;
+import org.jglue.cdiunit.CdiRunner;
+import org.jglue.cdiunit.ContextController;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author jsarman
+ */
+@RunWith(CdiRunner.class)
+@AdditionalClasses({BehaviorInjector.class,
+ CdiConfiguration.class,
+ CdiShutdownCleaner.class,
+ ComponentInjector.class,
+ ConversationExpiryChecker.class,
+ ConversationPropagator.class,
+ DetachEventEmitter.class,
+ NonContextualManager.class,
+ SessionInjector.class,
+ MockContainer.class,
+ TestAppScope.class,
+ TestConversationBean.class})
+public class CdiConfigurationTest extends Assert
+{
+
+ private WicketTester tester;
+ @Inject
+ ContextController contextController;
+ @Inject
+ ConversationPropagator conversationPropagator;
+ @Inject
+ ComponentInjector componentInjector;
+
+ @Before
+ public void before()
+ {
+ tester = new WicketTester(new TestApplication());
+ prepareRequest(tester.getRequest());
+ }
+
+ @After
+ public void after()
+ {
+ tester.destroy();
+ tester = null;
+ }
+
+ public void prepareRequest(HttpServletRequest request)
+ {
+ contextController.openRequest(request);
+ contextController.openSession(request);
+ contextController.openConversation(request);
+ }
+
+ @Test
+ public void testApplicationScope()
+ {
+ tester.startPage(tester.getApplication().getHomePage());
+ tester.assertLabel("appscope", "Test ok");
+ }
+
+ @Test
+ public void testConversationScope()
+ {
+ tester.startPage(TestConversationPage.class);
+ for (int i = 0; i < 20; i++)
+ {
+ tester.assertLabel("count", i + "");
+ tester.clickLink("increment");
+ }
+ }
+
+ @Test
+ public void testDynamicConfigureChange()
+ {
+ // CdiConfiguration is configured at begin auto is false
+ assertEquals(false, conversationPropagator.getAuto());
+ // set auto to true in configuration
+ CdiConfiguration.get().setAutoConversationManagement(true);
+ assertEquals(true, conversationPropagator.getAuto());
+ // Test Changing Propagation
+ for (ConversationPropagation propagation : ConversationPropagation.values())
+ {
+ CdiConfiguration.get().setPropagation(propagation);
+ assertEquals(propagation, conversationPropagator.getPropagation());
+ }
+
+ int ignoreCnt = componentInjector.getIgnorePackages().length;
+
+ CdiConfiguration.get().addPackagesToIgnore("test1", "test2", "test3");
+ assertEquals(ignoreCnt + 3, componentInjector.getIgnorePackages().length);
+
+ CdiConfiguration.get().removePackagesToIgnore("test1", "test2");
+ assertEquals(ignoreCnt + 1, componentInjector.getIgnorePackages().length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
index c038614..fb1210e 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java
@@ -17,26 +17,59 @@
package org.apache.wicket.cdi;
import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.wicket.cdi.testapp.TestAppScope;
+import org.apache.wicket.cdi.testapp.TestApplication;
+import org.apache.wicket.cdi.testapp.TestConversationBean;
+import org.apache.wicket.cdi.testapp.TestConversationPage;
+import org.apache.wicket.cdi.testapp.TestQualifier;
import org.apache.wicket.markup.html.WebComponent;
import org.apache.wicket.util.tester.WicketTester;
+import org.jglue.cdiunit.AdditionalClasses;
+import org.jglue.cdiunit.CdiRunner;
+import org.jglue.cdiunit.ContextController;
import org.junit.After;
import org.junit.Assert;
+
+import static org.junit.Assert.assertEquals;
+
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for ComponentInjector
*/
+@RunWith(CdiRunner.class)
+@AdditionalClasses({
+ BehaviorInjector.class,
+ CdiConfiguration.class,
+ CdiShutdownCleaner.class,
+ ComponentInjector.class,
+ ConversationExpiryChecker.class,
+ ConversationPropagator.class,
+ DetachEventEmitter.class,
+ NonContextualManager.class,
+ SessionInjector.class,
+ MockContainer.class,
+ TestAppScope.class,
+ TestConversationBean.class})
public class ComponentInjectorTest extends Assert
{
+
private WicketTester tester;
+ @Inject
+ ContextController contextController;
+ @Inject
+ ComponentInjector componentInjector;
@Before
public void before()
{
- // starts an application so we can instantiate components
- tester = new WicketTester();
+ tester = new WicketTester(new TestApplication());
+ prepareRequest(tester.getRequest());
}
@After
@@ -46,24 +79,24 @@ public class ComponentInjectorTest extends Assert
tester = null;
}
+ public void prepareRequest(HttpServletRequest request)
+ {
+ contextController.openRequest(request);
+ contextController.openSession(request);
+ contextController.openConversation(request);
+ }
+
/**
* https://issues.apache.org/jira/browse/WICKET-5226
*/
@Test
public void innerNonStaticClass()
{
- //Disabled for now
-// BeanManager beanManager = mock(BeanManager.class);
-// INonContextualManager nonContextualManager = mock(INonContextualManager.class);
-// AbstractCdiContainer cdiContainer = new AbstractCdiContainer(beanManager, nonContextualManager);
-// ComponentInjector injector = new ComponentInjector(cdiContainer);
-//
-// TestNonStaticComponent component = new TestNonStaticComponent("someId");
-// assertNull(component.dependency);
-//
-// injector.onInstantiation(component);
-//
-// verify(nonContextualManager, never()).inject(any());
+
+ TestNonStaticComponent component = new TestNonStaticComponent("someId");
+ assertNull(component.dependency);
+ componentInjector.onInstantiation(component);
+ assertNull(component.dependency);
}
/**
@@ -72,36 +105,33 @@ public class ComponentInjectorTest extends Assert
@Test
public void innerStaticClass()
{
- //Disabled for now need to add injectable test dependencies
-// BeanManager beanManager = mock(BeanManager.class);
-// INonContextualManager nonContextualManager = mock(INonContextualManager.class);
-// final String expectedValue = "injected";
-//
-// doAnswer(new Answer<Void>()
-// {
-// @Override
-// public Void answer(InvocationOnMock invocation) throws Throwable
-// {
-// TestStaticComponent component = (TestStaticComponent) invocation.getArguments()[0];
-// component.dependency = expectedValue;
-//
-// return null;
-// }
-// }).when(nonContextualManager).inject(any(TestStaticComponent.class));
-//
-// AbstractCdiContainer cdiContainer = new AbstractCdiContainer(beanManager, nonContextualManager);
-// ComponentInjector injector = new ComponentInjector(cdiContainer);
-//
-// TestStaticComponent component = new TestStaticComponent("someId");
-// assertNull(component.dependency);
-//
-// injector.onInstantiation(component);
-//
-// assertEquals(expectedValue, component.dependency);
+ TestStaticComponent component = new TestStaticComponent("someId");
+ componentInjector.onInstantiation(component);
+ assertEquals(component.dependency, "Test String");
+ }
+
+ @Test
+ public void anonymousInnerClass()
+ {
+
+ WebComponent component = new WebComponent("someId")
+ {
+ @Inject
+ private String dependency;
+
+ @Override
+ public String toString()
+ {
+ return dependency;
+ }
+ };
+ componentInjector.onInstantiation(component);
+ assertNull(component.toString());
}
private class TestNonStaticComponent extends WebComponent
{
+
@Inject
private String dependency;
@@ -113,7 +143,9 @@ public class ComponentInjectorTest extends Assert
private static class TestStaticComponent extends WebComponent
{
+
@Inject
+ @TestQualifier
private String dependency;
public TestStaticComponent(String id)
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
new file mode 100644
index 0000000..dc1ddd1
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/MockContainer.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.jboss.weld.context.http.HttpConversationContext;
+
+/**
+ * @author jsarman
+ */
+@ApplicationScoped
+public class MockContainer extends AbstractCdiContainer
+{
+
+ @Inject
+ private Instance<HttpConversationContext> conversationContextSource;
+
+ @Override
+ public void deactivateConversationalContext(RequestCycle cycle)
+ {
+ HttpConversationContext conversationContext = conversationContextSource.get();
+ conversationContext.deactivate();
+ conversationContext.dissociate(getRequest(cycle));
+ }
+
+ /**
+ * Activates the conversational context and starts the conversation with the
+ * specified cid
+ *
+ * @param cycle
+ * @param cid
+ */
+ @Override
+ public void activateConversationalContext(RequestCycle cycle, String cid)
+ {
+ HttpConversationContext conversationContext = conversationContextSource.get();
+ conversationContext.associate(getRequest(cycle));
+ if (conversationContext.isActive())
+ {
+ // Only reactivate if transient and cid is set
+ if (conversationContext.getCurrentConversation().isTransient()
+ && cid != null && !cid.isEmpty())
+ {
+ conversationContext.deactivate();
+ conversationContext.activate(cid);
+ }
+ } else
+ {
+ conversationContext.activate(cid);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java
new file mode 100644
index 0000000..2097f52
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+/**
+ * @author jsarman
+ */
+@ApplicationScoped
+public class TestAppScope
+{
+
+ public String test()
+ {
+ return "Test ok";
+ }
+
+ public
+ @Produces
+ @TestQualifier
+ String testString()
+ {
+ return "Test String";
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java
new file mode 100644
index 0000000..e70d3a7
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.cdi.CdiConfiguration;
+import org.apache.wicket.protocol.http.WebApplication;
+
+/**
+ * @author jsarman
+ */
+public class TestApplication extends WebApplication
+{
+
+ @Override
+ public Class<? extends Page> getHomePage()
+ {
+ return TestPage.class;
+ }
+
+ @Override
+ protected void init()
+ {
+ super.init();
+ CdiConfiguration.get().configure(this);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java
new file mode 100644
index 0000000..92bf9bf
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.enterprise.context.ConversationScoped;
+
+/**
+ * @author jsarman
+ */
+@ConversationScoped
+public class TestConversationBean implements Serializable
+{
+
+ private AtomicInteger counter = new AtomicInteger();
+
+ public int getCount()
+ {
+ return counter.get();
+ }
+
+ public void increment()
+ {
+ counter.incrementAndGet();
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html
new file mode 100644
index 0000000..06d96a2
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</head>
+<body>
+<span wicket:id="count">100</span>
+<a wicket:id="increment">increment</a>
+<a wicket:id="reset">Reset</a>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java
new file mode 100644
index 0000000..9d9ccad
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+import javax.enterprise.context.Conversation;
+import javax.inject.Inject;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * @author jsarman
+ */
+public class TestConversationPage extends WebPage
+{
+
+ @Inject
+ Conversation conversation;
+
+ @Inject
+ TestConversationBean counter;
+
+ public TestConversationPage()
+ {
+
+ conversation.begin();
+
+ add(new Label("count", new PropertyModel(this, "counter.count")));
+
+ add(new Link<Void>("increment")
+ {
+ @Override
+ public void onClick()
+ {
+ counter.increment();
+ }
+ });
+ add(new Link<Void>("reset")
+ {
+ @Override
+ public void onClick()
+ {
+ conversation.end();
+ setResponsePage(TestPage.class);
+ }
+ });
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html
new file mode 100644
index 0000000..0439c9e
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</head>
+<body>
+<div wicket:id="appscope">Fail</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java
new file mode 100644
index 0000000..742400a
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+import javax.inject.Inject;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+
+/**
+ * @author jsarman
+ */
+public class TestPage extends WebPage
+{
+
+ @Inject
+ TestAppScope appScope;
+
+ public TestPage()
+ {
+
+ add(new Label("appscope", appScope.test()));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java
new file mode 100644
index 0000000..3d9b361
--- /dev/null
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-core/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.cdi.testapp;
+
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * @author jsarman
+ */
+@Qualifier
+@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TestQualifier
+{
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/434a7089/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml
index 9c657e2..ddd1ae6 100644
--- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml
+++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/pom.xml
@@ -20,12 +20,12 @@
<parent>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-cdi-1.1</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wicket-cdi-1.1-weld</artifactId>
<packaging>jar</packaging>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
<name>Wicket CDI 1.1 Weld</name>
<description>
Provides integration between Wicket and CDI containers. Adds support for weld
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-cdi-1.1-core</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
[5/9] git commit: Merge remote-tracking branch 'upstream/master' into
cdi-1.1-experimental
Posted by mg...@apache.org.
Merge remote-tracking branch 'upstream/master' into cdi-1.1-experimental
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/73d7cb40
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/73d7cb40
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/73d7cb40
Branch: refs/heads/5257-css-settings
Commit: 73d7cb406dac05b71825a385e21eec3ad0de15c0
Parents: 265934a 0d134f5
Author: John Sarman <jo...@gmail.com>
Authored: Thu Jun 27 16:37:56 2013 -0400
Committer: John Sarman <jo...@gmail.com>
Committed: Thu Jun 27 16:37:56 2013 -0400
----------------------------------------------------------------------
.../resource/ResourceStreamRequestHandler.java | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------