1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.pluto.descriptors.portlet;
17
18 import java.io.InputStream;
19 import java.io.OutputStream;
20
21 import junit.framework.Test;
22 import junit.framework.TestCase;
23 import junit.framework.TestSuite;
24 import org.apache.pluto.descriptors.services.impl.StreamPortletAppDescriptorServiceImpl;
25
26 /***
27 *
28 * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
29 * @version $Id: CastorMappingTest.java 156743 2005-03-10 05:50:30Z ddewolf $
30 * @since Mar 4, 2005
31 */
32 public class CastorMappingTest extends TestCase {
33
34 private boolean debug = false;
35
36
37
38 public void setUp() throws Exception {
39 this.debug = false;
40 }
41
42 public void testUnmarshalWebXml() throws Exception {
43 InputStream in = getClass().getResourceAsStream("portlet.xml");
44 PortletAppDD config =
45 new StreamPortletAppDescriptorServiceImpl(
46 "test", in, (OutputStream)null
47 ).read();
48
49 assertTrue(config!=null);
50 assertTrue(config.getPortlets()!=null);
51 assertTrue(config.getPortlets().size() > 0);
52 }
53
54 /***
55 * Start the tests.
56 *
57 * @param theArgs the arguments. Not used
58 */
59 public static void main(String[] theArgs) {
60 junit.awtui.TestRunner.main(
61 new String[] { CastorMappingTest.class.getName()});
62 }
63
64 /***
65 * @return a test suite (<code>TestSuite</code>) that includes all methods
66 * starting with "test"
67 */
68 public static Test suite() {
69
70 return new TestSuite(CastorMappingTest.class);
71 }
72
73 }
74