Source Code Cross Referenced for AccessNodeTest.java in  » Code-Analyzer » pmd-4.2rc1 » test » net » sourceforge » pmd » ast » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » pmd 4.2rc1 » test.net.sourceforge.pmd.ast 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
003:         */package test.net.sourceforge.pmd.ast;
004:
005:        import static org.junit.Assert.assertFalse;
006:        import static org.junit.Assert.assertTrue;
007:        import net.sourceforge.pmd.ast.ASTClassOrInterfaceDeclaration;
008:        import net.sourceforge.pmd.ast.AccessNode;
009:
010:        import org.junit.Test;
011:
012:        import test.net.sourceforge.pmd.testframework.ParserTst;
013:
014:        import java.util.Set;
015:
016:        public class AccessNodeTest extends ParserTst {
017:
018:            @Test
019:            public void testModifiersOnClassDecl() throws Throwable {
020:                Set ops = getNodes(ASTClassOrInterfaceDeclaration.class, TEST1);
021:                assertTrue(((ASTClassOrInterfaceDeclaration) (ops.iterator()
022:                        .next())).isPublic());
023:            }
024:
025:            private static final String TEST1 = "public class Foo {}";
026:
027:            @Test
028:            public void testStatic() {
029:                AccessNode node = new AccessNode(1);
030:                assertFalse("Node should default to not static.", node
031:                        .isStatic());
032:                node.setStatic();
033:                assertTrue("Node set to static, not static.", node.isStatic());
034:            }
035:
036:            @Test
037:            public void testPublic() {
038:                AccessNode node = new AccessNode(1);
039:                assertFalse("Node should default to not public.", node
040:                        .isPublic());
041:                node.setPublic();
042:                assertTrue("Node set to public, not public.", node.isPublic());
043:            }
044:
045:            @Test
046:            public void testProtected() {
047:                AccessNode node = new AccessNode(1);
048:                assertFalse("Node should default to not protected.", node
049:                        .isProtected());
050:                node.setProtected();
051:                assertTrue("Node set to protected, not protected.", node
052:                        .isProtected());
053:            }
054:
055:            @Test
056:            public void testPrivate() {
057:                AccessNode node = new AccessNode(1);
058:                assertFalse("Node should default to not private.", node
059:                        .isPrivate());
060:                node.setPrivate();
061:                assertTrue("Node set to private, not private.", node
062:                        .isPrivate());
063:            }
064:
065:            @Test
066:            public void testFinal() {
067:                AccessNode node = new AccessNode(1);
068:                assertFalse("Node should default to not final.", node.isFinal());
069:                node.setFinal();
070:                assertTrue("Node set to final, not final.", node.isFinal());
071:            }
072:
073:            @Test
074:            public void testSynchronized() {
075:                AccessNode node = new AccessNode(1);
076:                assertFalse("Node should default to not synchronized.", node
077:                        .isSynchronized());
078:                node.setSynchronized();
079:                assertTrue("Node set to synchronized, not synchronized.", node
080:                        .isSynchronized());
081:            }
082:
083:            @Test
084:            public void testVolatile() {
085:                AccessNode node = new AccessNode(1);
086:                assertFalse("Node should default to not volatile.", node
087:                        .isVolatile());
088:                node.setVolatile();
089:                assertTrue("Node set to volatile, not volatile.", node
090:                        .isVolatile());
091:            }
092:
093:            @Test
094:            public void testTransient() {
095:                AccessNode node = new AccessNode(1);
096:                assertFalse("Node should default to not transient.", node
097:                        .isTransient());
098:                node.setTransient();
099:                assertTrue("Node set to transient, not transient.", node
100:                        .isTransient());
101:            }
102:
103:            @Test
104:            public void testNative() {
105:                AccessNode node = new AccessNode(1);
106:                assertFalse("Node should default to not native.", node
107:                        .isNative());
108:                node.setNative();
109:                assertTrue("Node set to native, not native.", node.isNative());
110:            }
111:
112:            @Test
113:            public void testAbstract() {
114:                AccessNode node = new AccessNode(1);
115:                assertFalse("Node should default to not abstract.", node
116:                        .isAbstract());
117:                node.setAbstract();
118:                assertTrue("Node set to abstract, not abstract.", node
119:                        .isAbstract());
120:            }
121:
122:            @Test
123:            public void testStrict() {
124:                AccessNode node = new AccessNode(1);
125:                assertFalse("Node should default to not strict.", node
126:                        .isStrictfp());
127:                node.setStrictfp();
128:                assertTrue("Node set to strict, not strict.", node.isStrictfp());
129:            }
130:
131:            @Test
132:            public void testPackagePrivate() {
133:                AccessNode node = new AccessNode(1);
134:                assertTrue("Node should default to package private.", node
135:                        .isPackagePrivate());
136:                node.setPrivate();
137:                assertFalse("Node set to private, still package private.", node
138:                        .isPackagePrivate());
139:                node = new AccessNode(1);
140:                node.setPublic();
141:                assertFalse("Node set to public, still package private.", node
142:                        .isPackagePrivate());
143:                node = new AccessNode(1);
144:                node.setProtected();
145:                assertFalse("Node set to protected, still package private.",
146:                        node.isPackagePrivate());
147:            }
148:
149:            public static junit.framework.Test suite() {
150:                return new junit.framework.JUnit4TestAdapter(
151:                        AccessNodeTest.class);
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.