directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject directory-kerby git commit: DIRKRB-184 Add configuration directory for test in KdcTest. Contributed by Jiajia
Date Fri, 20 Mar 2015 11:58:48 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 88e3ccb2e -> 508e3a479


DIRKRB-184 Add configuration directory for test in KdcTest. Contributed by Jiajia


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

Branch: refs/heads/master
Commit: 508e3a479344bc2a84f9c5158b80133f1968ce3e
Parents: 88e3ccb
Author: hazel <linchen7@foxmail.com>
Authored: Fri Mar 20 19:58:39 2015 +0800
Committer: hazel <linchen7@foxmail.com>
Committed: Fri Mar 20 19:58:39 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/kerberos/kerb/client/KrbClient.java  | 10 +++++++++-
 .../org/apache/kerby/kerberos/kerb/server/KdcTest.java    |  5 +++++
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/508e3a47/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
index 488a709..8789ec1 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
@@ -109,12 +109,20 @@ public class KrbClient {
         if (confDir != null && confDir.exists()) {
             File kdcConfFile = new File(confDir, "krb5.conf");
             if (kdcConfFile.exists()) {
-                //krbConfig.addIniConfig(kdcConfFile);
+                krbConfig.addIniConfig(kdcConfFile);
             }
         }
     }
 
     /**
+     * Set the conf dir
+     * @param file
+     */
+    public void setConfDir(File file) throws IOException {
+        confDir = file;
+    }
+
+    /**
      * Set KDC realm for ticket request
      * @param realm
      */

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/508e3a47/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
index c63eb20..3a3d22d 100644
--- a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
+++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
@@ -23,6 +23,8 @@ import org.apache.kerby.kerberos.kerb.spec.ticket.ServiceTicket;
 import org.apache.kerby.kerberos.kerb.spec.ticket.TgtTicket;
 import org.junit.Assert;
 
+import java.io.File;
+
 import static org.assertj.core.api.Assertions.assertThat;
 
 public abstract class KdcTest extends KdcTestBase {
@@ -39,6 +41,9 @@ public abstract class KdcTest extends KdcTestBase {
         kdcServer.start();
         assertThat(kdcServer.isStarted()).isTrue();
 
+        File testDir = new File(System.getProperty("test.dir", "target"));
+        File testConfDir = new File(testDir, "conf");
+        krbClnt.setConfDir(testConfDir);
         krbClnt.init();
 
         TgtTicket tgt;


Mime
View raw message