Package com.google.code.kaptcha

Examples of com.google.code.kaptcha.Producer.createText()


        String imagePath = StratosConstants.CAPTCHA_IMAGES_PATH + RegistryConstants.PATH_SEPARATOR +
                           randomSecretKey + ".jpg";

        Config config = new Config(new Properties());
        Producer captchaProducer = config.getProducerImpl();
        String captchaText = captchaProducer.createText();

        BufferedImage image = captchaProducer.createImage(captchaText);

        File tempFile = File.createTempFile("temp-", ".jpg");
View Full Code Here


        int imageType = 1;

        when(response.getOutputStream()).thenReturn(out);
        when(service.getCaptchaProducer()).thenReturn(captchaProducer);
        when(captchaProducer.createText()).thenReturn(GENERATED_CAPTCHA_TEXT);
        when(captchaProducer.createImage(GENERATED_CAPTCHA_TEXT)).
                thenReturn(new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT, imageType));

        service.refreshCaptchaImage(request, response);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.