01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.support;
14:
15: import junit.framework.TestCase;
16:
17: import org.mortbay.jetty.Handler;
18: import org.mortbay.jetty.Server;
19: import org.mortbay.jetty.handler.DefaultHandler;
20: import org.mortbay.jetty.handler.HandlerList;
21: import org.mortbay.jetty.handler.ResourceHandler;
22:
23: import com.eviware.soapui.SoapUI;
24:
25: public class TestCaseWithJetty extends TestCase {
26: private static Server server;
27:
28: protected void setUp() throws Exception {
29: if (server != null) {
30: return;
31: }
32:
33: server = new Server(8082);
34: ResourceHandler resource_handler = new ResourceHandler();
35: resource_handler.setResourceBase(".\\src\\test-resources");
36:
37: HandlerList handlers = new HandlerList();
38: handlers.setHandlers(new Handler[] { resource_handler,
39: new DefaultHandler() });
40: server.setHandler(handlers);
41:
42: try {
43: server.start();
44: } catch (Exception e) {
45: SoapUI.logError(e);
46: }
47: }
48:
49: public void testDummy() throws Exception {
50: assertTrue(1 == 1);
51: }
52: }
|