1   package com.macvu.tiles;
2   
3   import junit.framework.TestCase;
4   
5   /***
6    * Created by IntelliJ IDEA.
7    * User: MVu
8    * Date: Mar 23, 2004
9    * Time: 2:47:12 PM
10   * To change this template use File | Settings | File Templates.
11   */
12  public class CachingAttributeTest extends TestCase {
13      CacheAttribute cacheAttribute;
14  
15      public CachingAttributeTest(String s) {
16          super(s);
17      }
18  
19      public void setUp() throws Exception {
20          cacheAttribute = new CacheAttribute();
21          cacheAttribute.setName("foo");
22          cacheAttribute.setScope("request");
23      }
24  
25      public void testCachingAttributeConstructorNoParam() {
26          CachingAttribute caching = new CachingAttribute();
27  
28          assertNull("Name is null", caching.getName());
29          assertNull("Scope is null", caching.getScope());
30  
31          assertTrue("Should return false", !caching.isInUse());
32      }
33  
34      public void testCachingAttributeConstructorOneParam() {
35          CachingAttribute caching = new CachingAttribute(cacheAttribute);
36  
37          assertEquals("Name is foo", "foo", caching.getName());
38          assertEquals("Scope is request", "request", caching.getScope());
39  
40          assertTrue("Should return false", !caching.isInUse());
41      }
42  
43      public void testCachingAttributeConstructorTwoParam() {
44          CachingAttribute caching = new CachingAttribute(cacheAttribute, true);
45  
46          assertEquals("Name is foo", "foo", caching.getName());
47          assertEquals("Scope is request", "request", caching.getScope());
48  
49          assertTrue("Should return true", caching.isInUse());
50      }
51  }