You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2018/05/31 14:11:27 UTC

svn commit: r1832619 - in /tomcat/trunk: res/findbugs/filter-false-positives.xml test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java

Author: markt
Date: Thu May 31 14:11:27 2018
New Revision: 1832619

URL: http://svn.apache.org/viewvc?rev=1832619&view=rev
Log:
Better name for test servlet

Modified:
    tomcat/trunk/res/findbugs/filter-false-positives.xml
    tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java

Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1832619&r1=1832618&r2=1832619&view=diff
==============================================================================
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Thu May 31 14:11:27 2018
@@ -1677,7 +1677,7 @@
   </Match>
   <Match>
     <!-- Deliberate hack for the purposes of the test -->
-    <Class name="org.apache.catalina.valves.TestStuckThreadDetectionValve$StuckingServlet"/>
+    <Class name="org.apache.catalina.valves.TestStuckThreadDetectionValve$StickingServlet"/>
     <Field name="wasInterrupted"/>
     <Bug pattern="MSF_MUTABLE_SERVLET_FIELD"/>
   </Match>

Modified: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java?rev=1832619&r1=1832618&r2=1832619&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Thu May 31 14:11:27 2018
@@ -51,9 +51,9 @@ public class TestStuckThreadDetectionVal
     @Test
     public void testDetection() throws Exception {
         // second, we test the actual effect of the flag on the startup
-        StuckingServlet stuckingServlet = new StuckingServlet(8000L);
+        StickingServlet stickingServlet = new StickingServlet(8000L);
         Wrapper servlet = Tomcat.addServlet(context, "myservlet",
-                stuckingServlet);
+                stickingServlet);
         servlet.addMapping("/myservlet");
 
         StuckThreadDetectionValve valve = new StuckThreadDetectionValve();
@@ -89,17 +89,17 @@ public class TestStuckThreadDetectionVal
             // check that we did not reach the join timeout
             Assert.assertFalse(asyncThread.isAlive());
         }
-        Assert.assertFalse(stuckingServlet.wasInterrupted);
+        Assert.assertFalse(stickingServlet.wasInterrupted);
         Assert.assertTrue(result.toString().startsWith("OK"));
     }
 
     @Test
     public void testInterruption() throws Exception {
         // second, we test the actual effect of the flag on the startup
-        StuckingServlet stuckingServlet = new StuckingServlet(
+        StickingServlet stickingServlet = new StickingServlet(
                 TimeUnit.SECONDS.toMillis(20L));
         Wrapper servlet = Tomcat.addServlet(context, "myservlet",
-                stuckingServlet);
+                stickingServlet);
         servlet.addMapping("/myservlet");
 
         StuckThreadDetectionValve valve = new StuckThreadDetectionValve();
@@ -134,18 +134,18 @@ public class TestStuckThreadDetectionVal
             // check that we did not reach the join timeout
             Assert.assertFalse(asyncThread.isAlive());
         }
-        Assert.assertTrue(stuckingServlet.wasInterrupted);
+        Assert.assertTrue(stickingServlet.wasInterrupted);
         Assert.assertEquals(0, valve.getStuckThreadIds().length);
         Assert.assertTrue(result.toString().startsWith("OK"));
     }
 
-    private static class StuckingServlet extends HttpServlet {
+    private static class StickingServlet extends HttpServlet {
 
         private static final long serialVersionUID = 1L;
         private final long delay;
         boolean wasInterrupted = false;
 
-        StuckingServlet(long delay) {
+        StickingServlet(long delay) {
             this.delay = delay;
         }
 



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