You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2015/04/21 00:52:44 UTC
directory-kerby git commit: Added kdc setting test and KrbClient
setting test, inspired by Colm
Repository: directory-kerby
Updated Branches:
refs/heads/master 0e9ed9adf -> 46bfd66c1
Added kdc setting test and KrbClient setting test, inspired by Colm
Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/46bfd66c
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/46bfd66c
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/46bfd66c
Branch: refs/heads/master
Commit: 46bfd66c1eff6dab934f1f06d12cad1adb3972b2
Parents: 0e9ed9a
Author: Drankye <dr...@gmail.com>
Authored: Tue Apr 21 06:52:30 2015 +0800
Committer: Drankye <dr...@gmail.com>
Committed: Tue Apr 21 06:52:30 2015 +0800
----------------------------------------------------------------------
.../kerb/client/KrbClientSettingTest.java | 44 ++++++++++++++++++++
.../kerberos/kerb/server/KdcSettingTest.java | 43 +++++++++++++++++++
2 files changed, 87 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/46bfd66c/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/KrbClientSettingTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/KrbClientSettingTest.java b/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/KrbClientSettingTest.java
new file mode 100644
index 0000000..9377d30
--- /dev/null
+++ b/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/KrbClientSettingTest.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.kerby.kerberos.kerb.client;
+
+import org.apache.kerby.kerberos.kerb.KrbException;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class KrbClientSettingTest {
+
+ @Test
+ public void testKdcServerMannualSetting() throws KrbException {
+ KrbClient krbClient = new KrbClient();
+ krbClient.setKdcHost("localhost");
+ krbClient.setKdcRealm("TEST2.COM");
+ krbClient.setKdcTcpPort(12345);
+
+ krbClient.init();
+
+ KrbSetting krbSetting = krbClient.getSetting();
+ assertThat(krbSetting.getKdcHost()).isEqualTo("localhost");
+ assertThat(krbSetting.getKdcTcpPort()).isEqualTo(12345);
+ assertThat(krbSetting.getKdcRealm()).isEqualTo("TEST2.COM");
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/46bfd66c/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSettingTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSettingTest.java b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSettingTest.java
new file mode 100644
index 0000000..e94e382
--- /dev/null
+++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSettingTest.java
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.kerby.kerberos.kerb.server;
+
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class KdcSettingTest {
+
+ @Test
+ public void testKdcServerMannualSetting() {
+ KdcServer kerbServer = new KdcServer();
+ kerbServer.setKdcHost("localhost");
+ kerbServer.setKdcRealm("TEST2.COM");
+ kerbServer.setKdcTcpPort(12345);
+
+ kerbServer.init();
+
+ KdcSetting kdcSetting = kerbServer.getSetting();
+ assertThat(kdcSetting.getKdcHost()).isEqualTo("localhost");
+ assertThat(kdcSetting.getKdcTcpPort()).isEqualTo(12345);
+ assertThat(kdcSetting.getKdcRealm()).isEqualTo("TEST2.COM");
+ }
+
+}
\ No newline at end of file