Author: swd847
Date: 2010-01-27 21:47:51 -0500 (Wed, 27 Jan 2010)
New Revision: 11997
Added:
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/MultipleProducerBeanTest.java
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Producer.java
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/ProducerQualifier.java
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Reciever.java
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/producer/
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
Modified:
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
Log:
added new tests to do with multiple annotated types
Added:
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/MultipleProducerBeanTest.java
===================================================================
---
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/MultipleProducerBeanTest.java
(rev 0)
+++
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/MultipleProducerBeanTest.java 2010-01-28
02:47:51 UTC (rev 11997)
@@ -0,0 +1,37 @@
+/*
+ * Distributed under the LGPL License
+ *
+ */
+package org.jboss.seam.xml.test.producer;
+
+import org.jboss.seam.xml.test.AbstractXMLTest;
+import org.testng.annotations.Test;
+
+public class MultipleProducerBeanTest extends AbstractXMLTest
+{
+
+ @Override
+ protected String getXmlFileName()
+ {
+ return "multiple-producers.xml";
+ }
+
+ @Test
+ public void testProducerField()
+ {
+
+ Reciever s = getReference(Reciever.class);
+ assert s.val1==1;
+ assert s.val2==2;
+ }
+
+
+ @Test
+ public void testProducerMethod()
+ {
+
+ Reciever s = getReference(Reciever.class);
+ assert s.meth1==1;
+ assert s.meth2==2;
+ }
+}
Added: modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Producer.java
===================================================================
--- modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Producer.java
(rev 0)
+++
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Producer.java 2010-01-28
02:47:51 UTC (rev 11997)
@@ -0,0 +1,11 @@
+package org.jboss.seam.xml.test.producer;
+
+public class Producer
+{
+ public int value;
+
+ public int meth()
+ {
+ return value;
+ }
+}
Added:
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/ProducerQualifier.java
===================================================================
---
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/ProducerQualifier.java
(rev 0)
+++
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/ProducerQualifier.java 2010-01-28
02:47:51 UTC (rev 11997)
@@ -0,0 +1,13 @@
+package org.jboss.seam.xml.test.producer;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.inject.Qualifier;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+@Qualifier
+public @interface ProducerQualifier
+{
+ int value();
+}
Added: modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Reciever.java
===================================================================
--- modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Reciever.java
(rev 0)
+++
modules/xml/trunk/src/test/java/org/jboss/seam/xml/test/producer/Reciever.java 2010-01-28
02:47:51 UTC (rev 11997)
@@ -0,0 +1,13 @@
+package org.jboss.seam.xml.test.producer;
+
+
+public class Reciever
+{
+ public int val1;
+
+ public int val2;
+
+ public int meth1;
+
+ public int meth2;
+}
Modified:
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
===================================================================
---
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-01-27
22:28:52 UTC (rev 11996)
+++
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-01-28
02:47:51 UTC (rev 11997)
@@ -2,6 +2,11 @@
<Beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.injection">
+ <veto>
+ <test:ProducerBean/>
+ <test:RecieverBean/>
+ </veto>
+
<test:ProducerQualifier>
<Qualifier/>
</test:ProducerQualifier>
Added:
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
===================================================================
---
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
(rev 0)
+++
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml 2010-01-28
02:47:51 UTC (rev 11997)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Beans xmlns="urn:seam:core"
+ xmlns:test="urn:java:org.jboss.seam.xml.test.producer">
+ <veto>
+ <test:Producer/>
+ <test:Reciever/>
+ </veto>
+
+ <test:Producer>
+ <test:value>
+ <Produces/>
+ <test:ProducerQualifier value="1" />
+ <value>1</value>
+ </test:value>
+ <test:meth>
+ <Produces/>
+ <test:ProducerQualifier value="3" />
+ </test:meth>
+ </test:Producer>
+
+ <test:Producer>
+ <test:value>
+ <Produces/>
+ <test:ProducerQualifier value="2" />
+ <value>2</value>
+ </test:value>
+ <test:meth>
+ <Produces/>
+ <test:ProducerQualifier value="4" />
+ </test:meth>
+ </test:Producer>
+
+
+ <test:Reciever>
+ <test:val1>
+ <Inject/>
+ <test:ProducerQualifier value="1" />
+ </test:val1>
+ <test:val2>
+ <Inject/>
+ <test:ProducerQualifier value="2" />
+ </test:val2>
+ <test:meth1>
+ <Inject/>
+ <test:ProducerQualifier value="3" />
+ </test:meth1>
+ <test:meth2>
+ <Inject/>
+ <test:ProducerQualifier value="4" />
+ </test:meth2>
+
+ </test:Reciever>
+
+
+
+</Beans>
\ No newline at end of file
Modified:
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
===================================================================
---
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-01-27
22:28:52 UTC (rev 11996)
+++
modules/xml/trunk/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-01-28
02:47:51 UTC (rev 11997)
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.simple">
+ <veto>
+ <test:Bean2/>
+ </veto>
+
<test:Bean1>
<test:bean2>
<Inject/>