[webbeans-commits] Webbeans SVN: r3540 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Aug 17 14:34:04 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-17 14:34:04 -0400 (Mon, 17 Aug 2009)
New Revision: 3540
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
Log:
Make test pass
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -9,5 +9,7 @@
public abstract void sendInTransaction(Object event);
public abstract void sendOutsideTransaction(Object event);
+
+ public void sendInTransactionAndFail(Object event) throws Exception;
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -41,6 +41,21 @@
throw new EJBException("Transaction failure", e);
}
}
+
+ public void sendInTransactionAndFail(Object event) throws Exception
+ {
+ try
+ {
+ userTransaction.begin();
+ jsr299Manager.fireEvent(event);
+ throw new FooException();
+ }
+ finally
+ {
+ //userTransaction.commit();
+ }
+
+ }
public void sendOutsideTransaction(Object event)
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
+
+/**
+ * @author pmuir
+ *
+ */
+public class FooException extends Exception
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -113,12 +113,19 @@
@Test(groups = { "events", "integration", "ri-broken" })
@SpecAssertion(section = "10.4.5", id = "e")
// WBRI-303
- public void testAfterTransactionFailureObserver() throws InterruptedException
+ public void testAfterTransactionFailureObserver() throws Exception
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Float(4.0));
+ try
+ {
+ dogAgent.sendInTransactionAndFail(new Float(4.0));
+ }
+ catch (Exception e)
+ {
+ // Container will complain, we failed to complete the TX!
+ }
Thread.sleep(100);
assert dog.isCorrectTransactionState();
}
More information about the weld-commits
mailing list