}
}
public void testFailedCtor() {
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read");
fail("incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "");
fail("actions is empty");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", null);
fail("actions is null");
} catch(NullPointerException e){
} catch(IllegalArgumentException e){}
try {
new ServicePermission(null, "accept");
fail("permission is null");
} catch(NullPointerException e){
}
try {
new ServicePermission("", "accept");
//TODO: fail("No expected IAE"); //
} catch(IllegalArgumentException e){}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "accept, read");
fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read");
fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, initiate ");
fail("Incorrect actions");
} catch(Exception e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, accept ");
fail("Incorrect actions");
}catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", ", accept ");
//TODO: fail("No expected IAE");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, read");
fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read, accept");
fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, accept");
//TODO: fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
try {
new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate accept");
fail("Incorrect actions");
} catch(IllegalArgumentException e){
}
}