修复验证码位数的bug,优化代码

This commit is contained in:
synchronized
2018-07-27 12:02:33 +08:00
parent a4e61fd633
commit a548f7af0b
16 changed files with 675 additions and 461 deletions

View File

@@ -0,0 +1,27 @@
package com.wf.captcha;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
/**
* 测试类
* Created by 王帆 on 2018-07-27 上午 10:08.
*/
public class CaptchaTest {
@Test
public void test() throws Exception {
SpecCaptcha specCaptcha = new SpecCaptcha(150, 40, 4);
System.out.println(specCaptcha.text());
specCaptcha.out(new FileOutputStream(new File("D:/a/aa.png")));
}
@Test
public void testGIf() throws Exception {
GifCaptcha specCaptcha = new GifCaptcha(150, 40, 4);
System.out.println(specCaptcha.text());
specCaptcha.out(new FileOutputStream(new File("D:/a/aa.gif")));
}
}