Author: dallen6
Date: 2010-06-06 16:24:34 -0400 (Sun, 06 Jun 2010)
New Revision: 6409
Added:
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/method/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
Log:
WELD-546 Tests
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-05
20:33:48 UTC (rev 6408)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/NewUserAction.java 2010-06-06
20:24:34 UTC (rev 6409)
@@ -33,4 +33,6 @@
{
System.out.println("new user's name: " + newUser.getName());
}
+
+ public boolean ping() { return true; }
}
\ No newline at end of file
Added:
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
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java 2010-06-06
20:24:34 UTC (rev 6409)
@@ -0,0 +1,42 @@
+/*
+ * 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
+ *
+ */
+@Artifact
+public class ProducerBeanInvocationTest extends AbstractWeldTest
+{
+ @Test
+ // WELD-546
+ public void test()
+ {
+ NewUserAction userAction = this.getReference(NewUserAction.class);
+ assert userAction.ping();
+ }
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/field/named/ProducerBeanInvocationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-05
20:33:48 UTC (rev 6408)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/FooProducer.java 2010-06-06
20:24:34 UTC (rev 6409)
@@ -17,12 +17,14 @@
package org.jboss.weld.tests.producer.method;
import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Model;
import javax.enterprise.inject.Produces;
/**
* @author pmuir
*
*/
+@Model
public class FooProducer
{
@@ -51,4 +53,6 @@
return disposed;
}
+ public boolean ping() { return true; }
+
}
Added:
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
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java 2010-06-06
20:24:34 UTC (rev 6409)
@@ -0,0 +1,42 @@
+/*
+ * 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.method;
+
+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
+ *
+ */
+@Artifact
+public class ProducerBeanInvocationTest extends AbstractWeldTest
+{
+ @Test
+ // WELD-546
+ public void test()
+ {
+ FooProducer fooProducer = this.getReference(FooProducer.class);
+ assert fooProducer.ping();
+ }
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/producer/method/ProducerBeanInvocationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain