[weld-commits] Weld SVN: r5849 - core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Feb 16 14:11:21 EST 2010


Author: pete.muir at jboss.org
Date: 2010-02-16 14:11:20 -0500 (Tue, 16 Feb 2010)
New Revision: 5849

Added:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/FooBean.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanConsumer.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanTest.java
Removed:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanWithBindingTest.java
Log:
test for WELD-435

Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/FooBean.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/FooBean.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/FooBean.java	2010-02-16 19:11:20 UTC (rev 5849)
@@ -0,0 +1,9 @@
+package org.jboss.weld.tests.resolution.named;
+
+import javax.inject.Named;
+
+ at Named("foo")
+public class FooBean
+{
+
+}


Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/FooBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanConsumer.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanConsumer.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanConsumer.java	2010-02-16 19:11:20 UTC (rev 5849)
@@ -0,0 +1,14 @@
+package org.jboss.weld.tests.resolution.named;
+
+
+public class NamedBeanConsumer
+{
+   
+   /*@Inject @Named*/ FooBean foo;
+   
+   public FooBean getFoo()
+   {
+      return foo;
+   }
+
+}


Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanConsumer.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Copied: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanTest.java (from rev 5749, core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanWithBindingTest.java)
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanTest.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanTest.java	2010-02-16 19:11:20 UTC (rev 5849)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * 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.jboss.weld.tests.resolution.named;
+
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+/**
+ * @author Dan Allen
+ */
+ at Artifact(addCurrentPackage = true)
+public class NamedBeanTest extends AbstractWeldTest
+{
+   @Test
+   public void testGetNamedBeanWithBinding()
+   {
+      Bean<?> bean = getCurrentManager().resolve(getCurrentManager().getBeans("namedBeanWithBinding"));
+      NamedBeanWithBinding instance = (NamedBeanWithBinding) getCurrentManager().getReference(bean, Object.class, getCurrentManager().createCreationalContext(bean));
+      assert instance != null;
+   }
+   
+   @Test(description = "WELD-435", groups = "broken")
+   public void testNamedInjectedFieldUsesFieldName()
+   {
+      assert getReference(NamedBeanConsumer.class).getFoo() != null;
+   }
+   
+}


Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Deleted: core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanWithBindingTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanWithBindingTest.java	2010-02-16 19:09:55 UTC (rev 5848)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/resolution/named/NamedBeanWithBindingTest.java	2010-02-16 19:11:20 UTC (rev 5849)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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.jboss.weld.tests.resolution.named;
-
-import javax.enterprise.inject.spi.Bean;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWeldTest;
-import org.testng.annotations.Test;
-
-/**
- * @author Dan Allen
- */
- at Artifact(addCurrentPackage = true)
-public class NamedBeanWithBindingTest extends AbstractWeldTest
-{
-   @Test
-   public void testGetNamedBeanWithBinding()
-   {
-      Bean<?> bean = getCurrentManager().resolve(getCurrentManager().getBeans("namedBeanWithBinding"));
-      NamedBeanWithBinding instance = (NamedBeanWithBinding) getCurrentManager().getReference(bean, Object.class, getCurrentManager().createCreationalContext(bean));
-      assert instance != null;
-   }
-}



More information about the weld-commits mailing list