[weld-commits] Weld SVN: r5184 - core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Tue Dec 1 08:51:33 EST 2009
Author: pete.muir at jboss.org
Date: 2009-12-01 08:51:33 -0500 (Tue, 01 Dec 2009)
New Revision: 5184
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringConsumer.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringGenerator.java
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java
Log:
WELD-316
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java 2009-12-01 13:26:57 UTC (rev 5183)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java 2009-12-01 13:51:33 UTC (rev 5184)
@@ -1,6 +1,7 @@
package org.jboss.weld.tests.injectionPoint;
import javax.enterprise.inject.IllegalProductException;
+import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.test.AbstractWeldTest;
@@ -24,5 +25,16 @@
assert e.getMessage().contains("Injection Point: field org.jboss.weld.tests.injectionPoint.DoubleGenerator.timer");
}
}
+
+ @Test(description="WELD-316")
+ public void testFieldInjectionPointSerializability() throws Throwable
+ {
+ getCurrentManager().getInstanceByType(StringConsumer.class).ping();
+ InjectionPoint ip = StringGenerator.getInjectionPoint();
+ assert ip != null;
+ assert ip.getMember().getName().equals("str");
+ InjectionPoint ip1 = deserialize(serialize(ip));
+ assert ip1.getMember().getName().equals("str");
+ }
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringConsumer.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringConsumer.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringConsumer.java 2009-12-01 13:51:33 UTC (rev 5184)
@@ -0,0 +1,12 @@
+package org.jboss.weld.tests.injectionPoint;
+
+import javax.inject.Inject;
+
+public class StringConsumer
+{
+
+ @Inject String str;
+
+ public void ping() {}
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringConsumer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringGenerator.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringGenerator.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringGenerator.java 2009-12-01 13:51:33 UTC (rev 5184)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.injectionPoint;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class StringGenerator
+{
+
+ private static InjectionPoint injectionPoint;
+
+ public static InjectionPoint getInjectionPoint()
+ {
+ return injectionPoint;
+ }
+
+ public static void reset()
+ {
+ injectionPoint = null;
+ }
+
+ @Produces String getString(InjectionPoint ip)
+ {
+ injectionPoint = ip;
+ return "";
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/StringGenerator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
More information about the weld-commits
mailing list