From 8c35832b28b244911bd07fc7a0b9ea7b2b1b5c07 Mon Sep 17 00:00:00 2001 From: Mary Tran Date: Mon, 22 Oct 2018 14:23:01 -0400 Subject: [PATCH] Fixing getAllUsers again --- .../java/com/uottawa/olympus/olympusservices/DBHelper.java | 1 + .../uottawa/olympus/olympusservices/DBIntegrationTest.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java index e98dba1..18ed2e6 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java @@ -230,6 +230,7 @@ public class DBHelper extends SQLiteOpenHelper { user[j] = cursor.getString(j); } listOfUsers.add(user); + cursor.moveToNext(); } } cursor.close(); diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java index 5de26cd..c9c1154 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java @@ -115,6 +115,10 @@ public class DBIntegrationTest { List allUsers = dbHelper.getAllUsers(); for (String[] user : allUsers){ +// for (String s : user){ +// System.out.print(s + " "); +// } +// System.out.println(); UserType usertype = dbHelper.findUserByUsername(user[0]); assertEquals(usertype.getFirstname(), user[1]); assertEquals(usertype.getLastname(), user[2]); @@ -123,6 +127,6 @@ public class DBIntegrationTest { dbHelper.deleteUser("jbO4aBF4dC"); } - + }