warnings fixed
authorMichael <Michael@Michael-LT.fritz.box>
Tue, 1 Dec 2015 22:00:14 +0000 (23:00 +0100)
committerMichael <Michael@Michael-LT.fritz.box>
Tue, 1 Dec 2015 22:00:14 +0000 (23:00 +0100)
src/test/java/ch/bfh/ti/srs/controller/UserControllerTest.java

index 0a29a09..a63687e 100644 (file)
@@ -107,6 +107,7 @@ public class UserControllerTest {
                assertTrue(uc.logIn("TestUser1", "pass1"));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getLoggedUserNameTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -122,14 +123,16 @@ public class UserControllerTest {
                assertEquals("TestUser1", uc.getLoggedUserName());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void getLoggedUserNameExceptionTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
                UserController uc = new UserController(dh);\r
                uc.setDataHandler(null);\r
-               String currentUserName = uc.getLoggedUserName();\r
+               uc.getLoggedUserName();\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getLoggedUserMailTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -145,14 +148,16 @@ public class UserControllerTest {
                assertEquals("hanfli@bfh.ch", uc.getLoggedMail());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void getLoggedMailExceptionTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
                UserController uc = new UserController(dh);\r
                uc.setDataHandler(null);\r
-               String currentMail = uc.getLoggedMail();\r
+               uc.getLoggedMail();\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getLoggedNameTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -168,6 +173,7 @@ public class UserControllerTest {
                assertEquals("Hanfli", uc.getLoggedName());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void getLoggedNameExceptionTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -176,6 +182,7 @@ public class UserControllerTest {
                uc.getLoggedName();\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getLoggedLastnameTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -191,12 +198,13 @@ public class UserControllerTest {
                assertEquals("User", uc.getLoggedLastname());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void getLoggedLastnameExceptionTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
                UserController uc = new UserController(dh);\r
                uc.setDataHandler(null);\r
-               String currentLastName = uc.getLoggedLastname();\r
+               uc.getLoggedLastname();\r
        }\r
 \r
        @Test\r
@@ -243,6 +251,7 @@ public class UserControllerTest {
                assertEquals("grosm9@bfh.ch", uc.getUser("TestUser1").getMail());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void logOutTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -285,6 +294,7 @@ public class UserControllerTest {
                uc.getUser(null);\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getReservationTests() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -306,7 +316,6 @@ public class UserControllerTest {
                dh.addResource(resource2);\r
                dh.addResource(resource3);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
                User testUser2 = uc.getUser("TestUser2");\r
 \r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
@@ -403,6 +412,7 @@ public class UserControllerTest {
                uc.getReservationsInDateRange(null);\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void makeReservationTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -428,6 +438,7 @@ public class UserControllerTest {
                assertEquals(null, uc.makeReservation(null, resource2, dtList, "remark"));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void makeInvalidReservationTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -464,6 +475,7 @@ public class UserControllerTest {
                assertEquals(4, uc.makeReservation(uc.getLoggedUser(), resource1, conflictingList, null).size());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = IllegalArgumentException.class)\r
        public void makeReservationException1Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -489,6 +501,7 @@ public class UserControllerTest {
                assertEquals(null, uc.makeReservation(null, resource1, dtList, "remark"));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = IllegalArgumentException.class)\r
        public void makeReservationException2Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -513,6 +526,7 @@ public class UserControllerTest {
                assertEquals(null, uc.makeReservation(null, null, dtList, "remark"));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = IllegalArgumentException.class)\r
        public void makeReservationException3Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -558,6 +572,7 @@ public class UserControllerTest {
                assertEquals(null, uc.makeReservation(null, resource1, dtList, "remark"));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void changeReservationTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -573,9 +588,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -589,6 +601,7 @@ public class UserControllerTest {
                assertEquals(newDateRange, uc.getReservation(reservationClone.getId()).getDateRange());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void changeReservationException1Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -608,9 +621,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -627,6 +637,7 @@ public class UserControllerTest {
                assertEquals(newDateRange, uc.getReservation(reservationClone.getId()).getDateRange());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void changeReservationException2Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -646,9 +657,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -665,6 +673,7 @@ public class UserControllerTest {
                assertEquals(newDateRange, uc.getReservation(reservationClone.getId()).getDateRange());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = IllegalArgumentException.class)\r
        public void changeReservationException3Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -684,9 +693,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -702,6 +708,7 @@ public class UserControllerTest {
                assertEquals(newDateRange, uc.getReservation(reservationClone.getId()).getDateRange());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void changeReservationException4Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -721,9 +728,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -741,6 +745,7 @@ public class UserControllerTest {
                assertEquals(newDateRange, uc.getReservation(reservationClone.getId()).getDateRange());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void deleteReservationTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -760,9 +765,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -772,6 +774,7 @@ public class UserControllerTest {
                assertEquals(null, uc.getReservation(reservation1.getId()));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void deleteReservationException1Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -791,9 +794,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -804,6 +804,7 @@ public class UserControllerTest {
                assertEquals(null, uc.getReservation(reservation1.getId()));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void deleteReservationException2Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -823,9 +824,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -836,6 +834,7 @@ public class UserControllerTest {
                assertEquals(null, uc.getReservation(reservation1.getId()));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = IllegalArgumentException.class)\r
        public void deleteReservationException3Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -855,9 +854,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -867,6 +863,7 @@ public class UserControllerTest {
                assertEquals(null, uc.getReservation(reservation1.getId()));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void deleteReservationException4Test() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -886,9 +883,6 @@ public class UserControllerTest {
                Resource resource1 = new Resource("Room101", "Class room");\r
                dh.addResource(resource1);\r
 \r
-               User loggedUser = uc.getLoggedUser();\r
-               User testUser2 = uc.getUser("TestUser2");\r
-\r
                Reservation reservation1 = new Reservation(groupId, uc.getLoggedUser(), resource1, dateRange,\r
                                "Test reservation1");\r
                dh.addReservation(reservation1);\r
@@ -900,6 +894,7 @@ public class UserControllerTest {
                assertEquals(null, uc.getReservation(reservation1.getId()));\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test\r
        public void getResourcesTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
@@ -926,6 +921,7 @@ public class UserControllerTest {
                assertEquals(3, resList.size());\r
        }\r
 \r
+       @SuppressWarnings("deprecation")\r
        @Test(expected = Exception.class)\r
        public void getResourcesExceptionTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r