@@ -0,0 +1,1577 @@
+/* LanguageTool, a natural language style checker%0A * Copyright (C) 2017 Daniel Naber (http://www.danielnaber.de)%0A *%0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A * USA%0A */%0Apackage org.languagetool.server;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class ErrorRequestLimiterTest %7B%0A  %0A  @Test%0A  public void testErrorLimiter() throws InterruptedException %7B%0A    ErrorRequestLimiter limiter = new ErrorRequestLimiter(3, 1);%0A    String ip1 = %22192.168.0.1%22;%0A    String ip2 = %22192.168.0.2%22;%0A    assertTrue(limiter.wouldAccessBeOkay(ip1));%0A    assertTrue(limiter.wouldAccessBeOkay(ip2));%0A    limiter.logAccess(ip1);%0A    limiter.logAccess(ip1);%0A    limiter.logAccess(ip1);%0A    limiter.logAccess(ip1);%0A    assertFalse(limiter.wouldAccessBeOkay(ip1));%0A    assertTrue(limiter.wouldAccessBeOkay(ip2));%0A    Thread.sleep(1250);%0A    assertTrue(limiter.wouldAccessBeOkay(ip1));%0A  %7D%0A%0A%7D

add test