KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > tests > basic > CrudMethodTest


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

8
9 package org.jboss.cache.tests.basic;
10
11 import junit.framework.Test;
12 import junit.framework.TestCase;
13 import junit.framework.TestSuite;
14 import org.jboss.cache.TreeCache;
15
16 /**
17  * Checks CRUD methods
18  *
19  * @author Bela Ban
20  * @version $Id: CrudMethodTest.java,v 1.1.1.1 2005/03/31 10:15:08 belaban Exp $
21  */

22 public class CrudMethodTest extends TestCase {
23
24
25    public CrudMethodTest(String JavaDoc name) {
26       super(name);
27    }
28
29    public void testCrudMethods() {
30       assertTrue(TreeCache.isCrudMethod(TreeCache.putDataEraseMethodLocal));
31       assertTrue(TreeCache.isCrudMethod(TreeCache.putDataMethodLocal));
32       assertTrue(TreeCache.isCrudMethod(TreeCache.putKeyValMethodLocal));
33       assertTrue(TreeCache.isCrudMethod(TreeCache.removeDataMethodLocal));
34       assertTrue(TreeCache.isCrudMethod(TreeCache.removeKeyMethodLocal));
35       assertTrue(TreeCache.isCrudMethod(TreeCache.removeNodeMethodLocal));
36
37       assertFalse(TreeCache.isCrudMethod(TreeCache.getKeyValueMethodLocal));
38       assertFalse(TreeCache.isCrudMethod(TreeCache.getNodeMethodLocal));
39       assertFalse(TreeCache.isCrudMethod(TreeCache.getKeysMethodLocal));
40       assertFalse(TreeCache.isCrudMethod(TreeCache.getChildrenNamesMethodLocal));
41    }
42
43
44
45    public static Test suite() throws Exception JavaDoc {
46       return new TestSuite(CrudMethodTest.class);
47    }
48
49    public static void main(String JavaDoc[] args) throws Exception JavaDoc {
50       junit.textui.TestRunner.run(suite());
51    }
52
53
54 }
55
Popular Tags