From f2d2ca204597e1c2cd518c37b701a7a0ca9b28fb Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Wed, 19 Jun 2013 16:32:57 +0200
Subject: [PATCH] test case error #130

---
 hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java |    3 +++
 hsarback/test/de/hsadmin/remote/DomainTest.java        |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
index 84449a9..9c3e570 100644
--- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
+++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
@@ -138,6 +138,9 @@
 					}
 				}
 			}
+			
+			// TODO war es ein break, dann weitermachen, sonst Exception !
+			
 		}
 		Query adminQuery = em.createQuery("SELECT u FROM UnixUsers u WHERE u.name = :adminName");
 		adminQuery.setParameter("adminName", admin.getName());
diff --git a/hsarback/test/de/hsadmin/remote/DomainTest.java b/hsarback/test/de/hsadmin/remote/DomainTest.java
index 5690458..87dd3ec 100644
--- a/hsarback/test/de/hsadmin/remote/DomainTest.java
+++ b/hsarback/test/de/hsadmin/remote/DomainTest.java
@@ -116,6 +116,26 @@
 	}
 
 	@Test
+	public void testCreateForeignSubdomain() throws UnknownHostException, IOException {
+		int count = getDomsCount();
+		String user = "aaa01";
+		String grantingTicketURL = cas.getGrantingTicketURL(user);
+		Map<String, String> setParams = new HashMap<String, String>();
+		setParams.put("name", "subdomain.f6n.de");
+		setParams.put("user", "aaa01");
+		Object[] params = new Object[] { user, 
+				cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), 
+				setParams };
+		try {
+			Object execute = client.execute(MODULE + ".add", params);
+			assertTrue(execute instanceof Map<?, ?>);
+			fail("should throw exception");
+		} catch (XmlRpcException e) {
+			assertEquals(count, getDomsCount());
+		}
+	}
+
+	@Test
 	public void testDelete() {
 		int count = getDomsCount();
 		String user = "aaa00";

--
Gitblit v1.9.1