/**
* testing of a incorrect ctor
*/
public void testFailCtor() {
try {
new DelegationPermission(null);
fail("no expected NPE");
} catch(NullPointerException e){
}
try {
new DelegationPermission("");
fail("no expected IAE");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com");
fail("Target name must be enveloped by quotes");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com\"");
fail("Target name must be enveloped by quotes");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"aaa.bbb.com\" \"ccc.ddd.com");
fail("Target name must be enveloped by quotes");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\" \" \" \"");
//TODO: fail("Target name is empty");
}catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"\"");
fail("Target name is incorrect");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"aaa.bbb.com\" \"\"");
fail("service principal is empty");
} catch(IllegalArgumentException e){
}
try {
new DelegationPermission("\"\" \"aaa.bbb.com\"");
fail("subordinate service principal is empty");
} catch(IllegalArgumentException e){
}
}