Test Hostmaster ad

This commit is contained in:
Peter Hormanns 2011-05-05 18:42:58 +00:00
parent e5fc50f5ec
commit 733027b6bf
3 changed files with 21 additions and 18 deletions

View File

@ -64,10 +64,11 @@ public class CustomerTest {
try { try {
client.execute(MODULE + ".add", params); client.execute(MODULE + ".add", params);
assertEquals(membersCount + 1, getMembersCount(user)); assertEquals(membersCount + 1, getMembersCount(user));
for (int idx=11; idx < 99; idx++) { for (int idx=11; idx < 100; idx++) {
setParams.put("membercode", "hsh00-n" + idx); setParams.put("membercode", "hsh00-n" + idx);
setParams.put("memberno", "200" + idx); setParams.put("memberno", "200" + idx);
setParams.put("contact_street", "Hauptstr. " + idx); setParams.put("contact_street", "Hauptstr. " + idx);
params[1] = cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL());
client.execute(MODULE + ".add", params); client.execute(MODULE + ".add", params);
} }
} catch (XmlRpcException e) { } catch (XmlRpcException e) {
@ -86,7 +87,7 @@ public class CustomerTest {
try { try {
Object execute = client.execute(MODULE + ".search", params); Object execute = client.execute(MODULE + ".search", params);
Object[] result = (Object[]) execute; Object[] result = (Object[]) execute;
assertTrue(result.length > 98); assertTrue(result.length > 90);
} catch (XmlRpcException e) { } catch (XmlRpcException e) {
fail(e.getMessage()); fail(e.getMessage());
} }

View File

@ -35,12 +35,12 @@ public class InitDataTest {
@Test @Test
public void testAddMember() { public void testAddMember() {
String user = "pe"; String user = "ad";
int membersCount = -9999; int membersCount = -9999;
membersCount = getMembersCount(); membersCount = getMembersCount();
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> setParams = new HashMap<String, String>(); Map<String, String> setParams = new HashMap<String, String>();
setParams.put("membercode", "hsh90-aaa"); setParams.put("membercode", "hsh00-aaa");
setParams.put("password", "geheimnIs"); setParams.put("password", "geheimnIs");
setParams.put("memberno", "20001"); setParams.put("memberno", "20001");
setParams.put("membersince", "01.10.2010"); setParams.put("membersince", "01.10.2010");
@ -72,14 +72,14 @@ public class InitDataTest {
@Test @Test
public void testAddPac() { public void testAddPac() {
int count = getPacsCount(); int count = getPacsCount();
String user = "pe"; String user = "ad";
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> setParams = new HashMap<String, String>(); Map<String, String> setParams = new HashMap<String, String>();
setParams.put("name", "aaa00"); setParams.put("name", "aaa00");
setParams.put("hive", "h90"); setParams.put("hive", "h81");
setParams.put("customer", "hsh90-aaa"); setParams.put("customer", "hsh00-aaa");
setParams.put("basepac", "DW/B"); setParams.put("basepac", "DW/B");
setParams.put("curinetaddr", "83.223.95.132"); setParams.put("curinetaddr", "192.168.108.201");
Object[] params = new Object[] { user, Object[] params = new Object[] { user,
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
setParams }; setParams };
@ -95,7 +95,7 @@ public class InitDataTest {
@Test @Test
public void testDelPac() { public void testDelPac() {
int count = getPacsCount(); int count = getPacsCount();
String user = "pe"; String user = "ad";
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> whereParams = new HashMap<String, String>(); Map<String, String> whereParams = new HashMap<String, String>();
whereParams.put("name", "aaa00"); whereParams.put("name", "aaa00");
@ -113,10 +113,10 @@ public class InitDataTest {
@Test @Test
public void testDelMember() { public void testDelMember() {
int count = getMembersCount(); int count = getMembersCount();
String user = "pe"; String user = "ad";
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> whereParams = new HashMap<String, String>(); Map<String, String> whereParams = new HashMap<String, String>();
whereParams.put("membercode", "hsh90-aaa"); whereParams.put("membercode", "hsh00-aaa");
Object[] params = new Object[] { user, Object[] params = new Object[] { user,
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
whereParams }; whereParams };
@ -130,7 +130,7 @@ public class InitDataTest {
private int getMembersCount() { private int getMembersCount() {
int count = 0; int count = 0;
String user = "pe"; String user = "ad";
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> whereParams = new HashMap<String, String>(); Map<String, String> whereParams = new HashMap<String, String>();
Object[] params = new Object[] { user, Object[] params = new Object[] { user,
@ -149,10 +149,10 @@ public class InitDataTest {
private int getPacsCount() { private int getPacsCount() {
int count = 0; int count = 0;
String user = "pe"; String user = "ad";
String grantingTicketURL = cas.getGrantingTicketURL(user); String grantingTicketURL = cas.getGrantingTicketURL(user);
Map<String, String> whereParams = new HashMap<String, String>(); Map<String, String> whereParams = new HashMap<String, String>();
whereParams.put("customer", "hsh90-aaa"); whereParams.put("customer", "hsh00-aaa");
Object[] params = new Object[] { user, Object[] params = new Object[] { user,
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
whereParams }; whereParams };

View File

@ -5,11 +5,13 @@ import org.junit.runners.Suite;
@RunWith(Suite.class) @RunWith(Suite.class)
@Suite.SuiteClasses({ @Suite.SuiteClasses({
InitDataTest.class,
CustomerTest.class, CustomerTest.class,
UnixUserTest.class, UnixUserTest.class,
// MySqlDatabaseTest.class, MysqlDbTest.class,
// MySqlUserTest.class, MysqlUserTest.class,
// PgSqlUserTest.class, PgsqlDbTest.class,
PgsqlUserTest.class,
EMailAliasTest.class, EMailAliasTest.class,
EMailAddressTest.class, EMailAddressTest.class,
DomainTest.class, DomainTest.class,