From 6135898d934497b42a40f54898ce8a07e5a28207 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 05 May 2011 20:12:04 +0200
Subject: [PATCH] Test Hostmaster ad

---
 hsarback/test/de/hsadmin/remote/CustomerTest.java |   18 ++++++++++--------
 hsarback/database/data.sql                        |    2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/hsarback/database/data.sql b/hsarback/database/data.sql
index 1560528..7b5938c 100644
--- a/hsarback/database/data.sql
+++ b/hsarback/database/data.sql
@@ -119,5 +119,5 @@
 	SELECT 'hsh01', 'packet hsh01', '/bin/bash', '/home/pacs/hsh01', FALSE, packet_id, 10002 FROM packet 
 		WHERE packet_name='hsh01'; 
 INSERT INTO unixuser (name, comment, shell, homedir, locked, packet_id, userid)
-	SELECT 'hsh01-pe', 'hostmaster pe', '/bin/bash', '/home/pacs/hsh01/users/pe', FALSE, packet_id, 10003 FROM packet 
+	SELECT 'hsh01-ad', 'hostmaster ad', '/bin/bash', '/home/pacs/hsh01/users/ad', FALSE, packet_id, 10003 FROM packet 
 		WHERE packet_name='hsh01'; 
diff --git a/hsarback/test/de/hsadmin/remote/CustomerTest.java b/hsarback/test/de/hsadmin/remote/CustomerTest.java
index 02269e2..caab638 100644
--- a/hsarback/test/de/hsadmin/remote/CustomerTest.java
+++ b/hsarback/test/de/hsadmin/remote/CustomerTest.java
@@ -34,7 +34,7 @@
 
 	@Test
 	public void testAddAsHostmaster() {
-		String user = "pe";
+		String user = "ad";
 		int membersCount = -9999;
 		try {
 			membersCount = getMembersCount(user);
@@ -63,10 +63,12 @@
 				setParams };
 		try {
 			client.execute(MODULE + ".add", params);
-//			Object execute = client.execute(MODULE + ".add", params);
-//			Map<?, ?> result = (Map<?, ?>) execute;
-//			System.out.println(result);
 			assertEquals(membersCount + 1, getMembersCount(user));
+			for (int idx=11; idx < 99; idx++) {
+				setParams.put("membercode", "hsh00-n" + idx);
+				setParams.put("memberno", "200" + idx);
+				client.execute(MODULE + ".add", params);
+			}
 		} catch (XmlRpcException e) {
 			fail(e.getMessage());
 		}
@@ -74,7 +76,7 @@
 
 	@Test
 	public void testSearchAsHostmaster() {
-		String user = "pe";
+		String user = "ad";
 		String grantingTicketURL = cas.getGrantingTicketURL(user);
 		Map<String, String> whereParams = new HashMap<String, String>();
 		Object[] params = new Object[] { user, 
@@ -83,7 +85,7 @@
 		try {
 			Object execute = client.execute(MODULE + ".search", params);
 			Object[] result = (Object[]) execute;
-			assertTrue(result.length > 100);
+			assertTrue(result.length > 98);
 		} catch (XmlRpcException e) {
 			fail(e.getMessage());
 		}
@@ -161,7 +163,7 @@
 
 	@Test
 	public void testUpdateAsHostmaster() {
-		String user = "pe";
+		String user = "ad";
 		String grantingTicketURL = cas.getGrantingTicketURL(user);
 		Map<String, String> whereParams = new HashMap<String, String>();
 		Map<String, String> setParams = new HashMap<String, String>();
@@ -197,7 +199,7 @@
 
 	@Test
 	public void testDeleteAsHostmaster() {
-		String user = "pe";
+		String user = "ad";
 		int membersCount = -9999;
 		try {
 			membersCount = getMembersCount(user);

--
Gitblit v1.9.3