directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [1/2] directory-kerby git commit: DIRKRB-204 kerb-kdc-test fail
Date Tue, 31 Mar 2015 13:22:53 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 9ec7b32cf -> a6b978709


DIRKRB-204 kerb-kdc-test fail


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

Branch: refs/heads/master
Commit: 24773bf427816c570a00de8de806b10b71798143
Parents: a93a49a
Author: Drankye <drankye@gmail.com>
Authored: Tue Mar 31 21:22:15 2015 +0800
Committer: Drankye <drankye@gmail.com>
Committed: Tue Mar 31 21:22:15 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kdc/JsonBackendKdcTest.java  |  2 +-
 .../org/apache/kerby/kerberos/kdc/KdcTest.java  | 86 -------------------
 .../apache/kerby/kerberos/kdc/KerbyKdcTest.java | 86 +++++++++++++++++++
 .../kerby/kerberos/kdc/server/KdcTest.java      | 71 ---------------
 .../client/impl/blocking/KrbTcpTransport.java   | 45 ++++------
 .../kerberos/kerb/server/KdcSimpleTest.java     | 90 ++++++++++++++++++++
 .../kerby/kerberos/kerb/server/KdcTest.java     | 90 --------------------
 7 files changed, 195 insertions(+), 275 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/JsonBackendKdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/JsonBackendKdcTest.java
b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/JsonBackendKdcTest.java
index e269b3e..35b9a11 100644
--- a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/JsonBackendKdcTest.java
+++ b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/JsonBackendKdcTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 import java.io.File;
 
-public class JsonBackendKdcTest extends KdcTest {
+public class JsonBackendKdcTest extends KerbyKdcTest {
     private static File jsonBackendFile;
 
     @Override

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KdcTest.java b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KdcTest.java
deleted file mode 100644
index 559b785..0000000
--- a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KdcTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- *  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.kerb.server.KdcTestBase;
-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 {
-
-    private String password = "123456";
-
-    @Override
-    protected void createPrincipals() {
-        super.createPrincipals();
-        kdcServer.createPrincipal(clientPrincipal, password);
-    }
-
-    protected void performKdcTest() throws Exception {
-        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;
-        ServiceTicket tkt;
-
-        // With good password
-        try {
-            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, password);
-            assertThat(tgt).isNotNull();
-
-            tkt = krbClnt.requestServiceTicketWithTgt(tgt, serverPrincipal);
-            assertThat(tkt).isNotNull();
-        } catch (Exception e) {
-            System.out.println("Exception occurred with good password");
-            e.printStackTrace();
-            Assert.fail();
-        }
-
-        // With bad password
-        try {
-            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, "badpassword");
-        } catch (Exception e) {
-            System.out.println("Exception occurred with bad password");
-        }
-
-        // With good password again
-        try {
-            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, password);
-            assertThat(tgt).isNotNull();
-
-            tkt = krbClnt.requestServiceTicketWithTgt(tgt, serverPrincipal);
-            assertThat(tkt).isNotNull();
-        } catch (Exception e) {
-            System.out.println("Exception occurred with good password again");
-            e.printStackTrace();
-            Assert.fail();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KerbyKdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KerbyKdcTest.java
b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KerbyKdcTest.java
new file mode 100644
index 0000000..f49046c
--- /dev/null
+++ b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/KerbyKdcTest.java
@@ -0,0 +1,86 @@
+/**
+ *  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.kerb.server.KdcTestBase;
+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 KerbyKdcTest extends KdcTestBase {
+
+    private String password = "123456";
+
+    @Override
+    protected void createPrincipals() {
+        super.createPrincipals();
+        kdcServer.createPrincipal(clientPrincipal, password);
+    }
+
+    protected void performKdcTest() throws Exception {
+        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;
+        ServiceTicket tkt;
+
+        // With good password
+        try {
+            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, password);
+            assertThat(tgt).isNotNull();
+
+            tkt = krbClnt.requestServiceTicketWithTgt(tgt, serverPrincipal);
+            assertThat(tkt).isNotNull();
+        } catch (Exception e) {
+            System.out.println("Exception occurred with good password");
+            e.printStackTrace();
+            Assert.fail();
+        }
+
+        // With bad password
+        try {
+            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, "badpassword");
+        } catch (Exception e) {
+            System.out.println("Exception occurred with bad password");
+        }
+
+        // With good password again
+        try {
+            tgt = krbClnt.requestTgtWithPassword(clientPrincipal, password);
+            assertThat(tgt).isNotNull();
+
+            tkt = krbClnt.requestServiceTicketWithTgt(tgt, serverPrincipal);
+            assertThat(tkt).isNotNull();
+        } catch (Exception e) {
+            System.out.println("Exception occurred with good password again");
+            e.printStackTrace();
+            Assert.fail();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kdc/src/test/java/org/apache/kerby/kerberos/kdc/server/KdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kdc/src/test/java/org/apache/kerby/kerberos/kdc/server/KdcTest.java b/kerby-kdc/src/test/java/org/apache/kerby/kerberos/kdc/server/KdcTest.java
deleted file mode 100644
index fadc570..0000000
--- a/kerby-kdc/src/test/java/org/apache/kerby/kerberos/kdc/server/KdcTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- *  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.server;
-
-import org.apache.kerby.kerberos.kdc.KerbyKdcServer;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-
-public class KdcTest {
-
-    private String serverHost = "localhost";
-    private short serverPort = 8088;
-
-    private KerbyKdcServer kdcServer;
-
-    @Before
-    public void setUp() throws Exception {
-        kdcServer = new KerbyKdcServer();
-        kdcServer.setKdcHost(serverHost);
-        kdcServer.setKdcTcpPort(serverPort);
-        kdcServer.init();
-        kdcServer.start();
-    }
-
-    @Test
-    public void testKdc() throws IOException, InterruptedException {
-        Thread.sleep(10);
-
-        SocketChannel socketChannel = SocketChannel.open();
-        socketChannel.configureBlocking(true);
-        SocketAddress sa = new InetSocketAddress(serverHost, serverPort);
-        socketChannel.connect(sa);
-
-        String BAD_KRB_MESSAGE = "Hello World!";
-        ByteBuffer writeBuffer = ByteBuffer.allocate(4 + BAD_KRB_MESSAGE.getBytes().length);
-        writeBuffer.putInt(BAD_KRB_MESSAGE.getBytes().length);
-        writeBuffer.put(BAD_KRB_MESSAGE.getBytes());
-        writeBuffer.flip();
-
-        socketChannel.write(writeBuffer);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        kdcServer.stop();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/impl/blocking/KrbTcpTransport.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/impl/blocking/KrbTcpTransport.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/impl/blocking/KrbTcpTransport.java
index 4fb76ad..04b9086 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/impl/blocking/KrbTcpTransport.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/impl/blocking/KrbTcpTransport.java
@@ -22,9 +22,12 @@ package org.apache.kerby.kerberos.kerb.client.impl.blocking;
 import org.apache.kerby.kerberos.kerb.transport.AbstractKrbTransport;
 import org.apache.kerby.kerberos.kerb.transport.KrbTransport;
 
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.net.Socket;
 import java.nio.ByteBuffer;
 import java.nio.channels.Channels;
 import java.nio.channels.ReadableByteChannel;
@@ -35,52 +38,40 @@ import java.nio.channels.SocketChannel;
  */
 public class KrbTcpTransport
         extends AbstractKrbTransport implements KrbTransport {
-    private SocketChannel socketChannel;
-    private ReadableByteChannel wrappedChannel; // for timeout stuff.
+    private Socket socketChannel;
+    private DataOutputStream outputStream;
+    private DataInputStream inputStream;
     private InetSocketAddress remoteAddress;
-    private ByteBuffer headerBuffer; // for message length
-    private ByteBuffer messageBuffer; // for message body
+    private byte[] headerBuffer; // for message length
+    private byte[] messageBuffer; // for message body
 
     public KrbTcpTransport(InetSocketAddress remoteAddress) throws IOException {
         this.remoteAddress = remoteAddress;
-        this.headerBuffer = ByteBuffer.allocate(4);
-        this.messageBuffer = ByteBuffer.allocate(1024 * 1024); // TODO.
+        this.headerBuffer = new byte[4];
+        this.messageBuffer = new byte[1024 * 1024]; // TODO.
         doConnect();
     }
 
     private void doConnect() throws IOException {
-        socketChannel = SocketChannel.open();
-        socketChannel.configureBlocking(true);
-        socketChannel.socket().setSoTimeout(100); // TODO.
+        socketChannel = new Socket();
+        socketChannel.setSoTimeout(1000);
         socketChannel.connect(remoteAddress);
-
-        InputStream inStream = socketChannel.socket().getInputStream();
-        wrappedChannel = Channels.newChannel(inStream);
+        outputStream = new DataOutputStream(socketChannel.getOutputStream());
+        inputStream = new DataInputStream(socketChannel.getInputStream());
     }
 
     @Override
     public void sendMessage(ByteBuffer message) throws IOException {
-        socketChannel.write(message);
+        outputStream.write(message.array());
     }
 
     @Override
     public ByteBuffer receiveMessage() {
         try {
-            headerBuffer.clear();
-            headerBuffer.position(0);
-            headerBuffer.limit(4);
-            wrappedChannel.read(headerBuffer);
-            headerBuffer.flip();
-
-            int msgLen = headerBuffer.getInt();
+            int msgLen = inputStream.readInt();
             if (msgLen > 0) {
-                messageBuffer.clear();
-                messageBuffer.position(0);
-                messageBuffer.limit(msgLen);
-                wrappedChannel.read(messageBuffer);
-                messageBuffer.flip();
-
-                return messageBuffer;
+                inputStream.readFully(messageBuffer, 0, msgLen);
+                return ByteBuffer.wrap(messageBuffer, 0, msgLen);
             }
         } catch (IOException e) {
             return null;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSimpleTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSimpleTest.java
b/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSimpleTest.java
new file mode 100644
index 0000000..a20775f
--- /dev/null
+++ b/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcSimpleTest.java
@@ -0,0 +1,90 @@
+/**
+ *  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.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.SocketChannel;
+
+public class KdcSimpleTest {
+
+    private String serverHost = "localhost";
+    private int serverPort = 0;
+
+    private SimpleKdcServer kdcServer;
+
+    @Before
+    public void setUp() throws Exception {
+        kdcServer = new SimpleKdcServer();
+        kdcServer.setKdcHost(serverHost);
+        serverPort = getServerPort();
+        kdcServer.setKdcTcpPort(serverPort);
+        kdcServer.init();
+        kdcServer.start();
+    }
+
+    @Test
+    public void testKdc() throws IOException, InterruptedException {
+        Thread.sleep(15);
+
+        SocketChannel socketChannel = SocketChannel.open();
+        socketChannel.configureBlocking(true);
+        SocketAddress sa = new InetSocketAddress(serverHost, serverPort);
+        socketChannel.connect(sa);
+
+        String BAD_KRB_MESSAGE = "Hello World!";
+        ByteBuffer writeBuffer = ByteBuffer.allocate(4 + BAD_KRB_MESSAGE.getBytes().length);
+        writeBuffer.putInt(BAD_KRB_MESSAGE.getBytes().length);
+        writeBuffer.put(BAD_KRB_MESSAGE.getBytes());
+        writeBuffer.flip();
+
+        socketChannel.write(writeBuffer);
+    }
+    
+    /**
+     * Get a server socket point for testing usage, either TCP or UDP.
+     * @return server socket point
+     */
+    private static int getServerPort() {
+        int serverPort = 0;
+
+        try {
+            ServerSocket serverSocket = new ServerSocket(0);
+            serverPort = serverSocket.getLocalPort();
+            serverSocket.close();
+        } catch (IOException e) {
+            throw new RuntimeException("Failed to get a server socket point");
+        }
+
+        return serverPort;
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        kdcServer.stop();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/24773bf4/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
b/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
deleted file mode 100644
index 9b276b4..0000000
--- a/kerby-kerb/kerb-server/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- *  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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-
-public class KdcTest {
-
-    private String serverHost = "localhost";
-    private int serverPort = 0;
-
-    private SimpleKdcServer kdcServer;
-
-    @Before
-    public void setUp() throws Exception {
-        kdcServer = new SimpleKdcServer();
-        kdcServer.setKdcHost(serverHost);
-        serverPort = getServerPort();
-        kdcServer.setKdcTcpPort(serverPort);
-        kdcServer.init();
-        kdcServer.start();
-    }
-
-    @Test
-    public void testKdc() throws IOException, InterruptedException {
-        Thread.sleep(15);
-
-        SocketChannel socketChannel = SocketChannel.open();
-        socketChannel.configureBlocking(true);
-        SocketAddress sa = new InetSocketAddress(serverHost, serverPort);
-        socketChannel.connect(sa);
-
-        String BAD_KRB_MESSAGE = "Hello World!";
-        ByteBuffer writeBuffer = ByteBuffer.allocate(4 + BAD_KRB_MESSAGE.getBytes().length);
-        writeBuffer.putInt(BAD_KRB_MESSAGE.getBytes().length);
-        writeBuffer.put(BAD_KRB_MESSAGE.getBytes());
-        writeBuffer.flip();
-
-        socketChannel.write(writeBuffer);
-    }
-    
-    /**
-     * Get a server socket point for testing usage, either TCP or UDP.
-     * @return server socket point
-     */
-    private static int getServerPort() {
-        int serverPort = 0;
-
-        try {
-            ServerSocket serverSocket = new ServerSocket(0);
-            serverPort = serverSocket.getLocalPort();
-            serverSocket.close();
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to get a server socket point");
-        }
-
-        return serverPort;
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        kdcServer.stop();
-    }
-}
\ No newline at end of file


Mime
View raw message