Die drei Tests für DomainOptionen haben weniger Fehler und prüfen die Anzahl der gesetzten Optionen.
This commit is contained in:
parent
6a6f4bff94
commit
9453174b83
@ -17,6 +17,8 @@ import org.junit.After;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import de.hsadmin.mods.dom.Domain;
|
||||||
|
|
||||||
public class DomainTest {
|
public class DomainTest {
|
||||||
|
|
||||||
private static final String MODULE = "domain";
|
private static final String MODULE = "domain";
|
||||||
@ -140,6 +142,7 @@ public class DomainTest {
|
|||||||
assertNotNull(execute);
|
assertNotNull(execute);
|
||||||
fail("exception expected");
|
fail("exception expected");
|
||||||
} catch (XmlRpcException e) {
|
} catch (XmlRpcException e) {
|
||||||
|
assertEquals(getDomOptionsCount(),0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +163,7 @@ public class DomainTest {
|
|||||||
try {
|
try {
|
||||||
Object execute = client.execute(MODULE + ".update", params);
|
Object execute = client.execute(MODULE + ".update", params);
|
||||||
assertNotNull(execute);
|
assertNotNull(execute);
|
||||||
|
assertEquals(getDomOptionsCount(),1);
|
||||||
} catch (XmlRpcException e) {
|
} catch (XmlRpcException e) {
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
@ -183,6 +187,7 @@ public class DomainTest {
|
|||||||
try {
|
try {
|
||||||
Object execute = client.execute(MODULE + ".update", params);
|
Object execute = client.execute(MODULE + ".update", params);
|
||||||
assertNotNull(execute);
|
assertNotNull(execute);
|
||||||
|
assertEquals(getDomOptionsCount(),2);
|
||||||
} catch (XmlRpcException e) {
|
} catch (XmlRpcException e) {
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
@ -206,4 +211,23 @@ public class DomainTest {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getDomOptionsCount() {
|
||||||
|
int count = 0;
|
||||||
|
String user = "aaa00";
|
||||||
|
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
||||||
|
Map<String, String> whereParams = new HashMap<String, String>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user