KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > classfile > AccessTest


1 package org.netbeans.modules.classfile;
2 /*
3  * AccessTest.java
4  * JUnit based test
5  *
6  * Created on September 3, 2004, 2:09 PM
7  */

8
9 import junit.framework.TestCase;
10
11 /**
12  *
13  * @author tball
14  */

15 public class AccessTest extends TestCase {
16     
17     public AccessTest(String JavaDoc testName) {
18         super(testName);
19     }
20
21     /**
22      * Test of isStatic method, of class org.netbeans.modules.classfile.Access.
23      */

24     public void testIsStatic() {
25         int access = Access.STATIC;
26         assertTrue(Access.isStatic(access));
27         assertFalse(Access.isStatic(~access));
28     }
29
30     /**
31      * Test of isPublic method, of class org.netbeans.modules.classfile.Access.
32      */

33     public void testIsPublic() {
34         int access = Access.PUBLIC;
35         assertTrue(Access.isPublic(access));
36         assertFalse(Access.isPublic(~access));
37     }
38
39     /**
40      * Test of isProtected method, of class org.netbeans.modules.classfile.Access.
41      */

42     public void testIsProtected() {
43         int access = Access.PROTECTED;
44         assertTrue(Access.isProtected(access));
45         assertFalse(Access.isProtected(~access));
46     }
47
48     /**
49      * Test of isPackagePrivate method, of class org.netbeans.modules.classfile.Access.
50      */

51     public void testIsPackagePrivate() {
52         assertTrue(Access.isPackagePrivate(0));
53         assertFalse(Access.isPackagePrivate(Access.PUBLIC));
54         assertFalse(Access.isPackagePrivate(Access.PROTECTED));
55         assertFalse(Access.isPackagePrivate(Access.PRIVATE));
56     }
57
58     /**
59      * Test of isPrivate method, of class org.netbeans.modules.classfile.Access.
60      */

61     public void testIsPrivate() {
62         int access = Access.PRIVATE;
63         assertTrue(Access.isPrivate(access));
64         assertFalse(Access.isPrivate(~access));
65     }
66 }
67
Popular Tags