You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/12/16 19:55:22 UTC

svn commit: r1551310 - /manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java

Author: kwright
Date: Mon Dec 16 18:55:22 2013
New Revision: 1551310

URL: http://svn.apache.org/r1551310
Log:
Hook up sanity checks at end, EXCEPT for byte rate

Modified:
    manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java

Modified: manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java?rev=1551310&r1=1551309&r2=1551310&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java (original)
+++ manifoldcf/branches/CONNECTORS-829/framework/core/src/test/java/org/apache/manifoldcf/core/throttler/TestThrottler.java Mon Dec 16 18:55:22 2013
@@ -335,7 +335,9 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
+      if (state.outstandingConnections + 1 > 3)
+        throw new Exception("Too many outstanding connections at once!");
+      state.outstandingConnections++;
     }
     
     public String toString()
@@ -355,7 +357,7 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
+      state.outstandingConnections--;
     }
     
     public String toString()
@@ -375,7 +377,6 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
     }
     
     public String toString()
@@ -395,7 +396,6 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
     }
     
     public String toString()
@@ -415,7 +415,9 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
+      if (timestamp < state.lastFetch + 20L)
+        throw new Exception("Fetch too fast: took place in "+ (timestamp - state.lastFetch) + " milliseconds");
+      state.lastFetch = timestamp;
     }
     
     public String toString()
@@ -434,7 +436,6 @@ public class TestThrottler extends org.a
     public void apply(State state)
       throws Exception
     {
-      // MHL
     }
     
     public String toString()