Author: pete.muir(a)jboss.org
Date: 2009-06-08 07:25:31 -0400 (Mon, 08 Jun 2009)
New Revision: 2776
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
Modified:
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
Log:
WBRI-275
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
---
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-08
10:34:46 UTC (rev 2775)
+++
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-08
11:25:31 UTC (rev 2776)
@@ -138,4 +138,17 @@
return manager;
}
+ public boolean isExceptionInHierarchy(Throwable exception, Class<? extends
Throwable> expectedException )
+ {
+ while (exception != null)
+ {
+ if (exception.getClass().equals(expectedException))
+ {
+ return true;
+ }
+ exception = exception.getCause();
+ }
+ return false;
+ }
+
}
Modified: ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
---
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-06-08
10:34:46 UTC (rev 2775)
+++
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-06-08
11:25:31 UTC (rev 2776)
@@ -3,5 +3,5 @@
org.jboss.testharness.standalone=false
org.jboss.testharness.container.extraConfigurationDir=../../webbeans/jboss-as
org.jboss.testharness.container.forceRestart=false
-org.jboss.testharness.libraryDirectory=../../webbeans/impl/target/dependency/lib
+org.jboss.testharness.libraryDirectory=../../webbeans/tests/target/dependency/lib
org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java 2009-06-08
11:25:31 UTC (rev 2776)
@@ -0,0 +1,26 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+public class BowlerHatException extends RuntimeException
+{
+
+ public BowlerHatException()
+ {
+ super();
+ }
+
+ public BowlerHatException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public BowlerHatException(String message)
+ {
+ super(message);
+ }
+
+ public BowlerHatException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-06-08
10:34:46 UTC (rev 2775)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-06-08
11:25:31 UTC (rev 2776)
@@ -19,6 +19,22 @@
}
+ @Test(description="WBRI-275")
+ public void testSLSBBusinessMethodThrowsRuntimeException()
+ {
+ try
+ {
+ getCurrentManager().getInstanceByType(Fedora.class).causeRuntimeException();
+ }
+ catch (Throwable t)
+ {
+ if (isExceptionInHierarchy(t, BowlerHatException.class))
+ {
+ return;
+ }
+ }
+ assert false : "Expected a BowlerHatException to be in the cause stack";
+ }
}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java 2009-06-08
11:25:31 UTC (rev 2776)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface Fedora
+{
+
+ public void causeRuntimeException();
+
+
+}
Property changes on:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java 2009-06-08
11:25:31 UTC (rev 2776)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class FedoraImpl implements Fedora
+{
+
+ public void causeRuntimeException()
+ {
+ throw new BowlerHatException();
+ }
+
+}
Property changes on:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain