HHH-6020: fixing the jta exception listener test - different exception thrown

This commit is contained in:
adamw 2011-04-02 10:01:59 +02:00
parent 8c233312ce
commit 8ac8b87d8c
1 changed files with 4 additions and 1 deletions

View File

@ -25,11 +25,13 @@ package org.hibernate.envers.test.integration.jta;
import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.envers.test.AbstractEntityTest; import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.Priority;
import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.StrTestEntity;
import org.hibernate.envers.test.integration.reventity.ExceptionListenerRevEntity; import org.hibernate.envers.test.integration.reventity.ExceptionListenerRevEntity;
import org.junit.Test; import org.junit.Test;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.transaction.RollbackException;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import static org.hibernate.envers.test.EnversTestingJtaBootstrap.*; import static org.hibernate.envers.test.EnversTestingJtaBootstrap.*;
@ -48,7 +50,8 @@ public class JtaExceptionListener extends AbstractEntityTest {
cfg.addAnnotatedClass(ExceptionListenerRevEntity.class); cfg.addAnnotatedClass(ExceptionListenerRevEntity.class);
} }
@Test(expected = RuntimeException.class) @Test(expected = RollbackException.class)
@Priority(5) // must run before testDataNotPersisted()
public void testTransactionRollback() throws Exception { public void testTransactionRollback() throws Exception {
tm.begin(); tm.begin();