if (!gid.equals(recovered)) {
throw new TestException(
"Failed -- Group ID improperly stored.");
}
ActivationGroupDesc adesc = null;
try {
adesc =
ActivationGroup.getSystem().getActivationGroupDesc(gid);
ActivationGroupDesc.CommandEnvironment ce =
adesc.getCommandEnvironment();
String[] opts = ce.getCommandOptions();
List lopts = Arrays.asList(opts);
System.out.println("Options: " + lopts);
if (!lopts.contains("-cp") ||
!lopts.contains(sharedGroupDesc.getClasspath())) {
throw new TestException(
"Failed -- bad opts.");
}
String[] userOpts = sharedGroupDesc.getServerOptions();
for (int i=0; i < userOpts.length; i++) {
if (!lopts.contains(userOpts[i])) {
throw new TestException(
"Failed -- bad user opts.");
}
}
Properties props = adesc.getPropertyOverrides();
System.out.println("Properties: " + props);
String pol = props.getProperty("java.security.policy");
if (pol == null || !pol.equals(sharedGroupDesc.getPolicy())) {
throw new TestException(
"Failed -- bad props.");
}
Properties userProps = sharedGroupDesc.getServerProperties();
System.out.println("User Properties: " + userProps);
if (userProps != null) {
Enumeration e = userProps.keys();
Object key = null;
Object val = null;
while (e.hasMoreElements()) {
key = e.nextElement();
val = userProps.get(key);
if (!props.containsKey(key) ||
!props.contains(val)) {
throw new TestException(
"Failed -- bad user props.");
}
}
}
String path = ce.getCommandPath();
System.out.println("getCommandPath: " + path);
if (path != null &&
!path.equals(sharedGroupDesc.getServerCommand())) {
throw new TestException(
"Failed -- bad path.");
}
String cp = adesc.getLocation();
System.out.println("getLocation: " + cp);
if (cp != null) {
throw new TestException(
"Failed -- bad location.");
}