tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1377835 - /tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
Date Mon, 27 Aug 2012 20:58:07 GMT
2012/8/28  <markt@apache.org>:
> Author: markt
> Date: Mon Aug 27 20:32:19 2012
> New Revision: 1377835
>
> URL: http://svn.apache.org/viewvc?rev=1377835&view=rev
> Log:

> - Remove static imports (auto completes are easier without them)
>

In Eclipse settings
Java -> Editor -> Content Assist -> Favorites

My list there is:
[[[
org.hamcrest.CoreMatchers
org.hamcrest.Matchers
org.junit.Assert
org.junit.matchers.JUnitMatchers
]]]
(each line added with "New Type.." button)

After that content assist begins suggesting the static methods.

We are not yet using Hamcrest library in Tomcat, but I think one time
we might start using it. (The library that provides matchers that are
used with org.junit.Assert.assertThat(..),
org.junit.rules.ErrorCollector.checkThat(...) etc.).

I am not insisting on reverting this. Just FYI.

> Modified:
>     tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
>
> Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1377835&r1=1377834&r2=1377835&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Mon Aug 27 20:32:19
2012
> @@ -38,10 +38,7 @@ import javax.naming.InitialContext;
>  import javax.naming.NamingException;
>  import javax.servlet.http.HttpServletRequest;
>
> -import static org.junit.Assert.assertEquals;
> -import static org.junit.Assert.assertFalse;
> -import static org.junit.Assert.assertTrue;
> -
> +import org.junit.Assert;
>  import org.junit.Test;
>
>  import org.apache.catalina.Context;
> @@ -84,11 +81,12 @@ public class TestWebSocket extends Tomca
>
>          // Make sure we got an upgrade response
>          String responseLine = client.reader.readLine();
> -        assertTrue(responseLine.startsWith("HTTP/1.1 101"));
> +        Assert.assertNotNull(responseLine);
> +        Assert.assertTrue(responseLine.startsWith("HTTP/1.1 101"));
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message