Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. @RunWith(SpringJUnit4ClassRunner.class)
  2. @ContextConfiguration(locations = { .... })
  3. // order of test methods is important!
  4. @FixMethodOrder(MethodSorters.NAME_ASCENDING)
  5. public class MyTest {
  6. static {
  7. System.setProperty("myprop", "myvalue");
  8. }
  9.  
  10. /**
  11. * Fake test that forces spring to reload context before real tests.
  12. */
  13. @Test
  14. @DirtiesContext
  15. public void aaReloadContext() {
  16.  
  17. }
  18.  
  19. /**
  20. * Fake test that clears system property after tests.
  21. */
  22. @Test
  23. public void zzClearProperty() {
  24.  
  25. System.clearProperty("myprop");
  26. }
  27.  
  28. ... real test methods...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement