You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/06/05 20:39:36 UTC

svn commit: r820375 - in /websites/staging/openejb/trunk: cgi-bin/ content/ content/examples-trunk/ content/examples-trunk/deltaspike-exception-handling/ content/examples-trunk/deltaspike-exception-handling/src/ content/examples-trunk/deltaspike-except...

Author: buildbot
Date: Tue Jun  5 18:39:35 2012
New Revision: 820375

Log:
Staging update by buildbot for openejb

Added:
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/pom.xml   (with props)
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/resources/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/resources/META-INF/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/resources/META-INF/beans.xml
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/
    websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
Modified:
    websites/staging/openejb/trunk/cgi-bin/   (props changed)
    websites/staging/openejb/trunk/content/   (props changed)
    websites/staging/openejb/trunk/content/examples-trunk/pom.xml

Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Jun  5 18:39:35 2012
@@ -1 +1 @@
-1346481
+1346518

Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Jun  5 18:39:35 2012
@@ -1 +1 @@
-1346481
+1346518

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/pom.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java Tue Jun  5 18:39:35 2012
@@ -0,0 +1,16 @@
+package org.superbiz.deltaspike.exceptionhandling;
+
+import java.util.logging.Logger;
+import org.apache.deltaspike.core.api.exception.control.annotation.ExceptionHandler;
+import org.apache.deltaspike.core.api.exception.control.annotation.Handles;
+import org.apache.deltaspike.core.api.exception.control.event.ExceptionEvent;
+
+@ExceptionHandler
+public class OSExceptionHandler {
+    private static final Logger LOGGER = Logger.getLogger(OSExceptionHandler.class.getName());
+
+    public void printExceptions(@Handles final ExceptionEvent<OSRuntimeException> evt) {
+        LOGGER.severe("==> a bad OS was mentionned");
+        evt.handled();
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java Tue Jun  5 18:39:35 2012
@@ -0,0 +1,4 @@
+package org.superbiz.deltaspike.exceptionhandling;
+
+public class OSRuntimeException extends RuntimeException {
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java Tue Jun  5 18:39:35 2012
@@ -0,0 +1,17 @@
+package org.superbiz.deltaspike.exceptionhandling;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+import org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent;
+
+public class OSValidator {
+    @Inject
+    private Event<ExceptionToCatchEvent> exceptionEvent;
+
+    public void validOS(final String os) {
+        if (os.toLowerCase().contains("win")) {
+            final Exception ex = new OSRuntimeException(); // can be a caugh exceptino
+            exceptionEvent.fire(new ExceptionToCatchEvent(ex));
+        }
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/main/resources/META-INF/beans.xml
==============================================================================
    (empty)

Added: websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java Tue Jun  5 18:39:35 2012
@@ -0,0 +1,40 @@
+package org.superbiz.deltaspike.exceptionhandling;
+
+import javax.inject.Inject;
+import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class ExceptionHandlingDemoTest {
+    @Inject
+    private OSValidator validator;
+
+    @Deployment
+    public static WebArchive jar() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addPackage(OSValidator.class.getPackage())
+                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
+                // DeltaSpike libs (api and impl)
+                .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
+                .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class));
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(validator);
+        validator.validOS("Linux");
+        validator.validOS("windows"); // should throw a handled exception
+        validator.validOS("Mac OS");
+    }
+}

Modified: websites/staging/openejb/trunk/content/examples-trunk/pom.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/pom.xml (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/pom.xml Tue Jun  5 18:39:35 2012
@@ -17,7 +17,7 @@
     limitations under the License.
 -->
 <!--test 2-->
-<!-- $Rev: 1346481 $ $Date: 2012-06-05 17:25:56 +0000 (Tue, 05 Jun 2012) $ -->
+<!-- $Rev: 1346518 $ $Date: 2012-06-05 18:38:35 +0000 (Tue, 05 Jun 2012) $ -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
@@ -52,6 +52,7 @@
     <module>datasource-definition</module>
     <module>decorators</module>
     <module>deltaspike-configproperty</module>
+    <module>deltaspike-exception-handling</module>
     <module>deltaspike-i18n</module>
     <module>dynamic-dao-implementation</module>
     <module>dynamic-datasource-routing</module>