Source Code Cross Referenced for ClassScopeCheckTest.java in  » Code-Analyzer » Clirr » net » sf » clirr » core » internal » checks » 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 » Clirr » net.sf.clirr.core.internal.checks 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package net.sf.clirr.core.internal.checks;
02:
03:        import net.sf.clirr.core.internal.ClassChangeCheck;
04:        import net.sf.clirr.core.Severity;
05:        import net.sf.clirr.core.ClassSelector;
06:        import net.sf.clirr.core.ScopeSelector;
07:        import net.sf.clirr.core.ClassFilter;
08:        import net.sf.clirr.core.internal.checks.ClassScopeCheck;
09:        import net.sf.clirr.core.internal.checks.AbstractCheckTestCase;
10:        import net.sf.clirr.core.spi.Scope;
11:
12:        /**
13:         * Tests for the ClassScopeCheck test.
14:         *
15:         * @author Simon Kitching
16:         */
17:        public class ClassScopeCheckTest extends AbstractCheckTestCase {
18:            public void testAccessChangesAreReported() throws Exception {
19:                ExpectedDiff[] expected = new ExpectedDiff[] {
20:                        new ExpectedDiff(
21:                                "Decreased visibility of class from public to protected",
22:                                Severity.ERROR,
23:                                "testlib.scope.ClassScopeChange$A2", null, null),
24:                        new ExpectedDiff(
25:                                "Decreased visibility of class from public to package",
26:                                Severity.ERROR,
27:                                "testlib.scope.ClassScopeChange$A3", null, null),
28:                        new ExpectedDiff(
29:                                "Decreased visibility of class from public to private",
30:                                Severity.ERROR,
31:                                "testlib.scope.ClassScopeChange$A4", null, null),
32:
33:                        new ExpectedDiff(
34:                                "Increased visibility of class from protected to public",
35:                                Severity.INFO,
36:                                "testlib.scope.ClassScopeChange$B2", null, null),
37:                        new ExpectedDiff(
38:                                "Decreased visibility of class from protected to package",
39:                                Severity.ERROR,
40:                                "testlib.scope.ClassScopeChange$B3", null, null),
41:                        new ExpectedDiff(
42:                                "Decreased visibility of class from protected to private",
43:                                Severity.ERROR,
44:                                "testlib.scope.ClassScopeChange$B4", null, null),
45:
46:                        new ExpectedDiff(
47:                                "Increased visibility of class from package to public",
48:                                Severity.INFO,
49:                                "testlib.scope.ClassScopeChange$C2", null, null),
50:                        new ExpectedDiff(
51:                                "Increased visibility of class from package to protected",
52:                                Severity.INFO,
53:                                "testlib.scope.ClassScopeChange$C3", null, null),
54:                        // package->private is not an error, just an info, because we never report error for package or private diffs
55:                        new ExpectedDiff(
56:                                "Decreased visibility of class from package to private",
57:                                Severity.INFO,
58:                                "testlib.scope.ClassScopeChange$C4", null, null),
59:
60:                        new ExpectedDiff(
61:                                "Increased visibility of class from private to public",
62:                                Severity.INFO,
63:                                "testlib.scope.ClassScopeChange$D2", null, null),
64:                        new ExpectedDiff(
65:                                "Increased visibility of class from private to protected",
66:                                Severity.INFO,
67:                                "testlib.scope.ClassScopeChange$D3", null, null),
68:                        new ExpectedDiff(
69:                                "Increased visibility of class from private to package",
70:                                Severity.INFO,
71:                                "testlib.scope.ClassScopeChange$D4", null, null), };
72:                verify(expected);
73:            }
74:
75:            protected ClassChangeCheck createCheck(TestDiffListener tdl) {
76:                ScopeSelector scopeSelector = new ScopeSelector(Scope.PRIVATE);
77:                return new ClassScopeCheck(tdl, scopeSelector);
78:            }
79:
80:            protected ClassFilter createClassSelector() {
81:                // only check the testlib/scope/ClassScopeChange class.
82:                ClassSelector classSelector = new ClassSelector(
83:                        ClassSelector.MODE_IF);
84:                classSelector.addClass("testlib.scope.ClassScopeChange");
85:                return classSelector;
86:            }
87:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.