Author: richard.opalka(a)jboss.com
Date: 2009-05-05 05:35:13 -0400 (Tue, 05 May 2009)
New Revision: 9954
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java
Log:
[JBWS-2634] final test case
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java 2009-05-05
09:33:28 UTC (rev 9953)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java 2009-05-05
09:35:13 UTC (rev 9954)
@@ -52,7 +52,5 @@
Service service = Service.create(wsdlURL, serviceName);
POJOIface proxy = (POJOIface)service.getPort(POJOIface.class);
assertEquals(proxy.getMessage(), "Injected hello message");
-
- System.out.println("[JBWS-2634] test javax.ejb.EJB annotation defaults as
well, see POJOBean");
}
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java 2009-05-05
09:33:28 UTC (rev 9953)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java 2009-05-05
09:35:13 UTC (rev 9954)
@@ -21,8 +21,10 @@
*/
package org.jboss.test.ws.jaxws.jbws2634.webservice;
+import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
import org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface;
@@ -40,13 +42,35 @@
public class POJOBean implements POJOIface
{
- // TODO: this should work without name attribute as well
+ private boolean correctState;
+ @EJB
+ private BeanIface testBean2;
@EJB(name =
"jaxws-jbws2634/BeanImpl1/local-org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface")
- private BeanIface testBean;
+ private BeanIface testBean1;
public String getMessage()
{
- return this.testBean.printString();
+ if (this.correctState)
+ {
+ return this.testBean2.printString();
+ }
+
+ throw new WebServiceException("@EJB reference injection failed!");
}
+ @PostConstruct
+ private void init()
+ {
+ if (this.testBean1 == null)
+ return;
+ if (!"Injected hello message".equals(testBean1.printString()))
+ return;
+ if (this.testBean2 == null)
+ return;
+ if (!"Injected hello message".equals(testBean2.printString()))
+ return;
+
+ this.correctState = true;
+ }
+
}