Teste, ob eine und zwei gültige Domainoptionen angenommen werden.
This commit is contained in:
parent
0b9397fc68
commit
6a6f4bff94
@ -6,7 +6,9 @@ import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.xmlrpc.XmlRpcException;
|
||||
@ -120,13 +122,15 @@ public class DomainTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIvalidOption() {
|
||||
public void testInvalidOption() {
|
||||
String user = "aaa00";
|
||||
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
||||
Map<String, String> setParams = new HashMap<String, String>();
|
||||
Map<String, Object> setParams = new HashMap<String, Object>();
|
||||
Map<String, String> whereParams = new HashMap<String, String>();
|
||||
setParams.put("user", "aaa00");
|
||||
setParams.put("domainoptions", "invalide");
|
||||
List<String> optionslist = new ArrayList<String>();
|
||||
optionslist.add("invalide");
|
||||
setParams.put("domainoptions", optionslist);
|
||||
whereParams.put("name", "example01.org");
|
||||
Object[] params = new Object[] { user,
|
||||
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
|
||||
@ -139,6 +143,51 @@ public class DomainTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneValidOption() {
|
||||
String user = "aaa00";
|
||||
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
||||
Map<String, Object> setParams = new HashMap<String, Object>();
|
||||
Map<String, String> whereParams = new HashMap<String, String>();
|
||||
setParams.put("user", "aaa00");
|
||||
List<String> optionslist = new ArrayList<String>();
|
||||
optionslist.add("graylisting");
|
||||
setParams.put("domainoptions", optionslist);
|
||||
whereParams.put("name", "example01.org");
|
||||
Object[] params = new Object[] { user,
|
||||
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
|
||||
setParams, whereParams };
|
||||
try {
|
||||
Object execute = client.execute(MODULE + ".update", params);
|
||||
assertNotNull(execute);
|
||||
} catch (XmlRpcException e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoValidOptions() {
|
||||
String user = "aaa00";
|
||||
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
||||
Map<String, Object> setParams = new HashMap<String, Object>();
|
||||
Map<String, String> whereParams = new HashMap<String, String>();
|
||||
setParams.put("user", "aaa00");
|
||||
List<String> optionslist = new ArrayList<String>();
|
||||
optionslist.add("htdocsfallback");
|
||||
optionslist.add("graylisting");
|
||||
setParams.put("domainoptions", optionslist);
|
||||
whereParams.put("name", "example01.org");
|
||||
Object[] params = new Object[] { user,
|
||||
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
|
||||
setParams, whereParams };
|
||||
try {
|
||||
Object execute = client.execute(MODULE + ".update", params);
|
||||
assertNotNull(execute);
|
||||
} catch (XmlRpcException e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private int getDomsCount() {
|
||||
int count = 0;
|
||||
String user = "aaa00";
|
||||
|
Loading…
Reference in New Issue
Block a user