Source Code Cross Referenced for TestRewriterModule.java in  » Portal » Open-Portal » com » sun » portal » rewriter » test » 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 » Portal » Open Portal » com.sun.portal.rewriter.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:        package com.sun.portal.rewriter.test;
006:
007:        import com.sun.portal.rewriter.AbstractTranslator;
008:        import com.sun.portal.rewriter.RewriterModule;
009:        import com.sun.portal.rewriter.engines.js.parser.JSParser;
010:        import com.sun.portal.rewriter.engines.markup.MarkupRewriter;
011:        import com.sun.portal.rewriter.engines.xml.XMLRewriter;
012:        import com.sun.portal.rewriter.services.DataServiceHelper;
013:        import com.sun.portal.rewriter.test.util.BasicTestCase;
014:        import com.sun.portal.rewriter.util.ConfigManager;
015:        import com.sun.portal.rewriter.util.Constants;
016:        import com.sun.portal.rewriter.util.uri.StandardURI;
017:
018:        public class TestRewriterModule extends BasicTestCase {
019:            public TestRewriterModule(String aName) {
020:                super (aName);
021:            }//constructor
022:
023:            public void testConfigProps() {
024:                String text = "Rewriter Component Property '";
025:
026:                {
027:                    String moduleID = ConfigManager
028:                            .getProperty(Constants.PROPERTY_MODULE_ID);
029:                    assertTrue(
030:                            text
031:                                    + Constants.PROPERTY_MODULE_ID
032:                                    + "' should not be null"
033:                                    + ". Correct the property in file: "
034:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
035:                            moduleID.length() > 0);
036:                }
037:
038:                {
039:                    boolean commentBaseHREF = ConfigManager
040:                            .getBoolean(MarkupRewriter.PROPERTY_IS_COMMENT_BASE_HREF);
041:                    assertTrue(
042:                            text
043:                                    + MarkupRewriter.PROPERTY_IS_COMMENT_BASE_HREF
044:                                    + "' should be 'true' "
045:                                    + ". Correct the property in file: "
046:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
047:                            commentBaseHREF);
048:                }
049:
050:                {
051:                    boolean commentBodyBackground = ConfigManager
052:                            .getBoolean(MarkupRewriter.PROPERTY_IS_COMMENT_BODY_BACKGROUND);
053:                    assertTrue(
054:                            text
055:                                    + MarkupRewriter.PROPERTY_IS_COMMENT_BODY_BACKGROUND
056:                                    + " should be 'true'"
057:                                    + ". Correct the property in file: "
058:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
059:                            commentBodyBackground);
060:                }
061:
062:                {
063:                    boolean rewriteVarsInDHTML = ConfigManager
064:                            .getBoolean(JSParser.PROPERTY_IS_REWRITE_VARS_IN_DHTML);
065:                    assertTrue(
066:                            text
067:                                    + JSParser.PROPERTY_IS_REWRITE_VARS_IN_DHTML
068:                                    + " should be true "
069:                                    + ". Correct the property in file: "
070:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
071:                            rewriteVarsInDHTML);
072:                }
073:
074:                {
075:                    boolean rewriteXSL = ConfigManager
076:                            .getBoolean(XMLRewriter.PROPERTY_IS_REWRITE_XSL);
077:                    assertTrue(
078:                            text
079:                                    + XMLRewriter.PROPERTY_IS_REWRITE_XSL
080:                                    + "should be true"
081:                                    + ". Correct the property in file: "
082:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
083:                            rewriteXSL);
084:                }
085:
086:                {
087:                    boolean normalizeLikeBrowser = ConfigManager
088:                            .getBoolean(StandardURI.PROPERTY_IS_NORMALIZE_URI_LIKE_BROWSER);
089:                    assertTrue(
090:                            text
091:                                    + StandardURI.PROPERTY_IS_NORMALIZE_URI_LIKE_BROWSER
092:                                    + "' should be true"
093:                                    + ". Correct the property in file: "
094:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
095:                            normalizeLikeBrowser);
096:                }
097:
098:                {
099:                    boolean insertScriptReferrer = ConfigManager
100:                            .getBoolean(AbstractTranslator.PROPERTY_IS_ADD_SCRIPT_REFERRER);
101:                    assertTrue(
102:                            text
103:                                    + AbstractTranslator.PROPERTY_IS_ADD_SCRIPT_REFERRER
104:                                    + "' should be true"
105:                                    + ". Correct the property in file: "
106:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
107:                            insertScriptReferrer);
108:                }
109:
110:                {
111:                    boolean insertCodeBase = ConfigManager
112:                            .getBoolean(MarkupRewriter.PROPERTY_IS_INSERT_CODEBASE);
113:                    assertTrue(
114:                            text
115:                                    + MarkupRewriter.PROPERTY_IS_INSERT_CODEBASE
116:                                    + "' should be true"
117:                                    + ". Correct the property in file: "
118:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
119:                            insertCodeBase);
120:                }
121:
122:                {
123:                    String excludedFormTypes = ConfigManager.getProperty(
124:                            MarkupRewriter.PROPERTY_EXCLUDED_FORM_INPUT_TYPES)
125:                            .trim();
126:                    assertTrue(
127:                            text
128:                                    + MarkupRewriter.PROPERTY_EXCLUDED_FORM_INPUT_TYPES
129:                                    + "' should be true"
130:                                    + ". Correct the property in file: "
131:                                    + RewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION,
132:                            excludedFormTypes.length() > 0);
133:                }
134:            }//testConfigProps()
135:
136:            public static void main(String[] args) {
137:                RewriterModule.init(DataServiceHelper.getDefaultFileProps(),
138:                        null, null);
139:                BasicTestCase.run(TestRewriterModule.class);
140:            }//main()
141:
142:        }//class TestRewriterModule
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.