diff --git a/hsarback/test/de/hsadmin/remote/DomainTest.java b/hsarback/test/de/hsadmin/remote/DomainTest.java index 5470d35..c7fb942 100644 --- a/hsarback/test/de/hsadmin/remote/DomainTest.java +++ b/hsarback/test/de/hsadmin/remote/DomainTest.java @@ -36,7 +36,7 @@ public class DomainTest { @Test public void testSearchAllAsPacAdmin() { - String user = "peh00"; + String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map whereParams = new HashMap(); Object[] params = new Object[] { user, @@ -49,7 +49,7 @@ public class DomainTest { for (Object o : result) { if (o instanceof Map) { Map row = (Map) o; - assertEquals("peh00", row.get("user")); + assertEquals("aaa00", row.get("user")); } else { fail("map expected"); } diff --git a/hsarback/test/de/hsadmin/remote/EMailAddressTest.java b/hsarback/test/de/hsadmin/remote/EMailAddressTest.java index 4452d28..2b02e13 100644 --- a/hsarback/test/de/hsadmin/remote/EMailAddressTest.java +++ b/hsarback/test/de/hsadmin/remote/EMailAddressTest.java @@ -35,7 +35,7 @@ public class EMailAddressTest { @Test public void testSearchAllAsPacAdmin() { - String user = "peh00"; + String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map whereParams = new HashMap(); Object[] params = new Object[] { user, @@ -48,7 +48,7 @@ public class EMailAddressTest { for (Object o : result) { if (o instanceof Map) { Map row = (Map) o; - assertEquals("peh00", row.get("pac")); + assertEquals("aaa00", row.get("pac")); } else { fail("map expected"); } @@ -60,7 +60,7 @@ public class EMailAddressTest { @Test public void testSearchAsPacAdmin() { - String user = "peh00"; + String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map whereParams = new HashMap(); whereParams.put("domain", "herzensklaenge.de"); @@ -74,7 +74,7 @@ public class EMailAddressTest { for (Object o : result) { if (o instanceof Map) { Map row = (Map) o; - assertEquals("peh00", row.get("pac")); + assertEquals("aaa00", row.get("pac")); } else { fail("map expected"); } @@ -87,11 +87,11 @@ public class EMailAddressTest { @Test public void testUpdate() { int count = getTargetCount(); - String user = "peh00"; + String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map setParams = new HashMap(); Map whereParams = new HashMap(); - setParams.put("target", "peh00-phor"); + setParams.put("target", "aaa00-test2"); whereParams.put("domain", "jalin.de"); whereParams.put("localpart", "fax"); Object[] params = new Object[] { user, @@ -107,7 +107,7 @@ public class EMailAddressTest { assertEquals(count + 1, getTargetCount()); setParams = new HashMap(); whereParams = new HashMap(); - setParams.put("target", "peh00-hotline"); + setParams.put("target", "aaa00-test2"); whereParams.put("domain", "jalin.de"); whereParams.put("localpart", "fax"); params = new Object[] { user, diff --git a/hsarback/test/de/hsadmin/remote/EMailAliasTest.java b/hsarback/test/de/hsadmin/remote/EMailAliasTest.java index 9cceaea..6fb4d4a 100644 --- a/hsarback/test/de/hsadmin/remote/EMailAliasTest.java +++ b/hsarback/test/de/hsadmin/remote/EMailAliasTest.java @@ -33,7 +33,7 @@ public class EMailAliasTest { @Test public void testSearchAllAsPacAdmin() { - String user = "peh00"; + String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map whereParams = new HashMap(); Object[] params = new Object[] { user, @@ -46,7 +46,7 @@ public class EMailAliasTest { for (Object o : result) { if (o instanceof Map) { Map row = (Map) o; - assertEquals("peh00", row.get("pac")); + assertEquals("aaa00", row.get("pac")); } else { fail("map expected"); } diff --git a/hsarback/test/de/hsadmin/remote/MysqlDbTest.java b/hsarback/test/de/hsadmin/remote/MysqlDbTest.java index 77d7c3d..22c7643 100644 --- a/hsarback/test/de/hsadmin/remote/MysqlDbTest.java +++ b/hsarback/test/de/hsadmin/remote/MysqlDbTest.java @@ -48,10 +48,33 @@ public class MysqlDbTest { try { Object execute = client.execute(MODULE + ".add", params); assertTrue(execute instanceof Map); + params[1] = cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()); + setParams.put("name", "aaa00_db2"); + execute = client.execute(MODULE + ".add", params); + assertTrue(execute instanceof Map); } catch (XmlRpcException e) { fail(e.getMessage()); } - assertEquals(count + 1, getDBsCount()); + assertEquals(count + 2, getDBsCount()); + } + + @Test + public void testDelete() { + int count = getDBsCount(); + String user = "aaa00"; + String grantingTicketURL = cas.getGrantingTicketURL(user); + Map whereParams = new HashMap(); + whereParams.put("name", "aaa00_db2"); + Object[] params = new Object[] { user, + cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), + whereParams }; + try { + Object execute = client.execute(MODULE + ".delete", params); + assertNull(execute); + } catch (XmlRpcException e) { + fail(e.getMessage()); + } + assertEquals(count - 1, getDBsCount()); } @Test @@ -71,25 +94,6 @@ public class MysqlDbTest { } } - @Test - public void testDelete() { - int count = getDBsCount(); - String user = "aaa00"; - String grantingTicketURL = cas.getGrantingTicketURL(user); - Map whereParams = new HashMap(); - whereParams.put("name", "aaa00_db1"); - Object[] params = new Object[] { user, - cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), - whereParams }; - try { - Object execute = client.execute(MODULE + ".delete", params); - assertNull(execute); - } catch (XmlRpcException e) { - fail(e.getMessage()); - } - assertEquals(count - 1, getDBsCount()); - } - private int getDBsCount() { int count = 0; String user = "aaa00"; diff --git a/hsarback/test/de/hsadmin/remote/MysqlUserTest.java b/hsarback/test/de/hsadmin/remote/MysqlUserTest.java index 065437d..e9b2093 100644 --- a/hsarback/test/de/hsadmin/remote/MysqlUserTest.java +++ b/hsarback/test/de/hsadmin/remote/MysqlUserTest.java @@ -48,10 +48,14 @@ public class MysqlUserTest { try { Object execute = client.execute(MODULE + ".add", params); assertTrue(execute instanceof Map); + setParams.put("name", "aaa00_dba2"); + params[1] = cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()); + execute = client.execute(MODULE + ".add", params); + assertTrue(execute instanceof Map); } catch (XmlRpcException e) { fail(e.getMessage()); } - assertEquals(count + 1, getDBUsersCount()); + assertEquals(count + 2, getDBUsersCount()); } @Test @@ -71,13 +75,13 @@ public class MysqlUserTest { } } - @Test @Ignore + @Test public void testDelete() { int count = getDBUsersCount(); String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); Map whereParams = new HashMap(); - whereParams.put("name", "aaa00_dba"); + whereParams.put("name", "aaa00_dba2"); Object[] params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), whereParams }; diff --git a/hsarback/test/de/hsadmin/remote/PgsqlDbTest.java b/hsarback/test/de/hsadmin/remote/PgsqlDbTest.java index fbcb45a..e5fe826 100644 --- a/hsarback/test/de/hsadmin/remote/PgsqlDbTest.java +++ b/hsarback/test/de/hsadmin/remote/PgsqlDbTest.java @@ -48,27 +48,14 @@ public class PgsqlDbTest { try { Object execute = client.execute(MODULE + ".add", params); assertTrue(execute instanceof Map); + setParams.put("name", "aaa00_db2"); + params[1] = cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()); + execute = client.execute(MODULE + ".add", params); + assertTrue(execute instanceof Map); } catch (XmlRpcException e) { fail(e.getMessage()); } - assertEquals(count + 1, getDBsCount()); - } - - @Test - public void testSearch() { - String user = "aaa00"; - String grantingTicketURL = cas.getGrantingTicketURL(user); - Map whereParams = new HashMap(); - Object[] params = new Object[] { user, - cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), - whereParams }; - try { - Object execute = client.execute(MODULE + ".search", params); - Object[] result = (Object[]) execute; - assertEquals(1, result.length); - } catch (XmlRpcException e) { - fail(e.getMessage()); - } + assertEquals(count + 2, getDBsCount()); } @Test @@ -90,6 +77,23 @@ public class PgsqlDbTest { assertEquals(count - 1, getDBsCount()); } + @Test + public void testSearch() { + String user = "aaa00"; + String grantingTicketURL = cas.getGrantingTicketURL(user); + Map whereParams = new HashMap(); + Object[] params = new Object[] { user, + cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), + whereParams }; + try { + Object execute = client.execute(MODULE + ".search", params); + Object[] result = (Object[]) execute; + assertEquals(1, result.length); + } catch (XmlRpcException e) { + fail(e.getMessage()); + } + } + private int getDBsCount() { int count = 0; String user = "aaa00"; diff --git a/hsarback/test/de/hsadmin/remote/PgsqlUserTest.java b/hsarback/test/de/hsadmin/remote/PgsqlUserTest.java index 43e13de..a337ead 100644 --- a/hsarback/test/de/hsadmin/remote/PgsqlUserTest.java +++ b/hsarback/test/de/hsadmin/remote/PgsqlUserTest.java @@ -48,10 +48,33 @@ public class PgsqlUserTest { try { Object execute = client.execute(MODULE + ".add", params); assertTrue(execute instanceof Map); + setParams.put("name", "aaa00_dba2"); + params[1] = cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()); + execute = client.execute(MODULE + ".add", params); + assertTrue(execute instanceof Map); } catch (XmlRpcException e) { fail(e.getMessage()); } - assertEquals(count + 1, getDBsCount()); + assertEquals(count + 2, getDBsCount()); + } + + @Test + public void testDelete() { + int count = getDBsCount(); + String user = "aaa00"; + String grantingTicketURL = cas.getGrantingTicketURL(user); + Map whereParams = new HashMap(); + whereParams.put("name", "aaa00_dba2"); + Object[] params = new Object[] { user, + cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), + whereParams }; + try { + Object execute = client.execute(MODULE + ".delete", params); + assertNull(execute); + } catch (XmlRpcException e) { + fail(e.getMessage()); + } + assertEquals(count - 1, getDBsCount()); } @Test @@ -71,25 +94,6 @@ public class PgsqlUserTest { } } - @Test @Ignore - public void testDelete() { - int count = getDBsCount(); - String user = "aaa00"; - String grantingTicketURL = cas.getGrantingTicketURL(user); - Map whereParams = new HashMap(); - whereParams.put("name", "aaa00_dba"); - Object[] params = new Object[] { user, - cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), - whereParams }; - try { - Object execute = client.execute(MODULE + ".delete", params); - assertNull(execute); - } catch (XmlRpcException e) { - fail(e.getMessage()); - } - assertEquals(count - 1, getDBsCount()); - } - private int getDBsCount() { int count = 0; String user = "aaa00"; diff --git a/hsarback/test/de/hsadmin/remote/RemoteTest.java b/hsarback/test/de/hsadmin/remote/RemoteTest.java index adcab36..db9e793 100644 --- a/hsarback/test/de/hsadmin/remote/RemoteTest.java +++ b/hsarback/test/de/hsadmin/remote/RemoteTest.java @@ -12,10 +12,10 @@ import org.junit.runners.Suite; MysqlDbTest.class, PgsqlUserTest.class, PgsqlDbTest.class, - CustomerTest.class // EMailAliasTest.class, -// EMailAddressTest.class, // DomainTest.class, +// EMailAddressTest.class, + CustomerTest.class // HostmasterTest.class, // QueueTaskTest.class })