unit test « Transaction « Spring Q&A





1. AOP problem running Spring unit tests    stackoverflow.com

I have a Spring web application which is configured to use JDK proxying for AOP. The AOP annotations (such as @Transactional) are declared on the interfaces, rather than the implementation classes. The ...

2. Spring Transaction Management Test    stackoverflow.com

I want to test my Dao Class using the SpringContextTests.
In my method class I extended the AbstractTransactionalJUnit4SpringContextTests in order for my test class to integrate with JUnit4. I have also ...

3. BeforeClass using Spring transactional tests    stackoverflow.com

I'm using the Spring transactional test classes to do unit testing of my DAO code. What I want to do is create my database once, before all the tests run. ...

4. Spring / JTA / JPA unit test : Rollback not working    stackoverflow.com

I am trying to test an entity EJB3 with Spring. The EJB itself does not uses Spring and I would like to keep duplications of the production JPA configuration minimal (ie not ...

5. JTA: how to be test JMS and JDBC failures?    stackoverflow.com

we're currently working on testing JTA failure behaviour, on a system that receives messages using JMS, persists them, and sends results using another class. The whole thing is tied together using Spring. ...

6. TestNG multithreaded test with Spring @Transactional    stackoverflow.com

I am using TestNG to test persistence Spring modules (JPA+Hibernate) using AbstractTransactionalTestNGSpringContextTests as a base class. All important parts @Autowired, @TransactionConfiguration, @Transactional work just fine. The problem comes when I am trying ...

7. Unit Testing Hibernate's Optimistic Locking (within Spring)    stackoverflow.com

I'd like to write a unit test to verify that optimistic locking is properly set up (using Spring and Hibernate). I'd like to have the test class extend Spring's AbstractTransactionalJUnit4SpringContextTests. What I ...

8. When transactionManager is not named "transactionManager"     stackoverflow.com

I am trying Spring 3(.0.2.RELEASE) and JPA2 and Hibernate 3.5.1-Final... One thing upsets me is that spring seems only accept a transaction Manager named "transactionManager" If I don't name it "transactionManager" , Spring ...

9. Spring Transactional Unit Tests - Hibernate Queries Not Rolling Back    stackoverflow.com

I am using Spring 3, and Hibernate 3.5, I am not getting my transactions to rollback in the test environment, which has me worried they would not be rolled back in ...





10. Spring unit test case is not rolling back insertion of a record    stackoverflow.com

The following test cases are functionally working properly, but one of the test methods having to create a new article in the database doesn't rollback at the end of the test ...

11. spring, transaction and unit tests - how to set transaction on class level    stackoverflow.com

I'm using Spring junit runner, and its transaction capabilities to start and rollback transactions before and after every test. However I have a test class with some heavy DB initialization and I ...

12. Transaction does not roll back when using Spring 3 @Transactional annotation    stackoverflow.com

I am using the Spring (version 3.0) '@Transactional' annotation in order to demonstrate transaction support in Spring but can't get this working (despite having seen similar issues people have encountered in this ...

13. Spring @Transactional: Rollback information reported but not actually performed    stackoverflow.com

I have annotated my test classes as follows:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:WebContent/WEB-INF/applicationContext.xml", "file:WebContent/WEB-INF/context-aspects.xml"})
@Transactional
public class MyTest {

}
However, when executing tests, the test database is suddenly filled with values, although @Transactional is enabled and I can read ...

14. Spring/Hibernate/TestNG - manual session and transaction setup    stackoverflow.com

I am trying to create a testcase for my DAO classes that use plain Hibernate API (no Spring stuff like HibernateTemplate,HibernateDaoSupport), just like this:

sessionFactory.getCurrentSession().save(obj);
I have the appropriate sessionFactory and transactionManager definition ...

15. Spring, Hibernate @OneToOne Problem with Transactional Test    stackoverflow.com

i have a Problem while testing my DAOObject. I have two Entitys which are linked by a @oneToOne relation. The Classes are:

@Entity
@Table
public class Device extends HyEntity {

    ...

16. How do I write useful unit/integration tests when using Spring AOP and @Transactional?    stackoverflow.com

I have a logging aspect defined around a particular service. I am using Spring AOP and advising a number of service methods in order to log specific application events related to ...





17. JTA Callbacks in Spring    stackoverflow.com

Is it possible to register some kind of callback with a JTA transaction in a Spring application? I've got some mock services that are standing in for remote services that belong to ...

18. Transaction propagation in Unit Tests    forum.springsource.org

Dear Spring Batch developers, I wonder how to deal with the following situation. In my unit test I would like to persist few domain objects (via HibernateTemplate-based DAO) before launching the ...

19. Transaction behaviour within Unit Testing    forum.springsource.org

Transaction behaviour within Unit Testing Hello! after having read the reference docs and doing some testing by myself I am kind of lost concerning the transaction behaviour of Spring Batch within ...

20. Unit Testing Spring Transactions    forum.springsource.org

Unit Testing Spring Transactions I have searched for the answer to my upcoming question but can't seem to get a good answer. I have a service layer method annotated with Code: ...

21. Problem with Unit-Test, Rollback and 'Locking' in spring    forum.springsource.org

Jun 16th, 2005, 08:21 PM #1 mcamuto View Profile View Forum Posts Private Message Junior Member Join Date Jun 2005 Posts 4 Problem with Unit-Test, Rollback and 'Locking' in spring Hi ...

22. Unit testing Programmatic Transaction code    forum.springsource.org

Unit testing Programmatic Transaction code Hi, I'm authoring a web application that requires runtime access to different database - as in, the user actually types in the database connection info (host ...

23. iBATIS unit test, transactional    forum.springsource.org

iBATIS unit test, transactional Hello! Probably this question was already answered, so please don't beat me hardly I would like to perform some unit testing for my iBATIS mappings, without involving ...

24. Hibernate unit testing error with clobs-Active Spring transaction synchronization or    forum.springsource.org

Hibernate unit testing error with clobs-Active Spring transaction synchronization or Im trying to unit test the saving of an hibernate objects with clobs in them. I had been having no trouble ...

25. Transactions not rolling back in Unit Tests    forum.springsource.org

Nov 7th, 2007, 12:59 PM #1 Jearil View Profile View Forum Posts Private Message Junior Member Join Date Nov 2007 Posts 7 Transactions not rolling back in Unit Tests Hi, I've ...

26. Unit testing and Transactions across multiple dataSources    forum.springsource.org

It appears that a jta manager is needed to perform transactions across multiple dataSources, right ? ... So how can I do some unit testing (no app server so no jta) ...

27. Problems with unit testing and transactions    forum.springsource.org

Problems with unit testing and transactions Hi. I have implemented a simple DAO class which extends HibernateDAOSupport and uses its internal HibernateTemplate to store data. But then I read on HibernateTemplate ...

28. UnsatisfiedDependencyException when setting up transactionManager for unit tests    forum.springsource.org

Jan 28th, 2009, 04:30 PM #1 manoflogan View Profile View Forum Posts Private Message Member Join Date Feb 2007 Posts 42 UnsatisfiedDependencyException when setting up transactionManager for unit tests I am ...

29. Wrapping an entire unit test in a transaction    forum.springsource.org

Wrapping an entire unit test in a transaction I have been using Spring's Testing support to wrap JUnit 4.4 @Test-annotated methods in transactions and it works great. However, what about a ...

30. Transaction propagation in unit tests.    forum.springsource.org

Transaction propagation in unit tests. Hi, I am creating a test cases for my spring services used with EclipseLink JPA. I am extending from AbstractJpaTests. I am using two services within ...

31. Howto JTA + JPA + JDBC in unit tests    forum.springsource.org

Howto JTA + JPA + JDBC in unit tests Hi, I'm struggling a bit because I cannot get JTA transactions to work in a unit test. The scenario I'm trying to ...

32. Unit testing and tx:jta-transaction-manager    forum.springsource.org

Unit testing and tx:jta-transaction-manager Java 1.4 / WebSphere 6.0 / Spring 2.5.6 I have a declared in my Spring context file. Another bean is constructor injected with this transactionManager, expecting ...

33. unit testing and manually committing a transaction    forum.springsource.org

unit testing and manually committing a transaction Hi all, I've written my own Datanucleus plugin for Cassandra. As a result, I'm using JDO and spring for my data access tier. I'm ...

34. Manual transaction management in unit tests    forum.springsource.org

Manual transaction management in unit tests I have recently switched from the hibernateTemplate to the direct sessionFactory.getCurrentSession(), and I am running into some issues with transactions in my unit tests. I ...

35. Writing a good unit test for optimistic locking    forum.springsource.org

Writing a good unit test for optimistic locking Hi, we have a service class annotated a self-made @Retryable annotation. Then we have an Aspect, wrapping methods annotated with @Retryable, which will ...