package ch.ralscha.embeddedtc;

import org.junit.AfterClass;
import org.junit.BeforeClass;

/**
 * Convenient JUnit test class that starts a Tomcat on port 9998 before the test
 * and stops it afterwards. Extend your JUnit test class with this class.
 * 
 * @author Ralph Schaer
 */
public class TomcatTest {
	private static EmbeddedTomcat et;

	/**
	 * Starts an embedded tomcat on port 9998. 
	 * Does not print any log messages and does not add a shutdown hook
	 */
	@BeforeClass
	public static void startServer() {
		et = new EmbeddedTomcat(9998);
		et.setSilent(true);
		et.dontAddShutdownHook();
		et.start();
	}

	/**
	 * Stops the Tomcat after running all the tests in the test class
	 */
	@AfterClass
	public static void stopServer() {
		et.stop();
	}
}

@@ -1,8 +1,642 @@
+/**%0D%0A * Copyright 2012 Ralph Schaer %3Cralphschaer@gmail.com%3E%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *   http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A
 package 
@@ -1219,24 +1219,51 @@
 ent(true);%0D%0A
+%09%09et.setPrivileged(true);%0D%0A
 %09%09et.dontAdd

add license header and set privileged flag to true