01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.rice.test;
17:
18: import org.mortbay.jetty.Server;
19: import org.mortbay.jetty.webapp.WebAppContext;
20:
21: /**
22: * Creates a Jetty Server to test Workflow.
23: *
24: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
25: * @version $Revision: 1.2.16.1.6.1 $ $Date: 2007/10/17 20:32:04 $
26: * @since 0.9
27: */
28: public class WorkflowServer extends BaseTestServer {
29:
30: private int port;
31:
32: private String contextName;
33:
34: public WorkflowServer() {
35: // nothing to do
36: }
37:
38: public WorkflowServer(final int port, final String contextName) {
39: this .port = port;
40: this .contextName = contextName;
41: }
42:
43: protected Server createServer() {
44: Server server = new Server(getPort());
45: WebAppContext context = new WebAppContext("en",
46: getContextName());
47: server.addHandler(context);
48: return server;
49: }
50:
51: public String getContextName() {
52: if (this .contextName == null) {
53: return "/en-test";
54: }
55: return this .contextName;
56: }
57:
58: public void setContextName(final String contextName) {
59: this .contextName = contextName;
60: }
61:
62: public int getPort() {
63: if (this .port == 0) {
64: return 9912;
65: }
66: return this .port;
67: }
68:
69: public void setPort(final int port) {
70: this.port = port;
71: }
72:
73: }
|