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: r1310541 - in /tomcat/trunk/test/javax: el/TestCompositeELResolver.java servlet/jsp/TestPageContext.java
Date Fri, 06 Apr 2012 21:16:43 GMT
2012/4/6  <markt@apache.org>:
> Author: markt
> Date: Fri Apr  6 18:44:19 2012
> New Revision: 1310541
>
> URL: http://svn.apache.org/viewvc?rev=1310541&view=rev
> Log:
> Don't use static imports

?

1. I would say that I'd prefer to use static imports in JUnit tests.
They cause no confusion here and are easier to read

(and using static imports for those assert methods is what is
recommended in many places).

2. It should be already allowed by configuration in checkstyle.xml,
so was there a problem?

    <module name="AvoidStaticImport">
        <property name="excludes"
                  value="org.apache.catalina.startup.SimpleHttpClient.CRLF"/>
        <property name="excludes" value="org.junit.Assert.*"/>
    </module>

Best regards,
Konstantin Kolinko

> Modified:
>    tomcat/trunk/test/javax/el/TestCompositeELResolver.java
>    tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java
>
> Modified: tomcat/trunk/test/javax/el/TestCompositeELResolver.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestCompositeELResolver.java?rev=1310541&r1=1310540&r2=1310541&view=diff
> ==============================================================================
> --- tomcat/trunk/test/javax/el/TestCompositeELResolver.java (original)
> +++ tomcat/trunk/test/javax/el/TestCompositeELResolver.java Fri Apr  6 18:44:19 2012
> @@ -20,8 +20,7 @@ import java.io.File;
>
>  import javax.servlet.http.HttpServletResponse;
>
> -import static org.junit.Assert.assertEquals;
> -
> +import org.junit.Assert;
>  import org.junit.Test;
>
>  import org.apache.catalina.core.StandardContext;
> @@ -49,6 +48,6 @@ public class TestCompositeELResolver ext
>         int rc = getUrl("http://localhost:" + getPort() +
>                 "/test/bug50408.jsp", new ByteChunk(), null);
>
> -        assertEquals(HttpServletResponse.SC_OK, rc);
> +        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
>     }
>  }
>
> Modified: tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java?rev=1310541&r1=1310540&r2=1310541&view=diff
> ==============================================================================
> --- tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java (original)
> +++ tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java Fri Apr  6 18:44:19 2012
> @@ -19,8 +19,7 @@ package javax.servlet.jsp;
>
>  import java.io.File;
>
> -import static org.junit.Assert.assertTrue;
> -
> +import org.junit.Assert;
>  import org.junit.Test;
>
>  import org.apache.catalina.startup.Tomcat;
> @@ -43,6 +42,6 @@ public class TestPageContext extends Tom
>                 "/test/bug49nnn/bug49196.jsp");
>
>         String result = res.toString();
> -        assertTrue(result.contains("OK"));
> +        Assert.assertTrue(result.contains("OK"));
>     }
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>

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


Mime
View raw message