View Javadoc
1 package test.net.sourceforge.pmd.ast; 2 3 import junit.framework.TestCase; 4 import net.sourceforge.pmd.ast.AccessNode; 5 6 public class AccessNodeTest extends TestCase { 7 public void testStatic() { 8 AccessNode node = new AccessNode(1); 9 10 assertTrue("Node should default to not static.", !node.isStatic()); 11 12 node.setStatic(); 13 assertTrue("Node set to static, not static.", node.isStatic()); 14 } 15 16 public void testPublic() { 17 AccessNode node = new AccessNode(1); 18 19 assertTrue("Node should default to not public.", !node.isPublic()); 20 21 node.setPublic(); 22 assertTrue("Node set to public, not public.", node.isPublic()); 23 } 24 25 public void testProtected() { 26 AccessNode node = new AccessNode(1); 27 28 assertTrue("Node should default to not protected.", !node.isProtected()); 29 30 node.setProtected(); 31 assertTrue("Node set to protected, not protected.", node.isProtected()); 32 } 33 34 public void testPrivate() { 35 AccessNode node = new AccessNode(1); 36 37 assertTrue("Node should default to not private.", !node.isPrivate()); 38 39 node.setPrivate(); 40 assertTrue("Node set to private, not private.", node.isPrivate()); 41 } 42 43 public void testFinal() { 44 AccessNode node = new AccessNode(1); 45 46 assertTrue("Node should default to not final.", !node.isFinal()); 47 48 node.setFinal(); 49 assertTrue("Node set to final, not final.", node.isFinal()); 50 } 51 52 public void testSynchronized() { 53 AccessNode node = new AccessNode(1); 54 55 assertTrue("Node should default to not synchronized.", !node.isSynchronized()); 56 57 node.setSynchronized(); 58 assertTrue("Node set to synchronized, not synchronized.", node.isSynchronized()); 59 } 60 61 public void testVolatile() { 62 AccessNode node = new AccessNode(1); 63 64 assertTrue("Node should default to not volatile.", !node.isVolatile()); 65 66 node.setVolatile(); 67 assertTrue("Node set to volatile, not volatile.", node.isVolatile()); 68 } 69 70 public void testTransient() { 71 AccessNode node = new AccessNode(1); 72 73 assertTrue("Node should default to not transient.", !node.isTransient()); 74 75 node.setTransient(); 76 assertTrue("Node set to transient, not transient.", node.isTransient()); 77 } 78 79 public void testNative() { 80 AccessNode node = new AccessNode(1); 81 82 assertTrue("Node should default to not native.", !node.isNative()); 83 84 node.setNative(); 85 assertTrue("Node set to native, not native.", node.isNative()); 86 } 87 88 public void testInterface() { 89 AccessNode node = new AccessNode(1); 90 91 assertTrue("Node should default to not interface.", !node.isInterface()); 92 93 node.setInterface(); 94 assertTrue("Node set to interface, not interface.", node.isInterface()); 95 } 96 97 public void testAbstract() { 98 AccessNode node = new AccessNode(1); 99 100 assertTrue("Node should default to not abstract.", !node.isAbstract()); 101 102 node.setAbstract(); 103 assertTrue("Node set to abstract, not abstract.", node.isAbstract()); 104 } 105 106 public void testStrict() { 107 AccessNode node = new AccessNode(1); 108 109 assertTrue("Node should default to not strict.", !node.isStrict()); 110 111 node.setStrict(); 112 assertTrue("Node set to strict, not strict.", node.isStrict()); 113 } 114 115 public void testSuper() { 116 AccessNode node = new AccessNode(1); 117 118 assertTrue("Node should default to not super.", !node.isSuper()); 119 120 node.setSuper(); 121 assertTrue("Node set to super, not super.", node.isSuper()); 122 } 123 }

This page was automatically generated by Maven