directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: DIRKRB-575 SaslAppTest failure due to input having nothing to do with test. Contributed by Gerard Gagliano.
Date Fri, 27 May 2016 01:34:25 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 19d72ebb8 -> ae26c10e5


DIRKRB-575 SaslAppTest failure due to input having nothing to do with test. Contributed by
Gerard Gagliano.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/ae26c10e
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/ae26c10e
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/ae26c10e

Branch: refs/heads/trunk
Commit: ae26c10e52a6a92b1233f31308f848dbf53b71da
Parents: 19d72eb
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri May 27 09:39:50 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri May 27 09:39:50 2016 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/server/KdcTestBase.java    | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ae26c10e/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
index 9e8424f..c4a87be 100644
--- a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
+++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
@@ -30,21 +30,32 @@ import org.junit.BeforeClass;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 public abstract class KdcTestBase {
     private static File testDir;
 
     private final String clientPassword = "123456";
-    private final String hostname = "localhost";
+    private String hostname;
     private final String clientPrincipalName = "drankye";
     private final String clientPrincipal =
             clientPrincipalName + "@" + TestKdcServer.KDC_REALM;
     private final String serverPrincipalName = "test-service";
-    private final String serverPrincipal =
-            serverPrincipalName + "/" + hostname + "@" + TestKdcServer.KDC_REALM;
+    private final String serverPrincipal;
 
     private SimpleKdcServer kdcServer;
 
+    public KdcTestBase() {
+        try {
+            hostname = InetAddress.getByName("127.0.0.1").getHostName();
+        } catch (UnknownHostException e) {
+            hostname = "localhost";
+        }
+        serverPrincipal =
+                serverPrincipalName + "/" + hostname + "@" + TestKdcServer.KDC_REALM;
+    }
+
     @BeforeClass
     public static void createTestDir() throws IOException {
         String basedir = System.getProperty("basedir");


Mime
View raw message