Created
October 6, 2012 23:32
-
-
Save PiotrNowicki/3846509 to your computer and use it in GitHub Desktop.
Arquillian persistence problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void dataIsPopulated() { | |
// given populated cache | |
// when | |
List<Question> questions = cut.getQuestions(); | |
// then | |
assertThat(questions.size()).isEqualTo(3); | |
} | |
@Test | |
//@Transactional(TransactionMode.ROLLBACK) | |
public void updateGeneratesEvent() throws NotSupportedException, SystemException { | |
utx.begin(); | |
// given | |
Question question = cut.getQuestions().get(0); | |
// when | |
question.setSummary("My test summary"); | |
cut.updateQuestion(question); | |
// then | |
Question actual = cut.getQuestionById(question.getId()); | |
assertThat(actual.getSummary()).isEqualTo("My test summary"); | |
utx.rollback(); | |
} |
JTA module is already there, just hidden in APE internals hehe. Having kinda headache with it currently :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like a charm mate! I put
@Cleanup(phase = TestExecutionPhase.NONE)
at the class level and@Transactional(TransactionMode.ROLLBACK)
for each transactional method that should be rolled-back.Thanks once again - I'll look forward to watching JTA module arriving :-)
BTW: great job with this APE :-)