01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestXhtmlContentLoader.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.loader;
09:
10: import java.util.HashSet;
11: import java.util.Set;
12: import junit.framework.TestCase;
13:
14: public class TestXhtmlContentLoader extends TestCase {
15: public TestXhtmlContentLoader(String name) {
16: super (name);
17: }
18:
19: public void testLoad() throws Exception {
20: XhtmlContentLoader loader = new XhtmlContentLoader();
21: Set<String> errors = new HashSet<String>();
22:
23: String xhtml = loader.load("<p>some <b>html</b> here</p>",
24: true, errors);
25:
26: assertNotNull(xhtml);
27: assertEquals(0, errors.size());
28: }
29:
30: public void testLoadNull() throws Exception {
31: XhtmlContentLoader loader = new XhtmlContentLoader();
32: Set<String> errors = new HashSet<String>();
33:
34: String xhtml = loader.load(null, false, errors);
35:
36: assertNull(xhtml);
37: assertEquals(0, errors.size());
38: }
39:
40: public void getBackends() throws Exception {
41: XhtmlContentLoader loader = new XhtmlContentLoader();
42: assertTrue(loader.getBackends().size() > 0);
43: }
44: }
|