public class KerberosErrorMessageTest extends TestCase {
public void test_Ctor() throws IOException {
KerberosErrorMessage message = KerberosErrorMessage
.decode(new DerInputStream(err_resp));
assertEquals("ctime", new Date(1000), message.getCtime());
assertEquals("cusec", 65536, message.getCusec());
assertEquals("stime", new Date(0), message.getStime());
assertEquals("susec", 65793, message.getSusec());
assertEquals("error-code", 6, message.getErrorCode());
assertEquals("crealm", "MY.REALM", message.getCrealm());
assertEquals("cname", new PrincipalName(PrincipalName.NT_PRINCIPAL,
new String[] { "no_such_user" }), message.getCname());
assertEquals("realm", "MY.REALM", message.getRealm());
assertEquals("sname", new PrincipalName(PrincipalName.NT_UNKNOWN,
new String[] { "krbtgt", "MY.REALM" }), message.getSname());
assertEquals("etext", "e_text_string", message.getEtext());
}