001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: *
017: * Based on code generated by Agitar build: Agitator Version 1.0.2.000071 (Build date: Jan 12, 2007) [1.0.2.000071]
018: */package org.jamwiki.servlets;
019:
020: import junit.framework.TestCase;
021: import org.acegisecurity.GrantedAuthorityImpl;
022: import org.acegisecurity.GrantedAuthority;
023: import org.jamwiki.authentication.WikiUserAuth;
024: import org.jamwiki.model.WikiUser;
025:
026: /**
027: *
028: */
029: public class XMLTopicFactoryTest extends TestCase {
030:
031: /**
032: *
033: */
034: public void testConstructor() throws Throwable {
035: // FIXME - implement this
036: }
037:
038: /**
039: *
040: */
041: public void testCharacters() throws Throwable {
042: // FIXME - implement this
043: }
044:
045: /**
046: *
047: */
048: public void testEndDocument() throws Throwable {
049: // FIXME - implement this
050: }
051:
052: /**
053: *
054: */
055: public void testEndElement() throws Throwable {
056: // FIXME - implement this
057: }
058:
059: /**
060: *
061: */
062: public void testPreprocessText() throws Throwable {
063: String result = new XMLTopicFactory(
064: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
065: "testXMLTopicFactoryAuthorIpAddress")
066: .preprocessText("testXMLTopicFactoryText");
067: assertEquals("result", "testXMLTopicFactoryText", result);
068: }
069:
070: /**
071: *
072: */
073: public void testPreprocessText1() throws Throwable {
074: String result = new XMLTopicFactory(
075: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
076: "testXMLTopicFactoryAuthorIpAddress")
077: .preprocessText(null);
078: assertNull("result", result);
079: }
080:
081: /**
082: *
083: */
084: public void testStartDocument() throws Throwable {
085: // FIXME - implement this
086: }
087:
088: /**
089: *
090: */
091: public void testStartElement() throws Throwable {
092: // FIXME - implement this
093: }
094:
095: /**
096: *
097: */
098: public void testCharactersThrowsArrayIndexOutOfBoundsException()
099: throws Throwable {
100: // FIXME - implement this
101: }
102:
103: /**
104: *
105: */
106: public void testCharactersThrowsNullPointerException()
107: throws Throwable {
108: char[] buf = new char[1];
109: GrantedAuthority grantedAuthorityImpl = new GrantedAuthorityImpl(
110: "testXMLTopicFactoryRole");
111: GrantedAuthority[] authorities = new GrantedAuthority[3];
112: authorities[0] = grantedAuthorityImpl;
113: authorities[1] = grantedAuthorityImpl;
114: authorities[2] = new GrantedAuthorityImpl(
115: "testXMLTopicFactoryRole1");
116: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
117: "testXMLTopicFactoryVirtualWiki", new WikiUserAuth(
118: "testXMLTopicFactoryUsername",
119: "testXMLTopicFactoryPassword", true, false,
120: false, false, authorities),
121: "testXMLTopicFactoryAuthorIpAddress");
122: try {
123: xMLTopicFactory.characters(buf, 100, 1000);
124: fail("Expected NullPointerException to be thrown");
125: } catch (NullPointerException ex) {
126: assertNull("ex.getMessage()", ex.getMessage());
127: }
128: }
129:
130: /**
131: *
132: */
133: public void testEndElementThrowsNullPointerException()
134: throws Throwable {
135: // FIXME - implement this
136: }
137:
138: /**
139: *
140: */
141: public void testEndElementThrowsNullPointerException1()
142: throws Throwable {
143: GrantedAuthority grantedAuthorityImpl = new GrantedAuthorityImpl(
144: "testXMLTopicFactoryRole1");
145: GrantedAuthority[] authorities = new GrantedAuthority[4];
146: authorities[0] = new GrantedAuthorityImpl(
147: "testXMLTopicFactoryRole");
148: authorities[1] = grantedAuthorityImpl;
149: authorities[2] = grantedAuthorityImpl;
150: authorities[3] = new GrantedAuthorityImpl(
151: "testXMLTopicFactoryRole2");
152: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
153: "testXMLTopicFactoryVirtualWiki", new WikiUserAuth(
154: "testXMLTopicFactoryUsername",
155: "testXMLTopicFactoryPassword", true, false,
156: false, false, authorities),
157: "testXMLTopicFactoryAuthorIpAddress");
158: try {
159: xMLTopicFactory.endElement(
160: "testXMLTopicFactoryNamespaceURI",
161: "testXMLTopicFactorySName", "title");
162: fail("Expected NullPointerException to be thrown");
163: } catch (NullPointerException ex) {
164: assertNull("ex.getMessage()", ex.getMessage());
165: }
166: }
167:
168: /**
169: *
170: */
171: public void testEndElementThrowsNullPointerException2()
172: throws Throwable {
173: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
174: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
175: "testXMLTopicFactoryAuthorIpAddress");
176: try {
177: xMLTopicFactory.endElement(
178: "testXMLTopicFactoryNamespaceURI",
179: "testXMLTopicFactorySName", "page");
180: fail("Expected NullPointerException to be thrown");
181: } catch (NullPointerException ex) {
182: assertNull("ex.getMessage()", ex.getMessage());
183: }
184: }
185:
186: /**
187: *
188: */
189: public void testEndElementThrowsNullPointerException3()
190: throws Throwable {
191: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
192: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
193: "testXMLTopicFactoryAuthorIpAddress");
194: try {
195: xMLTopicFactory.endElement(
196: "testXMLTopicFactoryNamespaceURI",
197: "testXMLTopicFactorySName", "text");
198: fail("Expected NullPointerException to be thrown");
199: } catch (NullPointerException ex) {
200: assertNull("ex.getMessage()", ex.getMessage());
201: }
202: }
203:
204: /**
205: *
206: */
207: public void testEndElementThrowsNullPointerException4()
208: throws Throwable {
209: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
210: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
211: "testXMLTopicFactoryAuthorIpAddress");
212: try {
213: xMLTopicFactory.endElement(
214: "testXMLTopicFactoryNamespaceURI",
215: "testXMLTopicFactorySName", "namespace");
216: fail("Expected NullPointerException to be thrown");
217: } catch (NullPointerException ex) {
218: assertNull("ex.getMessage()", ex.getMessage());
219: }
220: }
221:
222: /**
223: *
224: */
225: public void testStartElementThrowsNullPointerException()
226: throws Throwable {
227: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
228: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
229: "testXMLTopicFactoryAuthorIpAddress");
230: try {
231: xMLTopicFactory.startElement(
232: "testXMLTopicFactoryNamespaceURI",
233: "testXMLTopicFactoryLName",
234: "testXMLTopicFactoryQName", null);
235: fail("Expected NullPointerException to be thrown");
236: } catch (NullPointerException ex) {
237: assertNull("ex.getMessage()", ex.getMessage());
238: }
239: }
240:
241: /**
242: *
243: */
244: public void testStartElementThrowsNullPointerException1()
245: throws Throwable {
246: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
247: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
248: "testXMLTopicFactoryAuthorIpAddress");
249: xMLTopicFactory.endElement("testXMLTopicFactoryNamespaceURI",
250: "testXMLTopicFactorySName", "testXMLTopicFactoryQName");
251: try {
252: xMLTopicFactory.startElement(
253: "testXMLTopicFactoryNamespaceURI", "",
254: "testXMLTopicFactoryQName", null);
255: fail("Expected NullPointerException to be thrown");
256: } catch (NullPointerException ex) {
257: assertNull("ex.getMessage()", ex.getMessage());
258: }
259: }
260:
261: /**
262: *
263: */
264: public void testStartElementThrowsNullPointerException2()
265: throws Throwable {
266: GrantedAuthority grantedAuthorityImpl = new GrantedAuthorityImpl(
267: "testXMLTopicFactoryRole");
268: GrantedAuthority[] authorities = new GrantedAuthority[3];
269: authorities[0] = grantedAuthorityImpl;
270: authorities[1] = grantedAuthorityImpl;
271: authorities[2] = new GrantedAuthorityImpl(
272: "testXMLTopicFactoryRole1");
273: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
274: "testXMLTopicFactoryVirtualWiki", new WikiUserAuth(
275: "testXMLTopicFactoryUsername",
276: "testXMLTopicFactoryPassword", true, false,
277: false, false, authorities),
278: "testXMLTopicFactoryAuthorIpAddress");
279: try {
280: xMLTopicFactory.startElement(
281: "testXMLTopicFactoryNamespaceURI", "",
282: "testXMLTopicFactoryQName", null);
283: fail("Expected NullPointerException to be thrown");
284: } catch (NullPointerException ex) {
285: assertNull("ex.getMessage()", ex.getMessage());
286: }
287: }
288:
289: /**
290: *
291: */
292: public void testStartElementThrowsNullPointerException3()
293: throws Throwable {
294: XMLTopicFactory xMLTopicFactory = new XMLTopicFactory(
295: "testXMLTopicFactoryVirtualWiki", new WikiUser(""),
296: "testXMLTopicFactoryAuthorIpAddress");
297: xMLTopicFactory.endElement("testXMLTopicFactoryNamespaceURI",
298: "testXMLTopicFactorySName", "testXMLTopicFactoryQName");
299: try {
300: xMLTopicFactory.startElement(
301: "testXMLTopicFactoryNamespaceURI",
302: "testXMLTopicFactoryLName",
303: "testXMLTopicFactoryQName", null);
304: fail("Expected NullPointerException to be thrown");
305: } catch (NullPointerException ex) {
306: assertNull("ex.getMessage()", ex.getMessage());
307: }
308: }
309:
310: /**
311: *
312: */
313: public void testStartElementThrowsNumberFormatException()
314: throws Throwable {
315: // FIXME - implement this
316: }
317: }
|