[webbeans-commits] Webbeans SVN: r1575 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 18 13:15:05 EST 2009


Author: dallen6
Date: 2009-02-18 13:15:05 -0500 (Wed, 18 Feb 2009)
New Revision: 1575

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/EventTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/Pomeranian.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/PomeranianInterface.java
Log:
Fixed the interface for one of the test EJBs.

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/EventTest.java	2009-02-18 17:49:01 UTC (rev 1574)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/EventTest.java	2009-02-18 18:15:05 UTC (rev 1575)
@@ -17,6 +17,8 @@
 
 package org.jboss.jsr299.tck.integration.event;
 
+import static org.jboss.jsr299.tck.impl.packaging.PackagingType.EAR;
+
 import java.util.Set;
 
 import javax.event.Observer;
@@ -27,7 +29,6 @@
 import org.jboss.jsr299.tck.impl.packaging.Artifact;
 import org.jboss.jsr299.tck.impl.packaging.IntegrationTest;
 import org.jboss.jsr299.tck.impl.packaging.Packaging;
-import org.jboss.jsr299.tck.impl.packaging.PackagingType;
 import org.testng.annotations.Test;
 
 /**
@@ -39,8 +40,8 @@
  * 
  */
 @Artifact
+ at Packaging(EAR)
 @IntegrationTest
- at Packaging(PackagingType.EAR)
 public class EventTest extends AbstractDeclarativeTest
 {
    @Test(groups = { "stub", "events", "integration" })
@@ -61,8 +62,8 @@
    @SpecAssertion(section = "7.5.6", id = "unknown")
    public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
    {
-      Pomeranian dog = (Pomeranian) getCurrentManager().getInstanceByName("Teddy");
-      Agent dogAgent = getCurrentManager().getInstanceByType(DogAgent.class);
+      PomeranianInterface dog = (PomeranianInterface) getCurrentManager().getInstanceByName("Teddy");
+      Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
       dogAgent.sendOutsideTransaction("event");
    }
 
@@ -70,7 +71,7 @@
    @SpecAssertion(section = "7.5.6", id = "unknown")
    public void testAfterTransactionCompletionObserver()
    {
-      Agent dogAgent = getCurrentManager().getInstanceByType(DogAgent.class);
+      Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
       dogAgent.sendInTransaction("event");
    }
 
@@ -78,7 +79,7 @@
    @SpecAssertion(section = "7.5.6", id = "unknown")
    public void testAfterTransactionSuccessObserver()
    {
-      Agent dogAgent = getCurrentManager().getInstanceByType(DogAgent.class);
+      Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
       dogAgent.sendInTransaction(new Integer(4));
    }
 
@@ -129,14 +130,14 @@
    @SpecAssertion(section = "7.5.8", id = "unknown")
    public void testEnterpriseBeanObserverMethodCalledWithCallerContext()
    {
-      Set<Bean<Pomeranian>> beans = getCurrentManager().resolveByType(Pomeranian.class);
+      Set<Bean<PomeranianInterface>> beans = getCurrentManager().resolveByType(PomeranianInterface.class);
       assert !beans.isEmpty();
       String event = "A new event";
       Set<Observer<String>> observers = getCurrentManager().resolveObservers(event);
       assert observers.size() == 1;
 
       getCurrentManager().fireEvent(event);
-      Pomeranian dog = (Pomeranian) getCurrentManager().getInstanceByName("Teddy");
+      PomeranianInterface dog = (PomeranianInterface) getCurrentManager().getInstanceByName("Teddy");
    }
 
    @Test(groups = { "stub", "events", "integration" })

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/Pomeranian.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/Pomeranian.java	2009-02-18 17:49:01 UTC (rev 1574)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/Pomeranian.java	2009-02-18 18:15:05 UTC (rev 1575)
@@ -1,10 +1,15 @@
 package org.jboss.jsr299.tck.integration.event;
 
+import static javax.ejb.TransactionManagementType.BEAN;
+import static javax.transaction.Status.STATUS_COMMITTED;
+import static javax.transaction.Status.STATUS_ROLLEDBACK;
+
 import java.math.BigInteger;
 
 import javax.annotation.Named;
 import javax.annotation.Resource;
 import javax.ejb.EJBException;
+import javax.ejb.Local;
 import javax.ejb.SessionContext;
 import javax.ejb.Stateful;
 import javax.ejb.TransactionManagement;
@@ -15,19 +20,9 @@
 import javax.transaction.SystemException;
 import javax.transaction.UserTransaction;
 
-import static javax.ejb.TransactionManagementType.BEAN;
-import static javax.transaction.Status.STATUS_ACTIVE;
-import static javax.transaction.Status.STATUS_COMMITTED;
-import static javax.transaction.Status.STATUS_COMMITTING;
-import static javax.transaction.Status.STATUS_MARKED_ROLLBACK;
-import static javax.transaction.Status.STATUS_NO_TRANSACTION;
-import static javax.transaction.Status.STATUS_PREPARED;
-import static javax.transaction.Status.STATUS_PREPARING;
-import static javax.transaction.Status.STATUS_ROLLEDBACK;
-import static javax.transaction.Status.STATUS_ROLLING_BACK;
 
-
 @Stateful
+ at Local(PomeranianInterface.class)
 @Tame
 @Named("Teddy")
 @TransactionManagement(BEAN)

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/PomeranianInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/PomeranianInterface.java	2009-02-18 17:49:01 UTC (rev 1574)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/event/PomeranianInterface.java	2009-02-18 18:15:05 UTC (rev 1575)
@@ -1,6 +1,42 @@
 package org.jboss.jsr299.tck.integration.event;
 
+import java.math.BigInteger;
+
+import javax.event.AfterTransactionCompletion;
+import javax.event.AfterTransactionFailure;
+import javax.event.AfterTransactionSuccess;
+import javax.event.Observes;
+
 public interface PomeranianInterface
 {
-   
+   /**
+    * Observes a String event only after the transaction is completed.
+    * 
+    * @param someEvent
+    */
+   public void observeStringEvent(@Observes @AfterTransactionCompletion String someEvent);
+
+   /**
+    * Observes an Integer event if the transaction is successfully completed.
+    * 
+    * @param event
+    */
+   public void observeIntegerEvent(@Observes @AfterTransactionSuccess Integer event);
+
+   /**
+    * Observes a Float event only if the transaction failed.
+    * 
+    * @param event
+    */
+   public void observeFloatEvent(@Observes @AfterTransactionFailure Float event);
+
+   public void observeBigIntegerEvent(@Observes BigInteger event);
+
+   public boolean isCorrectContext();
+
+   public void setCorrectContext(boolean correctContext);
+
+   public boolean isCorrectTransactionState();
+
+   public void setCorrectTransactionState(boolean correctTransactionState);
 }




More information about the weld-commits mailing list