Source Code Cross Referenced for TestSRAPTranslator.java in  » Portal » Open-Portal » com » sun » portal » rproxy » 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.rproxy.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.rproxy.rewriter.test;
006:
007:        import com.sun.portal.rewriter.Rewriter;
008:        import com.sun.portal.log.common.PortalLogger;
009:        import com.sun.portal.rewriter.RewriterPool;
010:        import com.sun.portal.rewriter.Translator;
011:        import com.sun.portal.rewriter.engines.LanguageConstants;
012:        import com.sun.portal.rewriter.rom.RuleSet;
013:        import com.sun.portal.rewriter.test.util.BasicTestCase;
014:        import com.sun.portal.rewriter.test.util.CreateRuleSet;
015:        import com.sun.portal.rproxy.rewriter.SRAPRewriterModule;
016:        import com.sun.portal.rproxy.rewriter.SRAPTranslator;
017:        import com.sun.portal.rproxy.rewriter.test.util.SRAPTestSystemFactory;
018:        import junit.framework.TestSuite;
019:        import junitx.util.PrivateAccessor;
020:
021:        public class TestSRAPTranslator extends BasicTestCase {
022:            public TestSRAPTranslator(String aName) {
023:                super (aName);
024:            }//constructor
025:
026:            public void testSRAPTranslateHTTPURL() throws Exception {
027:                String[][] lData = {
028:                        {
029:                                "/mail/mstm.nsf/iNotes/Proxy/?OpenDocument&Form=s_ReadViewEntries&PresetFields=FolderName;%28%24Inbox%29,s_UsingHttps;1&Start=1&Count=40",
030:                                "https://zeus.nawab.inda.com/http://raja.sun.com/mail/mstm.nsf/iNotes/Proxy/?OpenDocument&Form=s_ReadViewEntries&PresetFields=FolderName;%28%24Inbox%29,s_UsingHttps;1&Start=1&Count=40", },
031:
032:                        {
033:                                "/command.shtml?view=overview&id=bu95rq3r35uq62n2o2p&crc=/()'-/*(+/&group=Keine+Kalendergruppe&date=",
034:                                "https://zeus.nawab.inda.com/http://raja.sun.com/command.shtml?view=overview&id=bu95rq3r35uq62n2o2p&crc=/()'-/*(+/&group=Keine+Kalendergruppe&date=" },
035:
036:                        {
037:                                "command.shtml?view=overview&id=bu95rq3r35uq62n2o2p&crc=/()'-/*(+/&group=Keine+Kalendergruppe&date=",
038:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/command.shtml?view=overview&id=bu95rq3r35uq62n2o2p&crc=/()'-/*(+/&group=Keine+Kalendergruppe&date=" },
039:
040:                        {
041:                                "http://user1:buckweat@home1.poly.carbon.com/nls",
042:                                "https://zeus.nawab.inda.com/http://user1:buckweat@home1.poly.carbon.com/nls", },
043:
044:                        {
045:                                "./?Cmd=navbar",
046:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/?Cmd=navbar", },
047:
048:                        { "/abc/xuz?",
049:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc/xuz?" },
050:                        { "/ips-static/images/spacer.gif&",
051:                                "https://zeus.nawab.inda.com/http://raja.sun.com/ips-static/images/spacer.gif&" },
052:                        {
053:                                "/ips-static/images/spacer.gif?&abc=10",
054:                                "https://zeus.nawab.inda.com/http://raja.sun.com/ips-static/images/spacer.gif?&abc=10" },
055:                        {
056:                                "/ips-static/images/spacer.gif?&abc",
057:                                "https://zeus.nawab.inda.com/http://raja.sun.com/ips-static/images/spacer.gif?&abc" },
058:                        {
059:                                "/amconsole/base/AMAdminFrame?okmIuDwRL6W5se5rmCbn5hf2jSei7NGUfZO9iAB7tzdb2unPjkHTO2qUelbAcorsIu3fsC7IqtvECNy9",
060:                                "https://zeus.nawab.inda.com/http://raja.sun.com/amconsole/base/AMAdminFrame?okmIuDwRL6W5se5rmCbn5hf2jSei7NGUfZO9iAB7tzdb2unPjkHTO2qUelbAcorsIu3fsC7IqtvECNy9" },
061:
062:                        { "raja1.html?abc",
063:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/raja1.html?abc" },
064:                        { "../raja.html?10",
065:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/raja.html?10" },
066:                        { "raja2.html?true",
067:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/raja2.html?true" },
068:                        { "raja0.html?-12",
069:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/raja0.html?-12" },
070:
071:                        { "#", "#" }, //BugNo:4790402
072:                        { "'#'	", "'#'	" },
073:                        { "	#	", "	#	" },
074:                        {
075:                                "	#test	",
076:                                "	https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index.html?abc=10&ee=90#test	" },
077:                        {
078:                                "	'#test	",
079:                                "	'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index.html?abc=10&ee=90#test	" },
080:                        {
081:                                "	#test'	",
082:                                "	https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index.html?abc=10&ee=90#test'	" },
083:                        { "	?abc=10#test	",
084:                                "	https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/?abc=10#test	" },
085:                        { "?", "?" },
086:                        { "'?'	", "'?'	" },
087:                        { "	?	", "	?	" },
088:                        { "	?test	",
089:                                "	https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/?test	" },
090:
091:                        { "''", "''" },
092:                        { "''", "''" },
093:                        {
094:                                "''\"'''/portal/document1.pdf'''	''",
095:                                "'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/'\"'''/portal/document1.pdf'''\t''" }, //FixMe: Would get corrected when regEx is implemented
096:                        {
097:                                "''	/portal/document1.pdf	''",
098:                                "''	https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf	''" },
099:                        {
100:                                "''/portal/document1.pdf''",
101:                                "''https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf''" },
102:                        {
103:                                "'	'/portal/document1.pdf'	'",
104:                                "'	'https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf'	'" },
105:                        {
106:                                "'/portal/document1.pdf'",
107:                                "'https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf'" },
108:                        {
109:                                "''/portal/document1.pdf''",
110:                                "''https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf''" },
111:                        {
112:                                ""/portal/document1.pdf"",
113:                                ""https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf"" },
114:                        {
115:                                ""/portal/document1.pdf"",
116:                                ""https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf"" },
117:                        {
118:                                "''"/portal/document1.pdf''",
119:                                "''"https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf''" },
120:                        {
121:                                "''/portal/document1.pdf'"'",
122:                                "''https://zeus.nawab.inda.com/http://raja.sun.com/portal/document1.pdf'"'" },
123:
124:                        { "https://zeus.nawab.inda.com:443",
125:                                "https://zeus.nawab.inda.com" }, //66
126:                        {
127:                                "/console/actions/mbean/MBeanFramesetAction?isNew=false&sidebarFrameId=wl_console_frame_1035263303090&frameId=wl_console_frame_1035263303091&MBean=portaldomain%3AName%3Dportaldomain%2CType%3DDomain&bodyFrameId=wl_console_frame_1035263303092",
128:                                "https://zeus.nawab.inda.com/http://raja.sun.com/console/actions/mbean/MBeanFramesetAction?isNew=false&sidebarFrameId=wl_console_frame_1035263303090&frameId=wl_console_frame_1035263303091&MBean=portaldomain%3AName%3Dportaldomain%2CType%3DDomain&bodyFrameId=wl_console_frame_1035263303092", },
129:                        {
130:                                "/command.shtml?view=new_cal&id=ebm0q3u6y92m2nv9&crc=3002401687&date=20021005T013040&newCalCalID=tuser&tzid=&e_ACL=@@o^c^WDEIC^g;@@o^a^RSF^g;@^a^sf^g;@^c^^g;@^p^r^g&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1",
131:                                "https://zeus.nawab.inda.com/http://raja.sun.com/command.shtml?view=new_cal&id=ebm0q3u6y92m2nv9&crc=3002401687&date=20021005T013040&newCalCalID=tuser&tzid=&e_ACL=@@o^c^WDEIC^g;@@o^a^RSF^g;@^a^sf^g;@^c^^g;@^p^r^g&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1" },
132:                        {
133:                                "/command.shtml?view=new_cal&id=ebm0q3u6y92m2nv9&crc=3002401687&date=20021005T013040&newCalCalID=tuser&tzid=&e_ACL=@@o^c^WDEIC^g;@@o^a^RSF^g;@^a^sf^g;@^c^^g;@^p^r^g&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1",
134:                                "https://zeus.nawab.inda.com/http://raja.sun.com/command.shtml?view=new_cal&id=ebm0q3u6y92m2nv9&crc=3002401687&date=20021005T013040&newCalCalID=tuser&tzid=&e_ACL=@@o^c^WDEIC^g;@@o^a^RSF^g;@^a^sf^g;@^c^^g;@^p^r^g&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1", },
135:                        { "/",
136:                                "https://zeus.nawab.inda.com/http://raja.sun.com/" },
137:                        { "file:///c:/ghkim/love.txt",
138:                                "file:///c:/ghkim/love.txt" },
139:                        {
140:                                "./EP_SgPgLayView.jsp?pgid=|1E2652&titfont=white",
141:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/EP_SgPgLayView.jsp?pgid=|1E2652&titfont=white" },
142:                        {
143:                                "#default#homepage",
144:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index.html?abc=10&ee=90#default#homepage" },
145:
146:                        {
147:                                "/first.shtml?view=new_cal&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&newCalCalID=tuser&tzid=&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1",
148:                                "https://zeus.nawab.inda.com/http://raja.sun.com/first.shtml?view=new_cal&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&newCalCalID=tuser&tzid=&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1" },
149:
150:                        {
151:                                "http://serverm.stonerunner.red.iplanet.com:80/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com",
152:                                "https://zeus.nawab.inda.com/http://serverm.stonerunner.red.iplanet.com/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com" },
153:                        {
154:                                "serverm.stonerunner.red.iplanet.com/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com",
155:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/serverm.stonerunner.red.iplanet.com/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com" },
156:                        {
157:                                "serverm.stonerunner.red.iplanet.com:80/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com",
158:                                "serverm.stonerunner.red.iplanet.com:80/amserver/login?gw=gatev.red.iplanet.com&org=red.iplanet.com" },
159:
160:                        { "http://ichart.yahoo.com/t?s=^IXIC",
161:                                "https://zeus.nawab.inda.com/http://ichart.yahoo.com/t?s=^IXIC" },
162:                        { "https://rajanagendra.sun.com:443   ",
163:                                "https://zeus.nawab.inda.com/https://rajanagendra.sun.com   " },
164:                        { "   https://rajanagendra.sun.com:443",
165:                                "   https://zeus.nawab.inda.com/https://rajanagendra.sun.com" },
166:                        { "   https://rajanagendra.sun.com:443   ",
167:                                "   https://zeus.nawab.inda.com/https://rajanagendra.sun.com   " },
168:
169:                        { "", "" }, //135
170:                        { "''", "''" }, //135
171:                        { "\"\"", "\"\"" }, //135
172:
173:                        { "/abc.com",
174:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc.com" },
175:                        { "   /abc.com   ",
176:                                "   https://zeus.nawab.inda.com/http://raja.sun.com/abc.com   " },
177:                        { " \t\t   /abc.com   ",
178:                                " \t\t   https://zeus.nawab.inda.com/http://raja.sun.com/abc.com   " },
179:                        { "  \r/abc.com   ",
180:                                "  \rhttps://zeus.nawab.inda.com/http://raja.sun.com/abc.com   " },
181:                        { "  \n/abc.com   ",
182:                                "  \nhttps://zeus.nawab.inda.com/http://raja.sun.com/abc.com   " },
183:
184:                        {
185:                                "/abc.com?url=http://pserv6.sun.com/exchange/index.html",
186:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
187:                        {
188:                                "abc.com?url=http://pserv6.sun.com/exchange/index.html",
189:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
190:                        {
191:                                "abc.comurl=http://pserv6.sun.com/exchange/index.html",
192:                                "abc.comurl=http://pserv6.sun.com/exchange/index.html" },
193:
194:                        {
195:                                "/http://pserv6.sun.com/exchange/index.html",
196:                                "https://zeus.nawab.inda.com/http://raja.sun.com/http://pserv6.sun.com/exchange/index.html" },
197:                        {
198:                                "   /abc.com?url=http://pserv6.sun.com/exchange/index.html",
199:                                "   https://zeus.nawab.inda.com/http://raja.sun.com/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
200:                        {
201:                                "\t\t/abc.com?url=http://pserv6.sun.com/exchange/index.html",
202:                                "\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
203:
204:                        { "/abc.com",
205:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc.com" },
206:                        { "   /abc.com   ",
207:                                "   https://zeus.nawab.inda.com/http://raja.sun.com/abc.com   " },
208:                        {
209:                                "\t\t/abc.com?url=http://pserv6.sun.com/exchange/index.html",
210:                                "\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
211:                        {
212:                                "   /abc.com?url=http://pserv6.sun.com/exchange/index.html",
213:                                "   https://zeus.nawab.inda.com/http://raja.sun.com/abc.com?url=http://pserv6.sun.com/exchange/index.html" },
214:
215:                        { "\"/index.html\"",
216:                                "\"https://zeus.nawab.inda.com/http://raja.sun.com/index.html\"" }, //29
217:                        { "'null'",
218:                                "'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/null'" }, //31 - Bug4627258
219:                        { "'''\t\t/index.html'''",
220:                                "'''\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html'''" }, //30
221:                        { "'\t\t'\t'/index.html'''",
222:                                "'\t\t'\t'https://zeus.nawab.inda.com/http://raja.sun.com/index.html'''" }, //30
223:                        { "'\t'\t'\t/index.html'''",
224:                                "'\t'\t'\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html'''" }, //30
225:                        {
226:                                "\t\"\t\"\t\"\t/index1.html\"\"\"",
227:                                "\t\"\t\"\t\"\thttps://zeus.nawab.inda.com/http://raja.sun.com/index1.html\"\"\"" }, //9
228:                        {
229:                                "\"  \"  \" \t  /index.html\"\"\"",
230:                                "\"  \"  \" \t  https://zeus.nawab.inda.com/http://raja.sun.com/index.html\"\"\"" }, //30
231:                        {
232:                                "\"\t\t\"\t\t\t\"\t\t\t\t/index.html\"\"\"",
233:                                "\"\t\t\"\t\t\t\"\t\t\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html\"\"\"" }, //30
234:                        { "'''\t\t/index.html\t'\t'\t'",
235:                                "'''\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html\t'\t'\t'" }, //12
236:                        {
237:                                "'\t\t'\t'/index.html\t'\t\t''\t\t",
238:                                "'\t\t'\t'https://zeus.nawab.inda.com/http://raja.sun.com/index.html\t'\t\t''\t\t" }, //13
239:                        {
240:                                "'\t'\t'\t/index.html\t'\t'\t'\t",
241:                                "'\t'\t'\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html\t'\t'\t'\t" }, //14
242:                        {
243:                                "\t\"\t\"\t\"\t/index.html\t   \"  \t  \"\t  \"",
244:                                "\t\"\t\"\t\"\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html\t   \"  \t  \"\t  \"" }, //30
245:                        {
246:                                "\"  \"  \" \t  /index.html  \t  \"   \"    \"  ",
247:                                "\"  \"  \" \t  https://zeus.nawab.inda.com/http://raja.sun.com/index.html  \t  \"   \"    \"  " }, //30
248:                        {
249:                                "\"\t\t\"\t\t\"\t\t\t\t/index.html \"  \"  \"  ",
250:                                "\"\t\t\"\t\t\"\t\t\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html \"  \"  \"  " }, //30
251:                        {
252:                                "\"\t\t\"\t\t\"\t\t\t\thttp://raja.sun.com/index.html \"  \"  \"",
253:                                "\"\t\t\"\t\t\"\t\t\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html \"  \"  \"" }, //30
254:                        {
255:                                "\"\t\t\"\t\t\"\t\t\t\thttp://raja.sun.com:80/index.html \"  \"  \"",
256:                                "\"\t\t\"\t\t\"\t\t\t\thttps://zeus.nawab.inda.com/http://raja.sun.com/index.html \"  \"  \"" }, //30
257:                        {
258:                                "\"\t\t\"\t\t\"\t\t\t\thttps://raja.sun.com:80/index.html \"  \"  \"",
259:                                "\"\t\t\"\t\t\"\t\t\t\thttps://zeus.nawab.inda.com/https://raja.sun.com:80/index.html \"  \"  \"" }, //30
260:
261:                        { "\\\"/14c.html\\\"",
262:                                "\\\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\"" }, //0
263:                        { "\\\'/14c.html\\\'",
264:                                "\\\'https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\'" }, //1
265:                        { "\\'./14c.html\\'",
266:                                "\\'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html\\'" }, //2
267:                        { "\"\\\'./14c.html\\'",
268:                                "\"\\\'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html\\'" }, //3
269:                        { "\"/14c.html\"",
270:                                "\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\"" }, //4
271:                        { "'../14c.html'",
272:                                "'https://zeus.nawab.inda.com/http://raja.sun.com/Base/14c.html'" }, //5
273:                        { "'\"/14c.html\"'",
274:                                "'\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\"'" }, //6
275:                        { "'\\\"/14c.html\\\"'",
276:                                "'\\\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\"'" }, //7
277:
278:                        { "/14c.html\\\"",
279:                                "https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\"" }, //0
280:                        { "/14c.html\\\'",
281:                                "https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\'" }, //1
282:                        { "./14c.html\\'",
283:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html\\'" }, //2
284:                        { "./14c.html\\'",
285:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html\\'" }, //3
286:                        { "/14c.html\"",
287:                                "https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\"" }, //4
288:                        { "../14c.html'",
289:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/14c.html'" }, //5
290:                        { "/14c.html\"'",
291:                                "https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\"'" }, //6
292:                        { "/14c.html\\\"'",
293:                                "https://zeus.nawab.inda.com/http://raja.sun.com/14c.html\\\"'" }, //7
294:
295:                        { "\\\"/14c.html",
296:                                "\\\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html" }, //0
297:                        { "\\\'/14c.html",
298:                                "\\\'https://zeus.nawab.inda.com/http://raja.sun.com/14c.html" }, //1
299:                        { "\\'./14c.html",
300:                                "\\'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html" }, //2
301:                        { "\"\\\'./14c.html",
302:                                "\"\\\'https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/14c.html" }, //3
303:                        { "\"/14c.html",
304:                                "\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html" }, //4
305:                        { "'../14c.html",
306:                                "'https://zeus.nawab.inda.com/http://raja.sun.com/Base/14c.html" }, //5
307:                        { "'\"/14c.html",
308:                                "'\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html" }, //6
309:                        { "'\\\"/14c.html",
310:                                "'\\\"https://zeus.nawab.inda.com/http://raja.sun.com/14c.html" }, //7
311:
312:                        { "http://user:password@abc.com",
313:                                "https://zeus.nawab.inda.com/http://user:password@abc.com" },
314:                        { "https://zeus.nawab.inda.com:443/index.html",
315:                                "https://zeus.nawab.inda.com/index.html" }, //65
316:
317:                        {
318:                                "http://rd.yahoo.com/M=229013.2155294.3604906.2095271/D=yahoo_top/S=2716149:TAM/A=1131291/R=10/id=cap_img1/*http://shop.store.yahoo.com/cgi-bin/clink?travelocity2+shopping:dmhp+http://us.rmi.yahoo.com/rmi/http://www.travelocity.com/rmi-framed-url/http://svc.travelocity.com/promos/main_promo/0%2C%2CTRAVELOCITY%257CPR_4JUL02%2C00.htm",
319:                                "https://zeus.nawab.inda.com/http://rd.yahoo.com/M=229013.2155294.3604906.2095271/D=yahoo_top/S=2716149:TAM/A=1131291/R=10/id=cap_img1/*http://shop.store.yahoo.com/cgi-bin/clink?travelocity2+shopping:dmhp+http://us.rmi.yahoo.com/rmi/http://www.travelocity.com/rmi-framed-url/http://svc.travelocity.com/promos/main_promo/0%2C%2CTRAVELOCITY%257CPR_4JUL02%2C00.htm" },
320:                        { "http://rd.yahoo.com/M=test",
321:                                "https://zeus.nawab.inda.com/http://rd.yahoo.com/M=test" },
322:                        {
323:                                "http://rd.yahoo.com/M=211145.2045633.3515306.436525/D=yahoo_top/S=2716149:NE/A=1066130/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?ftd2+shopping:dmad/M=211145.2045633.3515306.436525/D=yahoo_top/S=2716149:NE/A=1066130/R=1/1020770417+http://us.rmi.yahoo.com/rmi/http://www.ftd.com/rmi-framed-url/http://www.ftd.com/4737/",
324:                                "https://zeus.nawab.inda.com/http://rd.yahoo.com/M=211145.2045633.3515306.436525/D=yahoo_top/S=2716149:NE/A=1066130/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?ftd2+shopping:dmad/M=211145.2045633.3515306.436525/D=yahoo_top/S=2716149:NE/A=1066130/R=1/1020770417+http://us.rmi.yahoo.com/rmi/http://www.ftd.com/rmi-framed-url/http://www.ftd.com/4737/" },
325:                        { "HTTP:///../raha.html",
326:                                "https://zeus.nawab.inda.com/HTTP:///raha.html" }, //29
327:                        { "http:///../raha.html",
328:                                "https://zeus.nawab.inda.com/http:///raha.html" }, //30
329:                        { "file://C:/temp/x.html", "file://C:/temp/x.html" },
330:                        { "image\\raj.html",
331:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/image\\raj.html" },
332:                        { "\raj.html",
333:                                "\rhttps://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/aj.html" },
334:                        { "\\raj.html",
335:                                "https://zeus.nawab.inda.com/http://raja.sun.com/raj.html" },
336:                        { "http://abc.com\\xyz/raj.html",
337:                                "https://zeus.nawab.inda.com/http://abc.com\\xyz/raj.html" },
338:                        { "http:\\\\abc.com\\xyz", "http:\\\\abc.com\\xyz" },
339:                        { "tn3270://localhost:30001",
340:                                "tn3270://localhost:30001" }, //Bug No: 4626345
341:                        { "tn3270://avc.com:30001/", "tn3270://avc.com:30001/" },
342:                        { "tn3270://avc.com/", "tn3270://avc.com/" },
343:                        { "tn3270://avc.com/INDEX.HTML",
344:                                "tn3270://avc.com/INDEX.HTML" },
345:
346:                        { "http://127.0.0.1/raha.html",
347:                                "http://127.0.0.1/raha.html" }, //0
348:                        { "hTTp://127.0.0.1/raha.html",
349:                                "hTTp://127.0.0.1/raha.html" }, //1
350:                        { "hTTp://127.0.0.1/", "hTTp://127.0.0.1/" }, //2
351:                        { "hTTp://127.0.0.1", "hTTp://127.0.0.1" }, //3
352:                        { "FTP://127.0.0.1", "FTP://127.0.0.1" }, //4
353:
354:                        { "http://localhost/raha.html",
355:                                "http://localhost/raha.html" }, //5
356:                        { "hTTp://LOCALHOST/raha.html",
357:                                "hTTp://LOCALHOST/raha.html" }, //6
358:                        { "hTTp://lOcALhost/", "hTTp://lOcALhost/" }, //7
359:                        { "hTTp://localhost", "hTTp://localhost" }, //8
360:                        { "FTP://localHOST", "FTP://localHOST" }, //9
361:
362:                        { "https://127.0.0.1/raha.html",
363:                                "https://127.0.0.1/raha.html" }, //10
364:                        { "hTTps://127.0.0.1/raha.html",
365:                                "hTTps://127.0.0.1/raha.html" }, //11
366:                        { "hTTps://127.0.0.1/", "hTTps://127.0.0.1/" }, //12
367:                        { "hTTps://127.0.0.1", "hTTps://127.0.0.1" }, //13
368:
369:                        { "hTTps://LOCALHOST/raha.html",
370:                                "hTTps://LOCALHOST/raha.html" }, //14
371:                        { "hTTps://lOcALhost/", "hTTps://lOcALhost/" }, //15
372:                        { "hTTps://localhost", "hTTps://localhost" }, //16
373:
374:                        { "hTTp:../raha.html", "hTTp:../raha.html" }, //17
375:                        { "HttP:/raha.html", "HttP:/raha.html" }, //18
376:                        { "HtTp:/../raha.html", "HtTp:/../raha.html" }, //19
377:
378:                        { "http:../raha.html", "http:../raha.html" }, //20
379:                        { "http:/raha.html", "http:/raha.html" }, //21
380:                        { "http:/../raha.html", "http:/../raha.html" }, //22
381:                        {
382:                                "iPlanet Directory Server Access Management Edition_files/AMHeader",
383:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/iPlanet Directory Server Access Management Edition_files/AMHeader" }, //23
384:
385:                        { "''\"'\"'''     \"'\"'   ",
386:                                "''\"'\"'''     \"'\"'   " }, //24
387:                        { " ", " " }, //25
388:                        { "", "" }, //26
389:                        { "user:password@./index.html",
390:                                "user:password@./index.html" }, //27
391:                        { "user:password@http://sun.com/index.html",
392:                                "user:password@http://sun.com/index.html" }, //28
393:
394:                        {
395:                                "iPlanet%20Directory%20Server%20%20Access%20Management%20Edition_files/AMHeader",
396:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/iPlanet%20Directory%20Server%20%20Access%20Management%20Edition_files/AMHeader" }, //23
397:                        {
398:                                "Image/icon.jpg?ab\\e=eess",
399:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/Image/icon.jpg?ab\\e=eess" },
400:                        { "Image\\icon.jpg",
401:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/Image\\icon.jpg" },
402:                        { "Image\\\\icon.jpg",
403:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/Image\\\\icon.jpg" },
404:
405:                        { "../raha.html",
406:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/raha.html" }, //31
407:                        { "./raha.html",
408:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/raha.html" }, //32
409:                        { "abc.html",
410:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/abc.html" }, //33
411:                        { "http://www.sun.com:80/abc.html",
412:                                "https://zeus.nawab.inda.com/http://www.sun.com/abc.html" }, //34
413:                        { "index.",
414:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index." }, //35 - Bug 4658040
415:                        { "../../index.",
416:                                "https://zeus.nawab.inda.com/http://raja.sun.com/index." }, //36 - Bug 4658040
417:                        { "../",
418:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/" }, //37
419:                        { "../../",
420:                                "https://zeus.nawab.inda.com/http://raja.sun.com/" }, //38
421:                        { "././",
422:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/" }, //39
423:                        { "..",
424:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/" }, //40
425:                        { "../..",
426:                                "https://zeus.nawab.inda.com/http://raja.sun.com/" }, //41
427:                        { "./.",
428:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/" }, //42
429:                        { "http://user:password@sun.com/index.html",
430:                                "https://zeus.nawab.inda.com/http://user:password@sun.com/index.html" }, //44 - Bug No: 4502014
431:                        { "../../img/background.jpg",
432:                                "https://zeus.nawab.inda.com/http://raja.sun.com/img/background.jpg" }, //45
433:                        { "http://www.sun.com/abc.html",
434:                                "https://zeus.nawab.inda.com/http://www.sun.com/abc.html" }, //46
435:                        { "https://www.sun.com/sh.html",
436:                                "https://zeus.nawab.inda.com/https://www.sun.com/sh.html" }, //47
437:                        { "https://www.sun.com:78/sh.html",
438:                                "https://zeus.nawab.inda.com/https://www.sun.com:78/sh.html" }, //48
439:                        { "htTp://www.sun.com:400/sh.html",
440:                                "https://zeus.nawab.inda.com/htTp://www.sun.com:400/sh.html" }, //49
441:                        { "./abc.html",
442:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/abc.html" }, //50
443:                        { "/abc.html",
444:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc.html" }, //51
445:                        { "../../abc.html",
446:                                "https://zeus.nawab.inda.com/http://raja.sun.com/abc.html" }, //52
447:                        { "../abc.html",
448:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/abc.html" }, //53
449:                        { "../abc.html?turn=true",
450:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/abc.html?turn=true" }, //54
451:                        { "./abc.html?turn=true",
452:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/abc.html?turn=true" }, //55
453:                        { "htTp://www.sun.com:400/sh.html?roja=ramani",
454:                                "https://zeus.nawab.inda.com/htTp://www.sun.com:400/sh.html?roja=ramani" }, //56
455:                        { "./././././abc.html",
456:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/abc.html" }, //57
457:                        { "null",
458:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/null" }, //58 - Bug4627258
459:                        { "../../../../functions/javascript.js",
460:                                "https://zeus.nawab.inda.com/http://raja.sun.com/functions/javascript.js" }, //59
461:                        { "./raja/mahesh/.././abc.html",
462:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/raja/abc.html" }, //60
463:                        { "\"/index.html\"",
464:                                "\"https://zeus.nawab.inda.com/http://raja.sun.com/index.html\"" }, //61
465:                        { "https://zeus.nawab.inda.com:839/index.html",
466:                                "https://zeus.nawab.inda.com/https://zeus.nawab.inda.com:839/index.html" }, //62
467:                        { "hTTps://localhost.sun.com",
468:                                "https://zeus.nawab.inda.com/hTTps://localhost.sun.com" }, //63
469:                        { "https://zeus.nawab.inda.com",
470:                                "https://zeus.nawab.inda.com" }, //64
471:                        { "https://zeus.nawab.inda.com/index.html",
472:                                "https://zeus.nawab.inda.com/index.html" }, //64
473:                        {
474:                                "#raj.index",
475:                                "https://zeus.nawab.inda.com/http://raja.sun.com/Base/Raja/index.html?abc=10&ee=90#raj.index" }, //43 BugNo: 4710380
476:                        { "file:/tmp/x.html", "file:/tmp/x.html" },
477:                //{"/file.shtml?view=new_cal&id=lakjsdfla&date=99", "http://raja.sun.com/file.shtml?view=new_cal&id=lakjsdfla&date=99"}, //18
478:                //{"http://host.com/file.shtml?view=new_cal&id=lakjsdfla&date=99", "http://host.com/file.shtml?view=new_cal&id=lakjsdfla&date=99"}, //17
479:                };
480:
481:                Translator srapTranslator = SRAPTestSystemFactory
482:                        .createSRAPTranslator();
483:
484:                for (int i = 0; i < lData.length; i++) {
485:                    String result = srapTranslator.translate(lData[i][0]);
486:                    assertEquals("Failed at i=" + i + ":" + " Value:"
487:                            + lData[i][0], lData[i][1], result);
488:                }//for loop
489:            }//testSRAPTranslateHTTPURL()
490:
491:            public void testBug4659553() throws Exception {
492:                String lInput = "<HTML>\n"
493:                        + "  <HEAD>\n"
494:                        + "  <TITLE>Problem with protocol rewrite: HTTP or Http </TITLE>\n"
495:                        + "  </HEAD>\n"
496:                        + " <BODY>\n"
497:                        + "   <p>No Problem with http: <a href=\"http://pluto.italy\">http</a> </p>\n"
498:                        + "   <p>Problem with Http: <a href=\"Http://pluto.italy\">Http</a> </p>\n"
499:                        + "   <p>Problem with HTTP: <a href=\"HTTP://pluto.italy\">HTTP</a> </p>\n"
500:                        + "  </BODY>\n" + "</HTML>\n" + "\n";
501:
502:                String lExpectation = "<HTML>\n"
503:                        + "  <HEAD>\n"
504:                        + "  <TITLE>Problem with protocol rewrite: HTTP or Http </TITLE>\n"
505:                        + "  </HEAD>\n"
506:                        + " <BODY>\n"
507:                        + "   <p>No Problem with http: <a href=\"https://zeus.nawab.inda.com/http://pluto.italy\">http</a> </p>\n"
508:                        + "   <p>Problem with Http: <a href=\"https://zeus.nawab.inda.com/Http://pluto.italy\">Http</a> </p>\n"
509:                        + "   <p>Problem with HTTP: <a href=\"https://zeus.nawab.inda.com/HTTP://pluto.italy\">HTTP</a> </p>\n"
510:                        + "  </BODY>\n" + "</HTML>\n" + "\n";
511:
512:                Translator srapTranslator = SRAPTestSystemFactory
513:                        .createSRAPTranslator();
514:                String lAttributeRules = "<Attribute name=\"href\" />";
515:
516:                RuleSet lRuleSet = CreateRuleSet
517:                        .withHTMLAttributeRules(lAttributeRules);
518:                Rewriter lRewriter = RewriterPool.create(lRuleSet,
519:                        LanguageConstants.HTML_MIME);
520:                String lResult = lRewriter.rewrite(lInput, srapTranslator);
521:                assertEquals(lExpectation, lResult);
522:            }//testBug4659553()
523:
524:            public void testFTPBase() throws Exception {
525:                //2nd param is not used as all ftp are not rewriten..
526:                String[][] lData = {
527:                        { "    ../../../../functions/javascript.js",
528:                                "ftp://raja.sun.com/Base/Raja/../../../../functions/javascript.js" }, //13
529:                        { "index.", "ftp://raja.sun.com/Base/Raja/index." }, //0
530:                        { "../../index.",
531:                                "ftp://raja.sun.com/Base/Raja/../../index." }, //1
532:                        { "../", "ftp://raja.sun.com/Base/Raja/../" }, //2
533:                        { "../../", "ftp://raja.sun.com/Base/Raja/../../" }, //3
534:                        { "././", "ftp://raja.sun.com/Base/Raja/././" }, //4
535:                        { "..", "ftp://raja.sun.com/Base/Raja/.." }, //5
536:                        { "../..", "ftp://raja.sun.com/Base/Raja/../.." }, //6
537:                        { "./.", "ftp://raja.sun.com/Base/Raja/./." }, //7
538:                        { "/", "ftp://raja.sun.com/" }, //8
539:                        { "#raj.index", "#raj.index" }, //9
540:                        { " ", " " }, //10
541:                        { "", "" }, //11
542:                        { "   ", "   " }, //12
543:                        { "../../../../functions/javascript.js",
544:                                "ftp://raja.sun.com/Base/Raja/../../../../functions/javascript.js" }, //13
545:                        { "../../img/background.jpg",
546:                                "ftp://raja.sun.com/Base/Raja/../../img/background.jpg" }, //14
547:                        { "ftp://www.sun.com/abc.html",
548:                                "ftp://www.sun.com/abc.html" }, //15
549:                        { "ftp://www.sun.com/sh.html",
550:                                "ftp://www.sun.com/sh.html" }, //16
551:                        { "ftp://www.sun.com:78/sh.html",
552:                                "ftp://www.sun.com:78/sh.html" }, //17
553:                        { "ftp://www.sun.com:400/sh.html",
554:                                "ftp://www.sun.com:400/sh.html" }, //18
555:                        { "abc.html", "ftp://raja.sun.com/Base/Raja/abc.html" }, //19
556:                        { "./abc.html",
557:                                "ftp://raja.sun.com/Base/Raja/./abc.html" }, //20
558:                        { "/abc.html", "ftp://raja.sun.com/abc.html" }, //21
559:                        { "../../abc.html",
560:                                "ftp://raja.sun.com/Base/Raja/../../abc.html" }, //22
561:                        { "../abc.html",
562:                                "ftp://raja.sun.com/Base/Raja/../abc.html" }, //23
563:                        { "../abc.html?turn=true",
564:                                "ftp://raja.sun.com/Base/Raja/../abc.html?turn=true" }, //24
565:                        { "./abc.html?turn=true",
566:                                "ftp://raja.sun.com/Base/Raja/./abc.html?turn=true" }, //25
567:                        { "ftp://www.sun.com:400/sh.html?roja=ramani",
568:                                "ftp://www.sun.com:400/sh.html?roja=ramani" }, //26
569:                        { "./././././abc.html",
570:                                "ftp://raja.sun.com/Base/Raja/./././././abc.html" }, //27
571:                        { "./raja/mahesh/.././abc.html",
572:                                "ftp://raja.sun.com/Base/Raja/./raja/mahesh/.././abc.html" }, //28
573:                        { "null", "ftp://raja.sun.com/Base/Raja/null" }, //30 - Bug4627258
574:                        { "user:password@./index.html",
575:                                "user:password@./index.html" }, //33
576:                        { "user:password@ftp://sun.com/index.html",
577:                                "user:password@ftp://sun.com/index.html" }, //34
578:                        {
579:                                "ftp://zeus.nawab.inda.com/ftp://www.sun.com/abc.html",
580:                                "ftp://zeus.nawab.inda.com/ftp://www.sun.com/abc.html" }, //35
581:                        { "ftp://127.0.0.1", "ftp://127.0.0.1" }, //37
582:                        { "ftp://127.0.0.1", "ftp://127.0.0.1" }, //38
583:                        { "ftp://localhost", "ftp://localhost" }, //39
584:                        { "ftp://localhost", "ftp://localhost" }, //40
585:                        { "ftp://127.0.0.1", "ftp://127.0.0.1" }, //41
586:                        { "ftp://127.0.0.1", "ftp://127.0.0.1" }, //42
587:                        { "ftp://localHOST", "ftp://localHOST" }, //43
588:                        { "ftp://LOCALHOST", "ftp://LOCALHOST" }, //44
589:                        { "ftp://zeus.nawab.inda.com/index.html",
590:                                "ftp://zeus.nawab.inda.com/index.html" },
591:                        { "ftp://zeus.nawab.inda.com:443/index.html",
592:                                "ftp://zeus.nawab.inda.com:443/index.html" },
593:                        { "ftp://zeus.nawab.inda.com:445/index.html",
594:                                "ftp://zeus.nawab.inda.com:445/index.html" },
595:                        { "ftp://zeus.nawab.inda.com:445/index.html",
596:                                "ftp://zeus.nawab.inda.com:445/index.html" },
597:                        { "ftp://zeus.nawab.inda.com:445/INDEX.html",
598:                                "ftp://zeus.nawab.inda.com:445/INDEX.html" },
599:                        { "    ftp://www.sun.com/abc.html    ",
600:                                "ftp://www.sun.com/abc.html    " }, //36
601:                        { "\"/index.html\"", "ftp://raja.sun.com/index.html" }, //29
602:                        { "'null'", "ftp://raja.sun.com/Base/Raja/null" }, //31 - Bug4627258
603:                };
604:
605:                Translator srapTranslator = SRAPTestSystemFactory
606:                        .createSRAPTranslator("https://zeus.nawab.inda.com",
607:                                "ftp://rajanagendra.sun.com/Base/Raja/raja.html?name=raja");
608:
609:                for (int i = 0; i < lData.length; i++) {
610:                    String result = srapTranslator.translate(lData[i][0]);
611:                    assertEquals("Failed at i=" + i + ":", lData[i][0], result);
612:                }
613:            }//testFTPBase()
614:
615:            public void atestISIntranetMachine() throws Throwable {
616:                String[][] lData = { { "sun.com", "false" },
617:                        { "india.sun.com", "true" },
618:                        { "raja.india.sun.com", "true" },
619:                        { "rama.raja.india.sun.com", "true" },
620:                        { "raja_abc.india.sun.com", "true" },
621:                        { "1.india.sun.com", "true" },
622:                        { "1.raja.india.sun.com", "true" },
623:                        { "1.raja.sunindia.sun.com", "true" },
624:                        { "raa", "true" }, { "1", "true" },
625:                        { "127.0.0.1", "false" }, { "localhost", "false" },
626:                        { "127", "false" },
627:
628:                        { "yahoo", "true" }, { "yahoo.com", "true" },
629:                        { "mail.yahoo.com", "true" },
630:                        { "nag.mail.yahoo.com", "true" },
631:                        { "auto.nag.mail.yahoo.com", "true" },
632:                        { "nag.mail.yahoo.org", "false" },
633:                        { "nag.mail.true.yahoo.com", "true" },
634:                        { "nag.mail.1yahoo.com", "true" }, };
635:
636:                for (int i = 0; i < lData.length; i++) {
637:                    Boolean b = (Boolean) PrivateAccessor.invoke(
638:                            SRAPTranslator.class, "isIntranetMachine",
639:                            new Class[] { String.class },
640:                            new Object[] { lData[i][0] });
641:                    assertEquals("isIntranet() Method Failed..at i=" + i,
642:                            lData[i][1], b.toString());
643:                }
644:            }//testISIntranetMachine()
645:
646:            public void testReverseProxyWithSessionIDForMap() throws Exception {
647:                //2nd param is not used as all ftp are not rewriten..
648:                String[][] lData = {
649:                        {
650:                                "https://zeuS.nawab.inda.COM/ABCDE/LDXIEWOUUOIWUOIREWSEssionID/",
651:                                "https://zeuS.nawab.inda.COM/ABCDE/LDXIEWOUUOIWUOIREWSEssionID/" },
652:                        {
653:                                "https://zeus.nawab.INda.com/LDXIEWOUUOIWUOIREWSEssionID/",
654:                                "https://zeus.nawab.INda.com/LDXIEWOUUOIWUOIREWSEssionID/" },
655:                        {
656:                                "https://zeuS.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID",
657:                                "https://zeuS.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID" },
658:                        {
659:                                "https://zeus.nawab.inda.com:443/LDXIEWOUUOIWUOIREWSEssionID/",
660:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/" },
661:                        {
662:                                "https://zeus.NAWAB.inda.com/ABCDE/LDXIEWOUUOIWUOIREWSEssionID/",
663:                                "https://zeus.NAWAB.inda.com/ABCDE/LDXIEWOUUOIWUOIREWSEssionID/" },
664:                        {
665:                                "htTPs://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/",
666:                                "htTPs://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/" },
667:                        {
668:                                "httpS://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID",
669:                                "httpS://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID" },
670:                        {
671:                                "HTTPS://zeus.naWAB.inda.com:443/LDXIEWOUUOIWUOIREWSEssionID/",
672:                                "HTTPS://zeus.naWAB.inda.com/LDXIEWOUUOIWUOIREWSEssionID/" },
673:
674:                        {
675:                                "    ../../../../functions/javascript.js",
676:                                "    https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/functions/javascript.js" }, //13
677:                        {
678:                                "index.",
679:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/index." }, //0
680:                        {
681:                                "../../index.",
682:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/index." }, //1
683:                        {
684:                                "../",
685:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/" }, //2
686:                        { "../../",
687:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/" }, //3
688:                        {
689:                                "././",
690:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/" }, //4
691:                        {
692:                                "..",
693:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/" }, //5
694:                        { "../..",
695:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/" }, //6
696:                        {
697:                                "./.",
698:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/" }, //7
699:                        { "/",
700:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/" }, //8
701:                        {
702:                                "#raj.index",
703:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/raja.html?name=raja#raj.index" }, //9
704:                        { " ", " " }, //10
705:                        { "", "" }, //11
706:                        { "   ", "   " }, //12
707:                        {
708:                                "../../../../functions/javascript.js",
709:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/functions/javascript.js" }, //13
710:                        {
711:                                "../../img/background.jpg",
712:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/img/background.jpg" }, //14
713:                        {
714:                                "http://www.sun.com/abc.html",
715:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://www.sun.com/abc.html" }, //15
716:                        {
717:                                "httP://www.sun.com/sh.html",
718:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/httP://www.sun.com/sh.html" }, //16
719:                        {
720:                                "htTP://www.sun.com:78/sh.html",
721:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/htTP://www.sun.com:78/sh.html" }, //17
722:                        {
723:                                "http://www.sun.com:400/sh.html",
724:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://www.sun.com:400/sh.html" }, //18
725:                        {
726:                                "abc.html",
727:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/abc.html" }, //19
728:                        {
729:                                "./abc.html",
730:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/abc.html" }, //20
731:                        {
732:                                "/abc.html",
733:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/abc.html" }, //21
734:                        {
735:                                "../../abc.html",
736:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/abc.html" }, //22
737:                        {
738:                                "../abc.html",
739:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/abc.html" }, //23
740:                        {
741:                                "../abc.html?turn=true",
742:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/abc.html?turn=true" }, //24
743:                        {
744:                                "./abc.html?turn=true",
745:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/abc.html?turn=true" }, //25
746:                        {
747:                                "http://www.sun.com:400/sh.html?roja=ramani",
748:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://www.sun.com:400/sh.html?roja=ramani" }, //26
749:                        {
750:                                "./././././abc.html",
751:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/abc.html" }, //27
752:                        {
753:                                "./raja/mahesh/.././abc.html",
754:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/raja/abc.html" }, //28
755:                        {
756:                                "null",
757:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/null" }, //30 - Bug4627258
758:                        { "user:password@./index.html",
759:                                "user:password@./index.html" }, //33
760:                        { "user:password@http://sun.com/index.html",
761:                                "user:password@http://sun.com/index.html" }, //34
762:                        {
763:                                "http://zeus.nawab.inda.com/http://www.sun.com/abc.html",
764:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com/http://www.sun.com/abc.html" }, //35
765:                        { "http://127.0.0.1", "http://127.0.0.1" }, //37
766:                        { "https://127.0.0.1/", "https://127.0.0.1/" }, //38
767:                        { "http://localhost", "http://localhost" }, //39
768:                        { "hTTPs://localhost", "hTTPs://localhost" }, //40
769:                        { "http://127.0.0.1", "http://127.0.0.1" }, //41
770:                        { "hTTp://127.0.0.1", "hTTp://127.0.0.1" }, //42
771:                        { "http://localHOST/", "http://localHOST/" }, //43
772:                        { "http://LOCALHOST", "http://LOCALHOST" }, //44
773:                        {
774:                                "http://zeus.nawab.inda.com/index.html",
775:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com/index.html" },
776:                        {
777:                                "http://zeus.nawab.inda.com:443/index.html",
778:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com:443/index.html" },
779:                        {
780:                                "http://zeus.nawab.inda.com:445/index.html",
781:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com:445/index.html" },
782:                        {
783:                                "http://zeus.nawab.inda.com:445/index.html",
784:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com:445/index.html" },
785:                        {
786:                                "http://zeus.nawab.inda.com:445/INDEX.html",
787:                                "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://zeus.nawab.inda.com:445/INDEX.html" },
788:                        {
789:                                "    http://www.sun.com/abc.html    ",
790:                                "    https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://www.sun.com/abc.html    " }, //36
791:                        {
792:                                "\"/index.html\"",
793:                                "\"https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/index.html\"" }, //29
794:                        {
795:                                "'null'",
796:                                "'https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/http://raja.sun.com/Base/Raja/null'" }, //31 - Bug4627258
797:                };
798:
799:                String[] bGatewayURI = {
800:                        "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID/",
801:                        "https://zeus.nawab.inda.com/LDXIEWOUUOIWUOIREWSEssionID",
802:                        "https://zeus.nawab.inda.com:443/LDXIEWOUUOIWUOIREWSEssionID/" };
803:
804:                for (int j = 0; j < bGatewayURI.length; j++) {
805:                    Translator srapTranslator = SRAPTestSystemFactory
806:                            .createSRAPTranslator(bGatewayURI[j],
807:                                    "http://raja.sun.com/Base/Raja/raja.html?name=raja");
808:
809:                    for (int i = 0; i < lData.length; i++) {
810:                        String result = srapTranslator.translate(lData[i][0]);
811:                        assertEquals("Failed at i=" + i + ":", lData[i][1],
812:                                result);
813:                    }
814:                }
815:            }//testReverseProxyWithSessionIDForMap()
816:
817:            public static void main(String[] args) {
818:                SRAPRewriterModule.initFile();
819:                BasicTestCase.run(TestSRAPTranslator.class);
820:                TestSuite testSuite = new TestSuite();
821:                testSuite.addTest(new TestSRAPTranslator(
822:                        "testSRAPTranslateHTTPURL"));
823:                //BasicTestCase.run( testSuite );
824:            }//main()
825:        }//class TestSRAPTranslator
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.