SEC-368: Tidied up captcha spelling.
This commit is contained in:
parent
dd2a46c7ca
commit
3326525b65
|
@ -138,7 +138,7 @@ public abstract class CaptchaChannelProcessorTemplate implements ChannelProcesso
|
||||||
this.keyword = keyword;
|
this.keyword = keyword;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setThresold(int thresold) {
|
public void setThreshold(int thresold) {
|
||||||
this.thresold = thresold;
|
this.thresold = thresold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,17 +37,17 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test
|
||||||
|
|
||||||
public void testIsContextValidConcerningHumanity()
|
public void testIsContextValidConcerningHumanity()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
|
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
|
||||||
|
|
||||||
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
||||||
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
|
||||||
context.incrementHumanRestrictedResourcesRequestsCount();
|
context.incrementHumanRestrictedResourcesRequestsCount();
|
||||||
|
|
||||||
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(-1);
|
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(-1);
|
||||||
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
|
||||||
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(3);
|
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(3);
|
||||||
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
context.incrementHumanRestrictedResourcesRequestsCount();
|
context.incrementHumanRestrictedResourcesRequestsCount();
|
||||||
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
@ -59,7 +59,7 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test
|
||||||
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
||||||
|
|
||||||
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
|
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
|
||||||
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes
|
||||||
public void testIsContextValidConcerningHumanity()
|
public void testIsContextValidConcerningHumanity()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
||||||
alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThresold(100);
|
alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThreshold(100);
|
||||||
context.setHuman();
|
context.setHuman();
|
||||||
|
|
||||||
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < alwaysTestAfterTimeInMillisCaptchaChannelProcessor
|
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < alwaysTestAfterTimeInMillisCaptchaChannelProcessor
|
||||||
|
@ -78,7 +78,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes
|
||||||
public void testNewContext() {
|
public void testNewContext() {
|
||||||
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
||||||
|
|
||||||
//alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThresold(10);
|
//alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThreshold(10);
|
||||||
assertFalse(alwaysTestAfterTimeInMillisCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertFalse(alwaysTestAfterTimeInMillisCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe
|
||||||
|
|
||||||
public void testEqualsThresold() {
|
public void testEqualsThresold() {
|
||||||
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
||||||
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(100);
|
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(100);
|
||||||
|
|
||||||
context.setHuman();
|
context.setHuman();
|
||||||
|
|
||||||
|
@ -58,19 +58,19 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe
|
||||||
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
|
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
|
||||||
context));
|
context));
|
||||||
|
|
||||||
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(0);
|
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(0);
|
||||||
context.setHuman();
|
context.setHuman();
|
||||||
context.incrementHumanRestrictedRessoucesRequestsCount();
|
context.incrementHumanRestrictedRessoucesRequestsCount();
|
||||||
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
|
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
|
||||||
context));
|
context));
|
||||||
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(0);
|
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(0);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
public void testIsContextValidConcerningHumanity()
|
public void testIsContextValidConcerningHumanity()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
||||||
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(10);
|
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(10);
|
||||||
context.setHuman();
|
context.setHuman();
|
||||||
|
|
||||||
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < (10 * alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor
|
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < (10 * alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
||||||
assertEquals("X", processor.getKeyword());
|
assertEquals("X", processor.getKeyword());
|
||||||
|
|
||||||
assertEquals(0, processor.getThreshold());
|
assertEquals(0, processor.getThreshold());
|
||||||
processor.setThresold(1);
|
processor.setThreshold(1);
|
||||||
assertEquals(1, processor.getThreshold());
|
assertEquals(1, processor.getThreshold());
|
||||||
|
|
||||||
assertTrue(processor.getEntryPoint() == null);
|
assertTrue(processor.getEntryPoint() == null);
|
||||||
|
|
|
@ -40,17 +40,17 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa
|
||||||
|
|
||||||
public void testIsContextValidConcerningHumanity()
|
public void testIsContextValidConcerningHumanity()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
|
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
|
||||||
|
|
||||||
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
||||||
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
|
||||||
context.incrementHumanRestrictedResourcesRequestsCount();
|
context.incrementHumanRestrictedResourcesRequestsCount();
|
||||||
|
|
||||||
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(-1);
|
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(-1);
|
||||||
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
|
||||||
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(3);
|
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(3);
|
||||||
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
context.incrementHumanRestrictedResourcesRequestsCount();
|
context.incrementHumanRestrictedResourcesRequestsCount();
|
||||||
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
|
@ -67,7 +67,7 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa
|
||||||
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
|
||||||
|
|
||||||
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
|
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
|
||||||
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue