From 9453174b835acdd45cc603f040f59219d4bd57f3 Mon Sep 17 00:00:00 2001 From: Purodha Blissenbach Date: Wed, 18 Jul 2012 12:11:08 +0000 Subject: [PATCH] =?UTF-8?q?Die=20drei=20Tests=20f=C3=BCr=20DomainOptionen?= =?UTF-8?q?=20haben=20weniger=20Fehler=20und=20pr=C3=BCfen=20die=20Anzahl?= =?UTF-8?q?=20der=20gesetzten=20Optionen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/de/hsadmin/remote/DomainTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hsarback/test/de/hsadmin/remote/DomainTest.java b/hsarback/test/de/hsadmin/remote/DomainTest.java index 3a55bab..b871d1c 100644 --- a/hsarback/test/de/hsadmin/remote/DomainTest.java +++ b/hsarback/test/de/hsadmin/remote/DomainTest.java @@ -17,6 +17,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import de.hsadmin.mods.dom.Domain; + public class DomainTest { private static final String MODULE = "domain"; @@ -140,6 +142,7 @@ public class DomainTest { assertNotNull(execute); fail("exception expected"); } catch (XmlRpcException e) { + assertEquals(getDomOptionsCount(),0); } } @@ -160,6 +163,7 @@ public class DomainTest { try { Object execute = client.execute(MODULE + ".update", params); assertNotNull(execute); + assertEquals(getDomOptionsCount(),1); } catch (XmlRpcException e) { fail(e.getMessage()); } @@ -183,6 +187,7 @@ public class DomainTest { try { Object execute = client.execute(MODULE + ".update", params); assertNotNull(execute); + assertEquals(getDomOptionsCount(),2); } catch (XmlRpcException e) { fail(e.getMessage()); } @@ -206,4 +211,23 @@ public class DomainTest { return count; } + private int getDomOptionsCount() { + int count = 0; + String user = "aaa00"; + String grantingTicketURL = cas.getGrantingTicketURL(user); + Map whereParams = new HashMap(); + whereParams.put("name", "example01.org"); + Object[] params = new Object[] { user, + cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), + whereParams }; + try { + Object execute = client.execute(MODULE + ".search", params); + Object[] result = (Object[]) execute; + count = ( (Domain) result[0] ).getDomainOptions().size(); + } catch (XmlRpcException e) { + fail(e.getMessage()); + } + return count; + } + }