Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _________________________Daemon.java___________________________________
- /**
- * @param daemon, the daemon user
- * however this is not the preferred method for checking to see if the current thread is a daemon thread
- * rather use Daemon.isDeamonThread()
- * the isDaemonThread is preferred for checking to see if you are in that thread or if the current thread is daemon.
- *
- * @should user is a daemon one if user Uuid is equal to daemon Uuid
- * @should user is not a daemon one if user Uuid is not equal to daemon Uuid
- */
- public boolean isDaemonUser(User daemon) {
- return daemon.getUuid() == "A4F30A1B-5EB9-11DF-A648-37A07F9C90FB";
- }
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ____________________________DaemonTest.java____________________________________
- /**
- * @see Daemon#isDaemonUser(User)
- * @verifies user is a daemon one if user Uuid is equal to daemon Uuid
- */
- @Test
- public void isDaemonUser_userIsdaemonIfUserUuidIsEqualTodaemonUuid() {
- User daemon = new User();
- daemon.setUuid("A4F30A1B-5EB9-11DF-A648-37A07F9C90FB");
- Assert.assertTrue(new Daemon().isDaemonUser(daemon));
- }
- /**
- * @see Daemon#isDaemonUser(User)
- * @verifies user is not a daemon one if user Uuid is not equal to daemon Uuid
- */
- @Test
- public void isDaemonUser_userIsNotdaemonIfUserUuidIsNotEqualTodaemonUuid() {
- User daemon = new User();
- daemon.setUuid("any other value");
- Assert.assertFalse(new Daemon().isDaemonUser(daemon));
- }
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Advertisement
Add Comment
Please, Sign In to add comment