1
2
3
4
5
6
7 package com.octo.captcha.service.captchastore;
8
9
10 /***
11 * @author <a href="mailto:antoine.veret@gmail.com">Antoine Véret</a>
12 * @version 1.0
13 */
14 public class JBossCacheCaptchaStoreTest extends CaptchaStoreTestAbstract {
15
16
17
18
19 public CaptchaStore getStore() {
20 return new JBossCacheCaptchaStore();
21 }
22
23 public void setUp() throws Exception {
24 System.setProperty(JBossCacheCaptchaStore.JCAPTCHA_JBOSSCACHE_CONFIG, "captchaStoreJBossCache.xml");
25 super.setUp();
26 }
27
28 public void tearDown() {
29 super.tearDown();
30 }
31
32 public void testSystemPropertyForConfig() throws Exception {
33 System.clearProperty(JBossCacheCaptchaStore.JCAPTCHA_JBOSSCACHE_CONFIG);
34
35 store.cleanAndShutdown();
36
37 try {
38 store.initAndStart();
39 fail();
40 } catch (RuntimeException e) {
41 assertEquals("The system property " + JBossCacheCaptchaStore.JCAPTCHA_JBOSSCACHE_CONFIG +
42 " have to be set", e.getMessage());
43 }
44 }
45
46 }