修复验证码位数的bug,优化代码
This commit is contained in:
27
src/test/java/com/wf/captcha/CaptchaTest.java
Normal file
27
src/test/java/com/wf/captcha/CaptchaTest.java
Normal 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")));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user