.hasMoreElements());
myServerFactory01 mm01 = new myServerFactory01();
String[] mech01 = mm01.getMechanismNames(null);
int l = 0;
while (en.hasMoreElements()) {
SaslServerFactory f = en.nextElement();
if (f instanceof myServerFactory02) {
l++;
try {
f.createSaslServer(null, null, null, null, null);
fail("SaslException should be thrown");
} catch (SaslException e) {
}
assertNull("Incorect SaslClient", f.createSaslServer(null, "a",
null, null, null));
assertNull("Wrong length", f.getMechanismNames(null));
} else if (f instanceof myServerFactory01) {
l++;
assertNull("Not null SaslServer", f.createSaslServer(null,
null, null, null, null));
String[] mech00 = f.getMechanismNames(null);
assertEquals("Wrong length", mech00.length, mech01.length);
for (int i = 0; i < mech00.length; i++) {
assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
}
}