You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ha...@apache.org on 2015/05/14 11:12:11 UTC
directory-kerby git commit: DIRKRB-251 Allow to test udp or tcp
separatedly for NettyKdcNetwork. Contributed by Yaning
Repository: directory-kerby
Updated Branches:
refs/heads/master 1b59fe20a -> b9a3d08f1
DIRKRB-251 Allow to test udp or tcp separatedly for NettyKdcNetwork. Contributed by Yaning
Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/b9a3d08f
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/b9a3d08f
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/b9a3d08f
Branch: refs/heads/master
Commit: b9a3d08f19722e71cb76618f1e677d2b9e2d13c9
Parents: 1b59fe2
Author: Lin <li...@foxmail.com>
Authored: Thu May 14 17:11:07 2015 +0800
Committer: Lin <li...@foxmail.com>
Committed: Thu May 14 17:11:07 2015 +0800
----------------------------------------------------------------------
.../kdc/OnlyTcpForNettyKdcNetworkTest.java | 65 ++++++++++++++++++++
.../kdc/OnlyUdpForNettyKdcNetworkTest.java | 65 ++++++++++++++++++++
2 files changed, 130 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/b9a3d08f/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyTcpForNettyKdcNetworkTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyTcpForNettyKdcNetworkTest.java b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyTcpForNettyKdcNetworkTest.java
new file mode 100644
index 0000000..d49d032
--- /dev/null
+++ b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyTcpForNettyKdcNetworkTest.java
@@ -0,0 +1,65 @@
+/**
+ * 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.kdc;
+
+import org.apache.kerby.kerberos.kdc.identitybackend.JsonIdentityBackend;
+import org.apache.kerby.kerberos.kerb.server.BackendConfig;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.io.File;
+
+public class OnlyTcpForNettyKdcNetworkTest extends KerbyKdcTest {
+ private static File jsonBackendFile;
+
+ @AfterClass
+ public static void rmJsonBackendFile() {
+ if (jsonBackendFile.exists()) {
+ jsonBackendFile.delete();
+ }
+ }
+
+ @Override
+ protected boolean allowUdp() {
+ return false;
+ }
+
+ @Override
+ protected void prepareKdcServer() throws Exception {
+ super.prepareKdcServer();
+
+ File testDir = new File(System.getProperty("test.dir", "target"));
+ jsonBackendFile = new File(testDir, "json-backend-file");
+ String jsonBackendFileString = jsonBackendFile.getAbsolutePath();
+
+ BackendConfig backendConfig = new BackendConfig();
+ backendConfig.setString(
+ JsonIdentityBackend.JSON_IDENTITY_BACKEND_FILE, jsonBackendFileString);
+ kdcServer.setBackendConfig(backendConfig);
+
+ kdcServer.init();
+ }
+
+ @Test
+ public void testKdc() throws Exception {
+ performKdcTest();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/b9a3d08f/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyUdpForNettyKdcNetworkTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyUdpForNettyKdcNetworkTest.java b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyUdpForNettyKdcNetworkTest.java
new file mode 100644
index 0000000..61b6a82
--- /dev/null
+++ b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/OnlyUdpForNettyKdcNetworkTest.java
@@ -0,0 +1,65 @@
+/**
+ * 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.kdc;
+
+import org.apache.kerby.kerberos.kdc.identitybackend.JsonIdentityBackend;
+import org.apache.kerby.kerberos.kerb.server.BackendConfig;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.io.File;
+
+public class OnlyUdpForNettyKdcNetworkTest extends KerbyKdcTest {
+ private static File jsonBackendFile;
+
+ @AfterClass
+ public static void rmJsonBackendFile() {
+ if (jsonBackendFile.exists()) {
+ jsonBackendFile.delete();
+ }
+ }
+
+ @Override
+ protected boolean allowTcp() {
+ return false;
+ }
+
+ @Override
+ protected void prepareKdcServer() throws Exception {
+ super.prepareKdcServer();
+
+ File testDir = new File(System.getProperty("test.dir", "target"));
+ jsonBackendFile = new File(testDir, "json-backend-file");
+ String jsonBackendFileString = jsonBackendFile.getAbsolutePath();
+
+ BackendConfig backendConfig = new BackendConfig();
+ backendConfig.setString(
+ JsonIdentityBackend.JSON_IDENTITY_BACKEND_FILE, jsonBackendFileString);
+ kdcServer.setBackendConfig(backendConfig);
+
+ kdcServer.init();
+ }
+
+ @Test
+ public void testKdc() throws Exception {
+ performKdcTest();
+ }
+
+}