KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > loader > FileCacheLoaderConfigTest


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache.loader;
8
9 import junit.framework.TestCase;
10
11 import java.util.Properties JavaDoc;
12
13 /**
14  * Unit test class for FileCacheLoaderConfig
15  *
16  * @author <a HREF="mailto:galder.zamarreno@jboss.com">Galder Zamarreno</a>
17  */

18 public class FileCacheLoaderConfigTest extends TestCase
19 {
20    private FileCacheLoaderConfig fclc;
21
22    protected void setUp() throws Exception JavaDoc
23    {
24       fclc = new FileCacheLoaderConfig();
25    }
26
27    public void testSetProperties()
28    {
29       fclc.setProperties((Properties JavaDoc)null);
30       assertTrue(fclc.isCheckCharacterPortability());
31       assertNull(fclc.getLocation());
32
33       Properties JavaDoc p = new Properties JavaDoc();
34       p.setProperty("location", "any");
35       fclc.setProperties(p);
36       assertTrue(fclc.isCheckCharacterPortability());
37       assertEquals("any", fclc.getLocation());
38
39       p.clear();
40
41       p.setProperty("check.character.portability", "true");
42       fclc.setProperties(p);
43       assertTrue(fclc.isCheckCharacterPortability());
44       assertNull(fclc.getLocation());
45
46       p.clear();
47
48       p.setProperty("check.character.portability", "false");
49       fclc.setProperties(p);
50       assertFalse(fclc.isCheckCharacterPortability());
51       assertNull(fclc.getLocation());
52    }
53 }
54
Popular Tags