001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/test/junit/org/deegree/ogcwebservices/wass/wss/WSServiceTest.java $
002: /*---------------- FILE HEADER ------------------------------------------
003:
004: This file is part of deegree.
005: Copyright (C) 2001-2008 by:
006: EXSE, Department of Geography, University of Bonn
007: http://www.giub.uni-bonn.de/deegree/
008: lat/lon GmbH
009: http://www.lat-lon.de
010:
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the GNU Lesser General Public
013: License as published by the Free Software Foundation; either
014: version 2.1 of the License, or (at your option) any later version.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: Contact:
026:
027: Andreas Poth
028: lat/lon GmbH
029: Aennchenstr. 19
030: 53115 Bonn
031: Germany
032: E-Mail: poth@lat-lon.de
033:
034: Prof. Dr. Klaus Greve
035: Department of Geography
036: University of Bonn
037: Meckenheimer Allee 166
038: 53115 Bonn
039: Germany
040: E-Mail: greve@giub.uni-bonn.de
041:
042:
043: ---------------------------------------------------------------------------*/
044: package org.deegree.ogcwebservices.wass.wss;
045:
046: import java.io.File;
047: import java.net.URL;
048:
049: import junit.framework.Test;
050: import junit.framework.TestCase;
051: import junit.framework.TestSuite;
052:
053: import org.deegree.framework.log.ILogger;
054: import org.deegree.framework.log.LoggerFactory;
055: import org.deegree.framework.xml.XMLFragment;
056: import org.deegree.ogcwebservices.wass.common.WASServiceFactory;
057: import org.deegree.ogcwebservices.wass.common.XMLFactory;
058: import org.deegree.ogcwebservices.wass.wss.capabilities.WSSCapabilities;
059:
060: /**
061: * General test class for the WSS.
062: *
063: * @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a>
064: * @author last edited by: $Author: apoth $
065: *
066: * @version 2.0, $Revision: 9336 $, $Date: 2007-12-27 03:31:18 -0800 (Thu, 27 Dec 2007) $
067: *
068: * @since 2.0
069: */
070:
071: public class WSServiceTest extends TestCase {
072:
073: private static final ILogger LOG = LoggerFactory
074: .getLogger(WSServiceTest.class);
075:
076: private WSService service;
077: private final String resourceLocation = "./resources/wass/wss/example/deegree/";
078:
079: /**
080: * Constructor for WSServiceTest.
081: *
082: * @param arg0
083: */
084: public WSServiceTest(String arg0) {
085: super (arg0);
086: }
087:
088: /*
089: * @see TestCase#setUp()
090: */
091: @Override
092: protected void setUp() throws Exception {
093: super .setUp();
094: try {
095: LOG.logInfo("Setting up WSS...");
096: // hardcoded, but not to the local file system ;-)
097: File file = new File(resourceLocation
098: + "example_wss_capabilities.xml");
099: URL url = file.toURL();
100: WASServiceFactory.setConfiguration(url);
101: service = WASServiceFactory.getUncachedWSService();
102: LOG.logInfo("Setting up WSS...done.");
103: } catch (Exception e) {
104: throw e;
105: }
106: }
107:
108: /*
109: * @see TestCase#tearDown()
110: */
111: @Override
112: protected void tearDown() throws Exception {
113: super .tearDown();
114: }
115:
116: /**
117: * @return the Test
118: */
119: public static Test suite() {
120: return new TestSuite(WSServiceTest.class);
121: }
122:
123: /**
124: * @throws Exception
125: */
126: public void testGetCapabilities() throws Exception {
127: assertNotNull("Service not initialized", service);
128: WSSCapabilities capabilities = (WSSCapabilities) service
129: .getCapabilities();
130: assertNotNull("Capabilities are null", capabilities);
131: XMLFragment xml = XMLFactory.export(capabilities);
132: assertNotNull("XMLFragment is null", xml);
133: xml.prettyPrint(System.out);
134: }
135:
136: }
137:
138: /***************************************************************************************************
139: * Changes to this class. What the people have been up to: $Log$
140: * Changes to this class. What the people have been up to: Revision 1.5 2006/06/20 15:37:10 bezema
141: * Changes to this class. What the people have been up to: Changed the test just alittle so they can compile.
142: * Changes to this class. What the people have been up to:
143: * Changes to this class. What the people have been up to: Revision 1.4 2006/06/19 15:31:40 bezema
144: * Changes to this class. What the people have been up to: added the function calls handling the id etc.
145: * Changes to this class. What the people have been up to:
146: * Changes to this class. What the people have been up to: Revision 1.3 2006/06/13 15:19:57 bezema
147: * Changes to this class. What the people have been up to: WSS operations test added
148: * Changes to this class. What the people have been up to:
149: * Changes to this class. What the people have been up to: Revision 1.2 2006/06/12 16:11:55 bezema
150: * Changes to this class. What the people have been up to: JUnit test work with for a GetCapabilities request - example configurationfiles in resources added
151: * Changes to this class. What the people have been up to:
152: * Changes to this class. What the people have been up to: Revision 1.1 2006/06/09 12:58:32 schmitz
153: * Changes to this class. What the people have been up to: Set up some tests for WAS/WSS and the URN class.
154: * Changes to this class. What the people have been up to: Commented out some of the deegree param stuff in order for the
155: * Changes to this class. What the people have been up to: tests to run.
156: * Changes to this class. What the people have been up to: Tests have hardcoded URLs in them, so they won't run just anywhere.
157: * Changes to this class. What the people have been up to:
158: *
159: *
160: **************************************************************************************************/
|