2
* Copyright 2005-2012 Restlet S.A.S.
4
* The contents of this file are subject to the terms of one of the following
5
* open source licenses: Apache 2.0 or LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL
6
* 1.0 (the "Licenses"). You can select the license that you prefer but you may
7
* not use this file except in compliance with one of these Licenses.
9
* You can obtain a copy of the Apache 2.0 license at
10
* http://www.opensource.org/licenses/apache-2.0
12
* You can obtain a copy of the LGPL 3.0 license at
13
* http://www.opensource.org/licenses/lgpl-3.0
15
* You can obtain a copy of the LGPL 2.1 license at
16
* http://www.opensource.org/licenses/lgpl-2.1
18
* You can obtain a copy of the CDDL 1.0 license at
19
* http://www.opensource.org/licenses/cddl1
21
* You can obtain a copy of the EPL 1.0 license at
22
* http://www.opensource.org/licenses/eclipse-1.0
24
* See the Licenses for the specific language governing permissions and
25
* limitations under the Licenses.
27
* Alternatively, you can obtain a royalty free commercial license with less
28
* limitations, transferable or non-transferable, directly at
29
* http://www.restlet.com/products/restlet-framework
31
* Restlet is a registered trademark of Restlet S.A.S.
34
package org.restlet.test.jaxrs.server;
36
import org.restlet.Application;
37
import org.restlet.Restlet;
38
import org.restlet.data.Protocol;
41
* This interface wraps a server for the tests. The default implementation is
42
* the {@link RestletServerWrapper}, but there are other implementations
43
* possible, for example for the JSR-311 reference implementation Jersey.
45
* @see org.restlet.test.jaxrs.services.tests.JaxRsTestCase#setServerWrapper(ServerWrapper)
46
* @see ServerWrapperFactory
48
* @author Stephan Koops
50
public interface ServerWrapper {
52
* Returns the connector to access the application.
54
* @return the connector to access the application.
56
public Restlet getClientConnector();
59
* Returns the port the server is running on. throws an
60
* {@link IllegalStateException}, if direct access is used.
62
public int getServerPort();
65
* Starts the server with the given protocol on the given port with the
66
* given Collection of root resource classes. The method {@link #setUp()}
67
* will do this on every test start up.
74
public void startServer(Application application, Protocol protocol)
78
* Stops the component. The method {@link #tearDown()} do this after every
84
public void stopServer() throws Exception;