01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or 1any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: ClusterDaemonConfigurationTest.java 8434 2006-06-06 11:24:06Z pelletib $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_clusterd.tests;
25:
26: import java.io.Reader;
27:
28: import org.objectweb.jonas_clusterd.lib.ClusterDaemonConfigurationManager;
29: import org.objectweb.jonas_clusterd.xml.ClusterDaemon;
30:
31: import org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest;
32: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
33:
34: /**
35: * Defines a class for Cluster daemon configuration tests (clusterd.xml)
36: * @author Benoit Pelletier
37: */
38: public class ClusterDaemonConfigurationTest extends AbsDeploymentTest {
39:
40: /**
41: * @return Returns the Application XML Element
42: *
43: * @throws Exception never thrown
44: */
45: public AbsElement getTopLevelElement() throws Exception {
46: ClusterDaemon app = new ClusterDaemon();
47: return app;
48: }
49:
50: /**
51: * Returns the XML document as a String.
52: *
53: * @param reader Reader of an clusterd.xml file
54: * @param name not used
55: * @param validation true/false
56: *
57: * @return Returns the XML document as a String.
58: *
59: * @throws Exception when parsing fails
60: */
61: public String parse(Reader reader, String name, boolean validation)
62: throws Exception {
63: ClusterDaemonConfigurationManager
64: .setParsingWithValidation(validation);
65: String xmlParsed = ClusterDaemonConfigurationManager
66: .loadClusterDaemon(reader, "test").toXML();
67: return xmlParsed;
68: }
69:
70: }
|