You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2008/11/12 14:40:16 UTC
svn commit: r713367 -
/mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
Author: elecharny
Date: Wed Nov 12 05:40:16 2008
New Revision: 713367
URL: http://svn.apache.org/viewvc?rev=713367&view=rev
Log:
Switched to Junit4
Modified:
mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
Modified: mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
URL: http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java?rev=713367&r1=713366&r2=713367&view=diff
==============================================================================
--- mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java (original)
+++ mina/trunk/example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java Wed Nov 12 05:40:16 2008
@@ -31,8 +31,6 @@
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
-import junit.framework.TestCase;
-
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
@@ -40,6 +38,11 @@
import org.apache.mina.filter.ssl.SslFilter;
import org.apache.mina.transport.socket.SocketAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
/**
* TODO Add documentation
@@ -47,28 +50,28 @@
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
*/
-public class SslFilterTest extends TestCase {
+public class SslFilterTest {
private int port;
private SocketAcceptor acceptor;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
acceptor = new NioSocketAcceptor();
}
- @Override
- protected void tearDown() throws Exception {
+ @After
+ public void tearDown() throws Exception {
acceptor.setCloseOnDeactivation(true);
acceptor.dispose();
- super.tearDown();
}
+ @Test
public void testMessageSentIsCalled() throws Exception {
testMessageSentIsCalled(false);
}
+ @Test
public void testMessageSentIsCalled_With_SSL() throws Exception {
testMessageSentIsCalled(true);
}