Browse Source

SEC-368: Tidied up captcha spelling.

2.0.x
Luke Taylor 19 years ago
parent
commit
3326525b65
  1. 2
      core/src/main/java/org/acegisecurity/captcha/CaptchaChannelProcessorTemplate.java
  2. 8
      core/src/test/java/org/acegisecurity/captcha/AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests.java
  3. 4
      core/src/test/java/org/acegisecurity/captcha/AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests.java
  4. 8
      core/src/test/java/org/acegisecurity/captcha/AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTests.java
  5. 2
      core/src/test/java/org/acegisecurity/captcha/CaptchaChannelProcessorTemplateTests.java
  6. 8
      core/src/test/java/org/acegisecurity/captcha/TestOnceAfterMaxRequestsCaptchaChannelProcessorTests.java

2
core/src/main/java/org/acegisecurity/captcha/CaptchaChannelProcessorTemplate.java

@ -138,7 +138,7 @@ public abstract class CaptchaChannelProcessorTemplate implements ChannelProcesso @@ -138,7 +138,7 @@ public abstract class CaptchaChannelProcessorTemplate implements ChannelProcesso
this.keyword = keyword;
}
public void setThresold(int thresold) {
public void setThreshold(int thresold) {
this.thresold = thresold;
}

8
core/src/test/java/org/acegisecurity/captcha/AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests.java

@ -37,17 +37,17 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test @@ -37,17 +37,17 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test
public void testIsContextValidConcerningHumanity()
throws Exception {
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
context.incrementHumanRestrictedResourcesRequestsCount();
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(-1);
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(-1);
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(3);
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(3);
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
context.incrementHumanRestrictedResourcesRequestsCount();
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
@ -59,7 +59,7 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test @@ -59,7 +59,7 @@ public class AlwaysTestAfterMaxRequestsCaptchaChannelProcessorTests extends Test
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
assertFalse(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
alwaysTestAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
assertTrue(alwaysTestAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
}
}

4
core/src/test/java/org/acegisecurity/captcha/AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests.java

@ -57,7 +57,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes @@ -57,7 +57,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes
public void testIsContextValidConcerningHumanity()
throws Exception {
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThresold(100);
alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThreshold(100);
context.setHuman();
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < alwaysTestAfterTimeInMillisCaptchaChannelProcessor
@ -78,7 +78,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes @@ -78,7 +78,7 @@ public class AlwaysTestAfterTimeInMillisCaptchaChannelProcessorTests extends Tes
public void testNewContext() {
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
//alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThresold(10);
//alwaysTestAfterTimeInMillisCaptchaChannelProcessor.setThreshold(10);
assertFalse(alwaysTestAfterTimeInMillisCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
}
}

8
core/src/test/java/org/acegisecurity/captcha/AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTests.java

@ -38,7 +38,7 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe @@ -38,7 +38,7 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe
public void testEqualsThresold() {
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(100);
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(100);
context.setHuman();
@ -58,19 +58,19 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe @@ -58,19 +58,19 @@ public class AlwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessorTe
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
context));
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(0);
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(0);
context.setHuman();
context.incrementHumanRestrictedRessoucesRequestsCount();
assertFalse(alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.isContextValidConcerningHumanity(
context));
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(0);
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(0);
*/
}
/*
public void testIsContextValidConcerningHumanity()
throws Exception {
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThresold(10);
alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor.setThreshold(10);
context.setHuman();
while ((System.currentTimeMillis() - context.getLastPassedCaptchaDateInMillis()) < (10 * alwaysTestBelowAverageTimeInMillisBetweenRequestsChannelProcessor

2
core/src/test/java/org/acegisecurity/captcha/CaptchaChannelProcessorTemplateTests.java

@ -123,7 +123,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase { @@ -123,7 +123,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase {
assertEquals("X", processor.getKeyword());
assertEquals(0, processor.getThreshold());
processor.setThresold(1);
processor.setThreshold(1);
assertEquals(1, processor.getThreshold());
assertTrue(processor.getEntryPoint() == null);

8
core/src/test/java/org/acegisecurity/captcha/TestOnceAfterMaxRequestsCaptchaChannelProcessorTests.java

@ -40,17 +40,17 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa @@ -40,17 +40,17 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa
public void testIsContextValidConcerningHumanity()
throws Exception {
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
context.incrementHumanRestrictedResourcesRequestsCount();
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(-1);
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(-1);
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(3);
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(3);
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
context.incrementHumanRestrictedResourcesRequestsCount();
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
@ -67,7 +67,7 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa @@ -67,7 +67,7 @@ public class TestOnceAfterMaxRequestsCaptchaChannelProcessorTests extends TestCa
CaptchaSecurityContextImpl context = new CaptchaSecurityContextImpl();
assertFalse(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThresold(1);
testOnceAfterMaxRequestsCaptchaChannelProcessor.setThreshold(1);
assertTrue(testOnceAfterMaxRequestsCaptchaChannelProcessor.isContextValidConcerningHumanity(context));
}
}

Loading…
Cancel
Save