01: /**
02: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
03: *
04: * This program is free software; you can redistribute it and/or modify
05: * it under the terms of the latest version of the GNU Lesser General
06: * Public License as published by the Free Software Foundation;
07: *
08: * This program is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public License
14: * along with this program (LICENSE.txt); if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16: *
17: * Based on code generated by Agitar build: Agitator Version 1.0.2.000071 (Build date: Jan 12, 2007) [1.0.2.000071]
18: */package org.jamwiki.servlets;
19:
20: import java.util.Properties;
21: import junit.framework.TestCase;
22: import org.jamwiki.utils.SortedProperties;
23:
24: public class ServletUtilTest extends TestCase {
25:
26: /**
27: *
28: */
29: public void testValidateSystemSettings1() throws Throwable {
30: Properties props = new Properties(new SortedProperties());
31: props.put("file-dir-full-path", ")%2F");
32: props.put("homeDir", "testString");
33: props.put("parser", "org.jamwiki.parser.AbstractParser");
34: props.put("url", "testString");
35: ServletUtil.validateSystemSettings(props);
36: assertTrue("Test completed without Exception", true);
37: // dependencies on static and environment state led to removal of 1 assertion(s)
38: }
39:
40: /**
41: *
42: */
43: public void testValidateSystemSettings2() throws Throwable {
44: Properties props = new Properties();
45: props.put("file-dir-full-path", "testString");
46: props.put("homeDir", "testString");
47: props.put("url", "testString");
48: ServletUtil.validateSystemSettings(props);
49: assertTrue("Test completed without Exception", true);
50: // dependencies on static and environment state led to removal of 1 assertion(s)
51: }
52:
53: /**
54: *
55: */
56: public void testValidateSystemSettingsThrowsNullPointerException1()
57: throws Throwable {
58: try {
59: ServletUtil.validateSystemSettings(new Properties());
60: fail("Expected NullPointerException to be thrown");
61: } catch (NullPointerException ex) {
62: assertNull("ex.getMessage()", ex.getMessage());
63: }
64: }
65: }
|