From 7f473f9200c0c6e2f588537da2ce81715b327043 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 8 Jun 2018 11:15:51 +0500 Subject: Update Database tests --- test/org/traccar/database/DataManagerTest.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/org') diff --git a/test/org/traccar/database/DataManagerTest.java b/test/org/traccar/database/DataManagerTest.java index f9945c994..23043e96e 100644 --- a/test/org/traccar/database/DataManagerTest.java +++ b/test/org/traccar/database/DataManagerTest.java @@ -18,11 +18,11 @@ public class DataManagerTest { @Test public void constructObjectQuery() { - assertEquals("SELECT * FROM users", + assertEquals("SELECT * FROM tc_users", DataManager.constructObjectQuery(DataManager.ACTION_SELECT_ALL, User.class, false)); - assertEquals("DELETE FROM groups WHERE id = :id", + assertEquals("DELETE FROM tc_groups WHERE id = :id", DataManager.constructObjectQuery(DataManager.ACTION_DELETE, Group.class, false)); - assertEquals("SELECT * FROM positions WHERE id = :id", + assertEquals("SELECT * FROM tc_positions WHERE id = :id", DataManager.constructObjectQuery(DataManager.ACTION_SELECT, Position.class, false)); String insertDevice = DataManager.constructObjectQuery(DataManager.ACTION_INSERT, Device.class, false); @@ -52,28 +52,28 @@ public class DataManagerTest { @Test public void constructPermissionsQuery() { - assertEquals("SELECT userId, deviceId FROM user_device", + assertEquals("SELECT userId, deviceId FROM tc_user_device", DataManager.constructPermissionQuery(DataManager.ACTION_SELECT_ALL, User.class, Device.class)); - assertEquals("SELECT userId, managedUserId FROM user_user", + assertEquals("SELECT userId, managedUserId FROM tc_user_user", DataManager.constructPermissionQuery(DataManager.ACTION_SELECT_ALL, User.class, ManagedUser.class)); - assertEquals("SELECT deviceId, driverId FROM device_driver", + assertEquals("SELECT deviceId, driverId FROM tc_device_driver", DataManager.constructPermissionQuery(DataManager.ACTION_SELECT_ALL, Device.class, Driver.class)); - assertEquals("SELECT groupId, geofenceId FROM group_geofence", + assertEquals("SELECT groupId, geofenceId FROM tc_group_geofence", DataManager.constructPermissionQuery(DataManager.ACTION_SELECT_ALL, Group.class, Geofence.class)); - assertEquals("INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId)", + assertEquals("INSERT INTO tc_user_device (userId, deviceId) VALUES (:userId, :deviceId)", DataManager.constructPermissionQuery(DataManager.ACTION_INSERT, User.class, Device.class)); - assertEquals("DELETE FROM user_user WHERE userId = :userId AND managedUserId = :managedUserId", + assertEquals("DELETE FROM tc_user_user WHERE userId = :userId AND managedUserId = :managedUserId", DataManager.constructPermissionQuery(DataManager.ACTION_DELETE, User.class, ManagedUser.class)); - assertEquals("INSERT INTO device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId)", + assertEquals("INSERT INTO tc_device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId)", DataManager.constructPermissionQuery(DataManager.ACTION_INSERT, Device.class, Geofence.class)); - assertEquals("DELETE FROM group_attribute WHERE groupId = :groupId AND attributeId = :attributeId", + assertEquals("DELETE FROM tc_group_attribute WHERE groupId = :groupId AND attributeId = :attributeId", DataManager.constructPermissionQuery(DataManager.ACTION_DELETE, Group.class, Attribute.class)); } -- cgit v1.2.3