UtilTest.java revision 1185
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 119N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 125N/A * Test of the methods in <code>org.opensolaris.opengrok.web.Util</code>. 58N/A // Some of the methods have different results in different locales. 394N/A // Set locale to en_US for these tests. 312N/A {
"This is a test",
"This is a test" },
312N/A {
"Newline\nshould become <br/>",
312N/A "Newline<br/>should become <br/>" },
312N/A {
"Open & Grok",
"Open & Grok" },
65N/A {
"&<>",
"&amp;&lt;&gt;" },
207N/A // parent directories have a trailing slash in href 260N/A // if basename is a dir (ends with file seperator), href link also 77N/A // should work the same way with a '.' as file separator 77N/A // suffix added to the link? 0N/A // compact: path needs to be resolved to /xx and no link is added 77N/A // for the virtual root directory (parent) but emitted as plain text. 111N/A // Prefix gets just prefixed as is and not mangled wrt. path -> "//" 111N/A // relative pathes are resolved wrt. / , so path resolves to /a/c/d 111N/A "<a href=\"/r//a/c/\">c</a>/" +
111N/A "<a href=\"/r//a/c/d\">d</a>",
77N/A // hmmm - where do meaningful test start? 0N/A "\"(ses_id, mer_id, pass_id, \" + refCol +\" , mer_ref, amnt, " 77N/A +
"cur, ps_id, ret_url, d_req_time, d_req_mil, h_resp_time, " 77N/A "\"(ses_id, mer_id, pass_id, \" + refCol +\" , mer_ref, amnt, " 77N/A +
"cur, ps_id, ret_url, exp_url, d_req_time, d_req_mil, " 205N/A +
"h_resp_time, h_resp_mil) \"",
205N/A "\"(ses_id, mer_id, pass_id, \" + refCol +\" , mer_ref, amnt, " 112N/A +
"cur, ps_id, ret_url, <span class=\"a\">exp_url, " 112N/A +
"</span>d_req_time, d_req_mil, h_resp_time, h_resp_mil) \"" 106N/A "\"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\", values);",
119N/A "\"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\", values);",
119N/A "\"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?<span " 106N/A +
"class=\"a\">, ?</span>)\", values);" 119N/A "char *config_list = NULL;",
119N/A "char **config_list = NULL;",
106N/A "char *<span class=\"a\">*</span>config_list = NULL;" 99N/A "* An error occured or there is non-numeric stuff at the end",
99N/A "* An error occurred or there is non-numeric stuff at the end",
99N/A "* An error occur<span class=\"a\">r</span>ed or there is " 99N/A +
"non-numeric stuff at the end" 126N/A // Verify that we got a table. 126N/A // Verify that the output is well-formed.