1   /*
2    *  soapUI, copyright (C) 2004-2010 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  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  {
27  	private static Server server;
28  	
29  	protected void setUp() throws Exception
30  	{
31  		if( server != null )
32  		{	
33  			return;
34  		}
35  		
36  		server = new Server( 8082 );
37  		ResourceHandler resource_handler = new ResourceHandler();
38  		resource_handler.setResourceBase( ".//src//test-resources" );
39  
40  		HandlerList handlers = new HandlerList();
41  		handlers.setHandlers( new Handler[] { resource_handler, new DefaultHandler() } );
42  		server.setHandler( handlers );
43  
44  		try
45  		{
46  			server.start();
47  		}
48  		catch( Exception e )
49  		{
50  			SoapUI.logError( e );
51  		}
52  	}
53  	
54  	public void testDummy() throws Exception
55  	{
56  		assertTrue( 1 == 1 );
57  	}
58  }