[weld-commits] Weld SVN: r6410 - in core/trunk/tests/src/test/java/org/jboss/weld/tests/producer: field/named and 1 other directories.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Mon Jun 7 07:35:19 EDT 2010
Author: pete.muir at jboss.org
Date: 2010-06-07 07:35:19 -0400 (Mon, 07 Jun 2010)
New Revision: 6410
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Baz.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/ProducerBeanInvocationTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Qux.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/QuxProducer.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Baz.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Qux.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/QuxProducer.java
Removed:
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/NewUserAction.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/FooProducer.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java
Log:
alter tests to reproduce issue
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Baz.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Baz.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Baz.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,13 @@
+package org.jboss.weld.tests.producer.field;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.inject.Qualifier;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Qualifier
+public @interface Baz
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Baz.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/ProducerBeanInvocationTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/ProducerBeanInvocationTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/ProducerBeanInvocationTest.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.producer.field;
+
+import javax.enterprise.util.AnnotationLiteral;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+/**
+ * Simple test which invokes a method directly on a normal scoped producer
+ * bean to ensure that it's proxy is for that bean and not the product
+ * of a producer method.
+ *
+ * @author David Allen
+ *
+ */
+ at Artifact
+public class ProducerBeanInvocationTest extends AbstractWeldTest
+{
+ @Test
+ // WELD-546
+ public void test()
+ {
+ Qux bar = getReference(Qux.class);
+ assert bar.getBar().equals("qux");
+ QuxProducer producer = getReference(QuxProducer.class);
+ assert producer.ping();
+ Qux bazBar = getReference(Qux.class, new AnnotationLiteral<Baz>(){});
+ assert bazBar.getBar().equals("baz");
+ }
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/ProducerBeanInvocationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Qux.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Qux.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Qux.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,26 @@
+package org.jboss.weld.tests.producer.field;
+
+import javax.enterprise.context.RequestScoped;
+
+ at RequestScoped
+public class Qux
+{
+
+ private final String name;
+
+ public Qux(String name)
+ {
+ this.name = name;
+ }
+
+ public Qux()
+ {
+ this("qux");
+ }
+
+ public String getBar()
+ {
+ return name;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/Qux.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/QuxProducer.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/QuxProducer.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/QuxProducer.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,18 @@
+package org.jboss.weld.tests.producer.field;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+ at RequestScoped
+public class QuxProducer
+{
+
+ @Produces @Baz @RequestScoped
+ private Qux bar = new Qux("baz");
+
+ public boolean ping()
+ {
+ return true;
+ };
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/QuxProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/NewUserAction.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/NewUserAction.java 2010-06-06 20:24:34 UTC (rev 6409)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/NewUserAction.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -33,6 +33,4 @@
{
System.out.println("new user's name: " + newUser.getName());
}
-
- public boolean ping() { return true; }
}
\ No newline at end of file
Deleted: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java 2010-06-06 20:24:34 UTC (rev 6409)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.producer.field.named;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWeldTest;
-import org.testng.annotations.Test;
-
-/**
- * Simple test which invokes a method directly on a normal scoped producer
- * bean to ensure that it's proxy is for that bean and not the product
- * of a producer method.
- *
- * @author David Allen
- *
- */
- at Artifact
-public class ProducerBeanInvocationTest extends AbstractWeldTest
-{
- @Test
- // WELD-546
- public void test()
- {
- NewUserAction userAction = this.getReference(NewUserAction.class);
- assert userAction.ping();
- }
-}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Baz.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Baz.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Baz.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,13 @@
+package org.jboss.weld.tests.producer.method;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.inject.Qualifier;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Qualifier
+public @interface Baz
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Baz.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/FooProducer.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/FooProducer.java 2010-06-06 20:24:34 UTC (rev 6409)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/FooProducer.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -17,14 +17,12 @@
package org.jboss.weld.tests.producer.method;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Model;
import javax.enterprise.inject.Produces;
/**
* @author pmuir
*
*/
- at Model
public class FooProducer
{
@@ -53,6 +51,4 @@
return disposed;
}
- public boolean ping() { return true; }
-
}
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java 2010-06-06 20:24:34 UTC (rev 6409)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -17,6 +17,8 @@
package org.jboss.weld.tests.producer.method;
+import javax.enterprise.util.AnnotationLiteral;
+
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@@ -36,7 +38,11 @@
// WELD-546
public void test()
{
- FooProducer fooProducer = this.getReference(FooProducer.class);
- assert fooProducer.ping();
+ Qux bar = getReference(Qux.class);
+ assert bar.getBar().equals("qux");
+ QuxProducer producer = getReference(QuxProducer.class);
+ assert producer.ping();
+ Qux bazBar = getReference(Qux.class, new AnnotationLiteral<Baz>(){});
+ assert bazBar.getBar().equals("baz");
}
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Qux.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Qux.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Qux.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,26 @@
+package org.jboss.weld.tests.producer.method;
+
+import javax.enterprise.context.RequestScoped;
+
+ at RequestScoped
+public class Qux
+{
+
+ private final String name;
+
+ public Qux(String name)
+ {
+ this.name = name;
+ }
+
+ public Qux()
+ {
+ this("qux");
+ }
+
+ public String getBar()
+ {
+ return name;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/Qux.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/QuxProducer.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/QuxProducer.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/QuxProducer.java 2010-06-07 11:35:19 UTC (rev 6410)
@@ -0,0 +1,21 @@
+package org.jboss.weld.tests.producer.method;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+ at RequestScoped
+public class QuxProducer
+{
+
+ @Produces @Baz @RequestScoped
+ public Qux getQux()
+ {
+ return new Qux("baz");
+ }
+
+ public boolean ping()
+ {
+ return true;
+ };
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/QuxProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
More information about the weld-commits
mailing list