1 /* 2 * Copyright 2007-2008 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 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.server; 17 18 import java.lang.annotation.Documented; 19 import java.lang.annotation.ElementType; 20 import java.lang.annotation.Inherited; 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 import java.lang.annotation.Target; 24 25 import org.kuali.rice.test.lifecycles.JettyServerLifecycle.ConfigMode; 26 27 /** 28 * Annotation for bringing up an embedded JettyServer in unit tests 29 * @author Kuali Rice Team (rice.collab@kuali.org) 30 */ 31 @Documented 32 @Target({ElementType.TYPE, ElementType.METHOD}) 33 @Retention(RetentionPolicy.RUNTIME) 34 @Inherited 35 public @interface JettyServer { 36 /** 37 * Indicate that the port should be pulled from a configuration parameter 38 */ 39 public static final int CONFIG_PARAM_PORT = -1; 40 41 /** 42 * The webapp file location, relative to the working directory of the unit test 43 */ 44 String webapp() default "../src/test/webapp"; 45 /** 46 * The context name; this will be prepended with a slash "/", so don't prepend a slash 47 */ 48 String context() default "SampleRiceClient"; 49 /** 50 * The port to bring jetty up on; CONFIG_PARAM_PORT to refer to a port from a config param 51 */ 52 int port() default CONFIG_PARAM_PORT; 53 /** 54 * The name of the config param from which to read the port 55 */ 56 String portConfigParam() default "kns.port"; 57 /** 58 * What to do with the webapp's Config: NONE - nothing, 59 * OVERRIDE - replace the current context config (the test harness config) with the webapp's config 60 * MERGE - merge the properties and objects into the current context config (but don't replace the whole config) 61 */ 62 ConfigMode configMode() default ConfigMode.OVERRIDE; 63 /** 64 * Whether to explicitly add the webapp's ResourceLoader to the GlobalResourceLoader 65 */ 66 boolean addWebappResourceLoader() default true; 67 }