openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r900495 - in /openwebbeans/trunk: webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/profiel...
Date Mon, 18 Jan 2010 18:23:18 GMT
Author: gerdogdu
Date: Mon Jan 18 18:23:17 2010
New Revision: 900495

URL: http://svn.apache.org/viewvc?rev=900495&view=rev
Log:
Adding inner class injection example

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java
  (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java
  (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java
  (with props)
Modified:
    openwebbeans/trunk/webbeans-tck/jsr299-tck-impl-1.0.0-SNAPSHOT-suite.xml

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java?rev=900495&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java
Mon Jan 18 18:23:17 2010
@@ -0,0 +1,63 @@
+/*
+ * 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.webbeans.newtests.profields;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.enterprise.inject.spi.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.newtests.AbstractUnitTest;
+import org.apache.webbeans.newtests.profields.beans.StringProducerBean;
+import org.apache.webbeans.newtests.profields.innerClass.InnerClassInjectStringProducer;
+import org.apache.webbeans.newtests.profields.innerClass.InnerClassInjectStringProducer.Xsimple;
+import org.junit.Test;
+
+public class InnerClassInjectStringProducerTest extends AbstractUnitTest
+{
+    public InnerClassInjectStringProducerTest()
+    {
+        
+    }
+    
+    @Test
+    @SuppressWarnings("unchecked")
+    public void testInnerClassProducerInjection()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(StringProducerBean.class);
+        beanClasses.add(InnerClassInjectStringProducer.class);
+        beanClasses.add(Xsimple.class);
+        
+        startContainer(beanClasses, beanXmls);   
+        
+        Bean<Xsimple> bean = (Bean<Xsimple>) getBeanManager().getBeans("Xsimple").iterator().next();
+        Xsimple simple = (Xsimple) getBeanManager().getReference(bean, Xsimple.class, getBeanManager().createCreationalContext(bean));
+        
+        Assert.assertNotNull(simple.getInner());
+        
+        shutDownContainer();
+    }
+
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/InnerClassInjectStringProducerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java?rev=900495&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java
Mon Jan 18 18:23:17 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.webbeans.newtests.profields.beans;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+public class StringProducerBean
+{
+    @Produces
+    @Named("ProMethodNamed1")
+    String methodN1()
+    {
+        return "Sucess from ProMethodNamed1";
+    }
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/beans/StringProducerBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java?rev=900495&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java
Mon Jan 18 18:23:17 2010
@@ -0,0 +1,32 @@
+/*
+ * 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.webbeans.newtests.profields.innerClass;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+public class InnerClassInjectStringProducer
+{
+    @Named("Xsimple")
+    public static class Xsimple
+    {
+        public @Inject @Named("ProMethodNamed1") String sInject;
+
+        public String getInner()
+        {
+            String s = sInject;
+            return s;
+        }
+    }
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/innerClass/InnerClassInjectStringProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openwebbeans/trunk/webbeans-tck/jsr299-tck-impl-1.0.0-SNAPSHOT-suite.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/jsr299-tck-impl-1.0.0-SNAPSHOT-suite.xml?rev=900495&r1=900494&r2=900495&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/jsr299-tck-impl-1.0.0-SNAPSHOT-suite.xml (original)
+++ openwebbeans/trunk/webbeans-tck/jsr299-tck-impl-1.0.0-SNAPSHOT-suite.xml Mon Jan 18 18:23:17
2010
@@ -21,7 +21,7 @@
       
  
       <packages>         
-         <package name="org.jboss.jsr299.tck.tests.*"></package>
+         <package name="org.jboss.jsr299.tck.tests.decorators.*"></package>
       </packages>
    </test>
    



Mime
View raw message