directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1043095 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src: main/java/org/apache/directory/server/kerberos/kdc/ test/java/org/apache/directory/server/kerberos/protocol/
Date Tue, 07 Dec 2010 15:33:14 GMT
Author: elecharny
Date: Tue Dec  7 15:33:14 2010
New Revision: 1043095

URL: http://svn.apache.org/viewvc?rev=1043095&view=rev
Log:
Fixed some failing tests : the error code was checked using the ordinal value

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationPolicyTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationServiceTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/EncTktInSkeyTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/TicketGrantingPolicyTest.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=1043095&r1=1043094&r2=1043095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
Tue Dec  7 15:33:14 2010
@@ -29,10 +29,10 @@ import javax.security.auth.kerberos.Kerb
 import net.sf.ehcache.Cache;
 
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.kerberos.protocol.KerberosProtocolHandler;
 import org.apache.directory.server.kerberos.protocol.KerberosProtocolCodecFactory;
-import org.apache.directory.server.kerberos.shared.replay.ReplayCacheImpl;
+import org.apache.directory.server.kerberos.protocol.KerberosProtocolHandler;
 import org.apache.directory.server.kerberos.shared.replay.ReplayCache;
+import org.apache.directory.server.kerberos.shared.replay.ReplayCacheImpl;
 import org.apache.directory.server.kerberos.shared.store.DirectoryPrincipalStore;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.protocol.shared.DirectoryBackedService;

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationPolicyTest.java?rev=1043095&r1=1043094&r2=1043095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationPolicyTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationPolicyTest.java
Tue Dec  7 15:33:14 2010
@@ -28,6 +28,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.codec.options.KdcOptions;
 import org.apache.directory.shared.kerberos.components.KdcReq;
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
+import org.apache.directory.shared.kerberos.exceptions.ErrorType;
 import org.apache.directory.shared.kerberos.messages.AsReq;
 import org.apache.directory.shared.kerberos.messages.KrbError;
 import org.junit.After;
@@ -106,7 +107,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -145,7 +146,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -184,7 +185,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -223,7 +224,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -262,7 +263,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -304,7 +305,7 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -345,6 +346,6 @@ public class AuthenticationPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationServiceTest.java?rev=1043095&r1=1043094&r2=1043095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationServiceTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationServiceTest.java
Tue Dec  7 15:33:14 2010
@@ -39,6 +39,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.KdcReq;
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
 import org.apache.directory.shared.kerberos.components.PaData;
+import org.apache.directory.shared.kerberos.exceptions.ErrorType;
 import org.apache.directory.shared.kerberos.messages.AsRep;
 import org.apache.directory.shared.kerberos.messages.AsReq;
 import org.apache.directory.shared.kerberos.messages.KrbError;
@@ -110,7 +111,7 @@ public class AuthenticationServiceTest e
 
         KrbError error = ( KrbError ) session.getMessage();
 
-        assertEquals( "Additional pre-authentication required", 25, error.getErrorCode()
);
+        assertEquals( "Additional pre-authentication required", ErrorType.KDC_ERR_PREAUTH_REQUIRED,
error.getErrorCode() );
     }
 
 
@@ -135,7 +136,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Requested protocol version number not supported", 3, error.getErrorCode()
);
+        assertEquals( "Requested protocol version number not supported", ErrorType.KDC_ERR_BAD_PVNO,
error.getErrorCode() );
     }
 
 
@@ -190,7 +191,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Client not found in Kerberos database", 6, error.getErrorCode() );
+        assertEquals( "Client not found in Kerberos database", ErrorType.KDC_ERR_C_PRINCIPAL_UNKNOWN,
error.getErrorCode() );
     }
 
 
@@ -241,7 +242,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC has no support for encryption type", 14, error.getErrorCode()
);
+        assertEquals( "KDC has no support for encryption type", ErrorType.KDC_ERR_ETYPE_NOSUPP,
error.getErrorCode() );
     }
 
 
@@ -277,7 +278,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Server not found in Kerberos database", 7, error.getErrorCode() );
+        assertEquals( "Server not found in Kerberos database", ErrorType.KDC_ERR_S_PRINCIPAL_UNKNOWN,
error.getErrorCode() );
     }
 
 
@@ -302,7 +303,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "The client or server has a null key", 9, error.getErrorCode() );
+        assertEquals( "The client or server has a null key", ErrorType.KDC_ERR_NULL_KEY,
error.getErrorCode() );
     }
 
 
@@ -339,7 +340,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "The client or server has a null key", 9, error.getErrorCode() );
+        assertEquals( "The client or server has a null key", ErrorType.KDC_ERR_NULL_KEY,
error.getErrorCode() );
     }
 
 
@@ -559,7 +560,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Requested start time is later than end time", 11, error.getErrorCode()
);
+        assertEquals( "Requested start time is later than end time", ErrorType.KDC_ERR_NEVER_VALID,
error.getErrorCode() );
     }
 
 
@@ -610,7 +611,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Requested start time is later than end time", 11, error.getErrorCode()
);
+        assertEquals( "Requested start time is later than end time", ErrorType.KDC_ERR_NEVER_VALID,
error.getErrorCode() );
     }
 
 
@@ -660,7 +661,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "Ticket not eligible for postdating", 10, error.getErrorCode() );
+        assertEquals( "Ticket not eligible for postdating", ErrorType.KDC_ERR_CANNOT_POSTDATE,
error.getErrorCode() );
     }
 
 
@@ -1328,7 +1329,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 
 
@@ -1373,7 +1374,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 
 
@@ -1418,7 +1419,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 
 
@@ -1463,7 +1464,7 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 
 
@@ -1508,6 +1509,6 @@ public class AuthenticationServiceTest e
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/EncTktInSkeyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/EncTktInSkeyTest.java?rev=1043095&r1=1043094&r2=1043095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/EncTktInSkeyTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/EncTktInSkeyTest.java
Tue Dec  7 15:33:14 2010
@@ -34,6 +34,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
 import org.apache.directory.shared.kerberos.components.KdcReq;
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
+import org.apache.directory.shared.kerberos.exceptions.ErrorType;
 import org.apache.directory.shared.kerberos.messages.KrbError;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.junit.After;
@@ -145,6 +146,6 @@ public class EncTktInSkeyTest extends Ab
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC cannot accommodate requested option", 13, error.getErrorCode()
);
+        assertEquals( "KDC cannot accommodate requested option", ErrorType.KDC_ERR_BADOPTION,
error.getErrorCode() );
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/TicketGrantingPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/TicketGrantingPolicyTest.java?rev=1043095&r1=1043094&r2=1043095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/TicketGrantingPolicyTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/TicketGrantingPolicyTest.java
Tue Dec  7 15:33:14 2010
@@ -39,6 +39,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.HostAddresses;
 import org.apache.directory.shared.kerberos.components.KdcReq;
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
+import org.apache.directory.shared.kerberos.exceptions.ErrorType;
 import org.apache.directory.shared.kerberos.flags.TicketFlag;
 import org.apache.directory.shared.kerberos.messages.KrbError;
 import org.apache.directory.shared.kerberos.messages.Ticket;
@@ -138,7 +139,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -189,7 +190,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -245,7 +246,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -296,7 +297,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -352,7 +353,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -408,7 +409,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -459,7 +460,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -510,7 +511,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -561,7 +562,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -605,7 +606,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -656,7 +657,7 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 
 
@@ -710,6 +711,6 @@ public class TicketGrantingPolicyTest ex
         Object msg = session.getMessage();
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
-        assertEquals( "KDC policy rejects request", 12, error.getErrorCode() );
+        assertEquals( "KDC policy rejects request", ErrorType.KDC_ERR_POLICY, error.getErrorCode()
);
     }
 }



Mime
View raw message