Fixed account server TC
authoryeonghun.nam <yeonghun.nam@samsung.com>
Wed, 28 Sep 2016 00:03:53 +0000 (09:03 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Thu, 19 Jan 2017 09:01:50 +0000 (09:01 +0000)
1. DB reset for each test case

Change-Id: I7cc9d46af2ffe6136b13231d9b0e015ee6799dcf
Signed-off-by: yeonghun.nam <yeonghun.nam@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12373
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
(cherry picked from commit c8ea7c0831a5a268b3a4ac4fda81d3b420121645)
Reviewed-on: https://gerrit.iotivity.org/gerrit/16547
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/account/session/SessionResourceTest.java
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/acl/group/GroupResourceTest.java

index 5224f76c2d388ed7a8335e2386358230ce7c4316..1c8efc72893fcd951868f643095d387c515f422d 100644 (file)
@@ -112,6 +112,14 @@ public class SessionResourceTest {
         mongoDB.createTable(Constants.GROUP_TABLE);
     }
 
+    @After
+    public void resetAccountDatabase() throws Exception {
+        MongoDB mongoDB = new MongoDB(Constants.DB_NAME);
+        mongoDB.createTable(Constants.USER_TABLE);
+        mongoDB.createTable(Constants.TOKEN_TABLE);
+        mongoDB.createTable(Constants.GROUP_TABLE);
+    }
+
     @Test
     public void testSignInOnDefaultRequestReceived() throws Exception {
         getTestMethodName();
index 325a498504bfc5c3226016c6bc125c34006285be..87c33788afebd69b2e31887b4966b410b0e80afc 100644 (file)
@@ -121,6 +121,14 @@ public class GroupResourceTest {
         mongoDB.createTable(Constants.ACE_TABLE);
     }
 
+    @After
+    public void resetAccountDatabase() throws Exception {
+        MongoDB mongoDB = new MongoDB(Constants.DB_NAME);
+        mongoDB.createTable(Constants.USER_TABLE);
+        mongoDB.createTable(Constants.TOKEN_TABLE);
+        mongoDB.createTable(Constants.GROUP_TABLE);
+    }
+
     @Test
     public void testCreateGroup() throws Exception {
         getTestMethodName();