directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r581640 - /directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java
Date Wed, 03 Oct 2007 15:51:42 GMT
Author: szoerner
Date: Wed Oct  3 08:51:42 2007
New Revision: 581640

URL: http://svn.apache.org/viewvc?rev=581640&view=rev
Log:
Changed to JUnit 4 syntax (annotations)

Modified:
    directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java

Modified: directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java?rev=581640&r1=581639&r2=581640&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java
(original)
+++ directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpServerUdpClientTest.java
Wed Oct  3 08:51:42 2007
@@ -21,14 +21,14 @@
 package org.apache.directory.server.ntp;
 
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.net.ntp.NTPUDPClient;
 import org.apache.commons.net.ntp.TimeInfo;
 import org.apache.mina.common.ThreadModel;
@@ -36,6 +36,9 @@
 import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
 import org.apache.mina.util.AvailablePortFinder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 
 /**
@@ -44,7 +47,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class NtpServerUdpClientTest extends TestCase
+public class NtpServerUdpClientTest
 {
 
     private NtpServer ntpServer = null;
@@ -56,7 +59,7 @@
 
     /** Starts the NTP server on UDP, uses the first port available starting from 1024.
      */
-    protected void setUp()
+    @Before public void startNTPServerOnUDP()
     {
 
         NtpConfiguration ntpCfg = new NtpConfiguration();
@@ -82,7 +85,7 @@
      * @throws UnknownHostException
      * @throws IOException
      */
-    public void testReturnTime() throws UnknownHostException, IOException
+    @Test public void shouldReturnCurrentTimeToClient() throws UnknownHostException, IOException
     {
 
         // Get time via client call
@@ -101,7 +104,7 @@
 
     /** Shuts the NTP server down
      */
-    protected void tearDown()
+    @After public void shutdownNTPServer()
     {
         ntpServer.destroy();
     }



Mime
View raw message