Should we update/create any Jira tickets too ?
On Fri, Jul 5, 2013 at 6:01 PM, <[email protected]> wrote: > Revert "WICKET-5226 CDI integration fails in Glassfish 4.0 with > WELD-000070" > > This reverts commit 4bc20743fe628341a7cce407b36fa1984b912f92. > > Conflicts: > > wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > > > Project: http://git-wip-us.apache.org/repos/asf/wicket/repo > Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a9002edb > Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a9002edb > Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a9002edb > > Branch: refs/heads/master > Commit: a9002edb2d433fb8c3b97b93ccb382ee8dcebca3 > Parents: 736f912 > Author: Emond Papegaaij <[email protected]> > Authored: Fri Jul 5 17:01:42 2013 +0200 > Committer: Emond Papegaaij <[email protected]> > Committed: Fri Jul 5 17:01:42 2013 +0200 > > ---------------------------------------------------------------------- > wicket-cdi/pom.xml | 6 - > .../apache/wicket/cdi/ComponentInjector.java | 18 +-- > .../wicket/cdi/ComponentInjectorTest.java | 131 ------------------- > .../wicket/examples/cdi/ConversationPage2.java | 25 ++-- > 4 files changed, 11 insertions(+), 169 deletions(-) > ---------------------------------------------------------------------- > > > > http://git-wip-us.apache.org/repos/asf/wicket/blob/a9002edb/wicket-cdi/pom.xml > ---------------------------------------------------------------------- > diff --git a/wicket-cdi/pom.xml b/wicket-cdi/pom.xml > index 54611f1..4e8626a 100644 > --- a/wicket-cdi/pom.xml > +++ b/wicket-cdi/pom.xml > @@ -52,12 +52,6 @@ > <artifactId>junit</artifactId> > <scope>test</scope> > </dependency> > - <dependency> > - <groupId>javax.el</groupId> > - <artifactId>javax.el-api</artifactId> > - <version>2.2.4</version> > - <scope>test</scope> > - </dependency> > </dependencies> > <build> > <pluginManagement> > > > http://git-wip-us.apache.org/repos/asf/wicket/blob/a9002edb/wicket-cdi/src/main/java/org/apache/wicket/cdi/ComponentInjector.java > ---------------------------------------------------------------------- > diff --git > a/wicket-cdi/src/main/java/org/apache/wicket/cdi/ComponentInjector.java > b/wicket-cdi/src/main/java/org/apache/wicket/cdi/ComponentInjector.java > index 0316004..bc302ef 100644 > --- a/wicket-cdi/src/main/java/org/apache/wicket/cdi/ComponentInjector.java > +++ b/wicket-cdi/src/main/java/org/apache/wicket/cdi/ComponentInjector.java > @@ -16,12 +16,8 @@ > */ > package org.apache.wicket.cdi; > > -import java.lang.reflect.Modifier; > - > import org.apache.wicket.Component; > import org.apache.wicket.application.IComponentInstantiationListener; > -import org.slf4j.Logger; > -import org.slf4j.LoggerFactory; > > /** > * Injects components with CDI dependencies > @@ -31,8 +27,6 @@ import org.slf4j.LoggerFactory; > */ > class ComponentInjector extends AbstractInjector implements > IComponentInstantiationListener > { > - private static final Logger LOG = > LoggerFactory.getLogger(ComponentInjector.class); > - > /** > * Constructor > * > @@ -46,15 +40,7 @@ class ComponentInjector extends AbstractInjector > implements IComponentInstantiat > @Override > public void onInstantiation(Component component) > { > - Class<? extends Component> componentClass = > component.getClass(); > - > - if (componentClass.isMemberClass() && > Modifier.isStatic(componentClass.getModifiers()) == false) > - { > - LOG.debug("Skipping non-static inner class '{}' ", > componentClass); > - } > - else > - { > - inject(component); > - } > + inject(component); > } > + > } > > > http://git-wip-us.apache.org/repos/asf/wicket/blob/a9002edb/wicket-cdi/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java > ---------------------------------------------------------------------- > diff --git > a/wicket-cdi/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java > b/wicket-cdi/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java > deleted file mode 100644 > index 55d00cd..0000000 > --- > a/wicket-cdi/src/test/java/org/apache/wicket/cdi/ComponentInjectorTest.java > +++ /dev/null > @@ -1,131 +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 static org.mockito.Mockito.any; > -import static org.mockito.Mockito.doAnswer; > -import static org.mockito.Mockito.mock; > -import static org.mockito.Mockito.never; > -import static org.mockito.Mockito.verify; > - > -import javax.enterprise.inject.spi.BeanManager; > -import javax.inject.Inject; > - > -import org.apache.wicket.markup.html.WebComponent; > -import org.apache.wicket.util.tester.WicketTester; > -import org.junit.After; > -import org.junit.Assert; > -import org.junit.Before; > -import org.junit.Test; > -import org.mockito.invocation.InvocationOnMock; > -import org.mockito.stubbing.Answer; > - > -/** > - * Tests for ComponentInjector > - */ > -public class ComponentInjectorTest extends Assert > -{ > - private WicketTester tester; > - > - @Before > - public void before() > - { > - // starts an application so we can instantiate components > - tester = new WicketTester(); > - } > - > - @After > - public void after() > - { > - tester.destroy(); > - tester = null; > - } > - > - /** > - * https://issues.apache.org/jira/browse/WICKET-5226 > - */ > - @Test > - public void innerNonStaticClass() > - { > - BeanManager beanManager = mock(BeanManager.class); > - INonContextualManager nonContextualManager = > mock(INonContextualManager.class); > - CdiContainer cdiContainer = new CdiContainer(beanManager, > nonContextualManager); > - ComponentInjector injector = new > ComponentInjector(cdiContainer); > - > - TestNonStaticComponent component = new > TestNonStaticComponent("someId"); > - assertNull(component.dependency); > - > - injector.onInstantiation(component); > - > - verify(nonContextualManager, never()).inject(any()); > - } > - > - /** > - * https://issues.apache.org/jira/browse/WICKET-5226 > - */ > - @Test > - public void innerStaticClass() > - { > - 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)); > - > - CdiContainer cdiContainer = new CdiContainer(beanManager, > nonContextualManager); > - ComponentInjector injector = new > ComponentInjector(cdiContainer); > - > - TestStaticComponent component = new > TestStaticComponent("someId"); > - assertNull(component.dependency); > - > - injector.onInstantiation(component); > - > - assertEquals(expectedValue, component.dependency); > - } > - > - private class TestNonStaticComponent extends WebComponent > - { > - @Inject > - private String dependency; > - > - public TestNonStaticComponent(String id) > - { > - super(id); > - } > - } > - > - private static class TestStaticComponent extends WebComponent > - { > - @Inject > - private String dependency; > - > - public TestStaticComponent(String id) > - { > - super(id); > - } > - } > -} > > > http://git-wip-us.apache.org/repos/asf/wicket/blob/a9002edb/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > ---------------------------------------------------------------------- > diff --git > a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > index b7e6363..89b9e6a 100644 > --- > a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > +++ > b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java > @@ -32,22 +32,15 @@ public class ConversationPage2 extends CdiExamplePage > { > add(new Label("count", new PropertyModel(this, > "counter.count"))); > > - add(new IncrementLink("increment")); > - > - add(new BookmarkablePageLink<>("next", > ConversationPage3.class)); > - } > - > - private class IncrementLink extends Link<Void> { > - > - public IncrementLink(String id) > - { > - super(id); > - } > - > - @Override > - public void onClick() > + add(new Link<Void>("increment") > { > - counter.increment(); > - } > + @Override > + public void onClick() > + { > + counter.increment(); > + } > + }); > + > + add(new BookmarkablePageLink<Void>("next", > ConversationPage3.class)); > } > } > >
