KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > storage > search > implementation > BasicConstraintTest


1 package org.mmbase.storage.search.implementation;
2
3 import junit.framework.*;
4 import org.mmbase.module.core.*;
5 import org.mmbase.storage.search.*;
6
7 /**
8  * JUnit tests.
9  *
10  * @author Rob van Maris
11  * @version $Revision: 1.2 $
12  */

13 public class BasicConstraintTest extends TestCase {
14     
15     /** Test instance. */
16     private BasicConstraint instance = null;
17     
18     public BasicConstraintTest(java.lang.String JavaDoc testName) {
19         super(testName);
20     }
21     
22     public static void main(java.lang.String JavaDoc[] args) {
23         junit.textui.TestRunner.run(suite());
24     }
25     
26     /**
27      * Sets up before each test.
28      */

29     public void setUp() throws Exception JavaDoc {
30         MMBaseContext.init();
31         MMBase.getMMBase();
32         instance = new BasicConstraint();
33     }
34     
35     /**
36      * Tears down after each test.
37      */

38     public void tearDown() throws Exception JavaDoc {}
39     
40     /** Test of setInverse method, of class org.mmbase.storage.search.implementation.BasicConstraint. */
41     public void testSetInverse() {
42         // Default is false.
43
assertTrue(!instance.isInverse());
44         
45         BasicConstraint result = instance.setInverse(true);
46         assertTrue(instance.isInverse());
47         assertTrue(result == instance);
48     }
49     
50     /** Test of isInverse method, of class org.mmbase.storage.search.implementation.BasicConstraint. */
51     public void testIsInverse() {
52         // Same as:
53
testSetInverse();
54     }
55     
56     /** Test of equals method, of class org.mmbase.storage.search.implementation.BasicConstraint. */
57     public void testEquals() {
58         // TODO: implement test
59
}
60     
61     /** Test of hashCode method, of class org.mmbase.storage.search.implementation.BasicConstraint. */
62     public void testHashCode() {
63         // TODO: implement test
64
}
65     
66     /** Test of getBasicSupportLevel method. */
67     public void testGetBasicSupportLevel() {
68         // Returns SUPPORT_OPTIMAL.
69
assertTrue(instance.getBasicSupportLevel() == SearchQueryHandler.SUPPORT_OPTIMAL);
70     }
71     
72     public static Test suite() {
73         TestSuite suite = new TestSuite(BasicConstraintTest.class);
74         
75         return suite;
76     }
77     
78 }
79
Popular Tags