email-tests

This commit is contained in:
Peter Hormanns 2012-01-02 14:27:42 +00:00
parent 2296aff2ee
commit fe6d407523
2 changed files with 21 additions and 8 deletions

View File

@ -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<String, String> setParams = new HashMap<String, String>();
Map<String, String> whereParams = new HashMap<String, String>();
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<String, String>();
whereParams = new HashMap<String, String>();
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 };

View File

@ -35,14 +35,27 @@ public class EMailAliasTest {
public void testSearchAllAsPacAdmin() {
String user = "aaa00";
String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> whereParams = new HashMap<String, String>();
Map<String, String> setParams = new HashMap<String, String>();
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<String, String> whereParams = new HashMap<String, String>();
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;