Guest User

Untitled

a guest
Feb 3rd, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. _________________________Daemon.java___________________________________
  2. /**
  3. * @param daemon, the daemon user
  4. * however this is not the preferred method for checking to see if the current thread is a daemon thread
  5. * rather use Daemon.isDeamonThread()
  6. * the isDaemonThread is preferred for checking to see if you are in that thread or if the current thread is daemon.
  7. *
  8. * @should user is a daemon one if user Uuid is equal to daemon Uuid
  9. * @should user is not a daemon one if user Uuid is not equal to daemon Uuid
  10. */
  11. public boolean isDaemonUser(User daemon) {
  12. return daemon.getUuid() == "A4F30A1B-5EB9-11DF-A648-37A07F9C90FB";
  13. }
  14. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  15.  
  16.  
  17. ____________________________DaemonTest.java____________________________________
  18. /**
  19. * @see Daemon#isDaemonUser(User)
  20. * @verifies user is a daemon one if user Uuid is equal to daemon Uuid
  21. */
  22. @Test
  23. public void isDaemonUser_userIsdaemonIfUserUuidIsEqualTodaemonUuid() {
  24. User daemon = new User();
  25. daemon.setUuid("A4F30A1B-5EB9-11DF-A648-37A07F9C90FB");
  26. Assert.assertTrue(new Daemon().isDaemonUser(daemon));
  27. }
  28.  
  29. /**
  30. * @see Daemon#isDaemonUser(User)
  31. * @verifies user is not a daemon one if user Uuid is not equal to daemon Uuid
  32. */
  33. @Test
  34. public void isDaemonUser_userIsNotdaemonIfUserUuidIsNotEqualTodaemonUuid() {
  35. User daemon = new User();
  36. daemon.setUuid("any other value");
  37. Assert.assertFalse(new Daemon().isDaemonUser(daemon));
  38. }
  39. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Advertisement
Add Comment
Please, Sign In to add comment