From fe6d4075239ef9946cd972933b7d30e70311004f Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Mon, 2 Jan 2012 14:27:42 +0000 Subject: [PATCH] email-tests --- .../de/hsadmin/remote/EMailAddressTest.java | 12 ++++++------ .../test/de/hsadmin/remote/EMailAliasTest.java | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hsarback/test/de/hsadmin/remote/EMailAddressTest.java b/hsarback/test/de/hsadmin/remote/EMailAddressTest.java index d888de6..9d6db2c 100644 --- a/hsarback/test/de/hsadmin/remote/EMailAddressTest.java +++ b/hsarback/test/de/hsadmin/remote/EMailAddressTest.java @@ -44,7 +44,7 @@ public class EMailAddressTest { try { Object execute = client.execute(MODULE + ".search", params); Object[] result = (Object[]) execute; - assertEquals(242, result.length); + assertEquals(6, result.length); for (Object o : result) { if (o instanceof Map) { Map row = (Map) o; @@ -92,8 +92,8 @@ public class EMailAddressTest { Map setParams = new HashMap(); Map whereParams = new HashMap(); setParams.put("target", "aaa00-test2"); - whereParams.put("domain", "jalin.de"); - whereParams.put("localpart", "fax"); + whereParams.put("domain", "example01.org"); + whereParams.put("localpart", "webmaster"); Object[] params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), setParams, whereParams }; @@ -107,9 +107,9 @@ public class EMailAddressTest { assertEquals(count + 1, getTargetCount()); setParams = new HashMap(); whereParams = new HashMap(); - setParams.put("target", "aaa00-test2"); - whereParams.put("domain", "jalin.de"); - whereParams.put("localpart", "fax"); + setParams.put("target", "aaa00-admin"); + whereParams.put("domain", "example01.org"); + whereParams.put("localpart", "webmaster"); params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), setParams, whereParams }; diff --git a/hsarback/test/de/hsadmin/remote/EMailAliasTest.java b/hsarback/test/de/hsadmin/remote/EMailAliasTest.java index 6fb4d4a..94e2cc5 100644 --- a/hsarback/test/de/hsadmin/remote/EMailAliasTest.java +++ b/hsarback/test/de/hsadmin/remote/EMailAliasTest.java @@ -35,14 +35,27 @@ public class EMailAliasTest { public void testSearchAllAsPacAdmin() { String user = "aaa00"; String grantingTicketURL = cas.getGrantingTicketURL(user); - Map whereParams = new HashMap(); + Map setParams = new HashMap(); + setParams.put("name", "aaa00-alias"); + setParams.put("target", "aaa00-admin"); Object[] params = new Object[] { user, + cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), + setParams }; + try { + client.execute(MODULE + ".add", params); + } catch (XmlRpcException e) { + fail(e.getMessage()); + } + user = "aaa00"; + grantingTicketURL = cas.getGrantingTicketURL(user); + Map whereParams = new HashMap(); + params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), whereParams }; try { Object execute = client.execute(MODULE + ".search", params); Object[] result = (Object[]) execute; - assertEquals(3, result.length); + assertEquals(1, result.length); for (Object o : result) { if (o instanceof Map) { Map row = (Map) o;