001// Copyright 2011, 2012 The Apache Software Foundation 002// 003// Licensed under the Apache License, Version 2.0 (the "License"); 004// you may not use this file except in compliance with the License. 005// You may obtain a copy of the License at 006// 007// http://www.apache.org/licenses/LICENSE-2.0 008// 009// Unless required by applicable law or agreed to in writing, software 010// distributed under the License is distributed on an "AS IS" BASIS, 011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012// See the License for the specific language governing permissions and 013// limitations under the License. 014 015package org.apache.tapestry5.test; 016 017import org.apache.tapestry5.test.SeleniumTestCase; 018 019import java.lang.annotation.*; 020 021/** 022 * To be used on Selenium-based integration tests that extend {@link SeleniumTestCase} as an alternative to using a 023 * TestNG XML configuration file. Using the XML file, it's intricate to run <em>individual</em> test classes or 024 * methods using IDEA's or Eclipse's TestNG integration. 025 * 026 * <b>Parameters coming from a TestNG XML configuration file take precedence over those supplied with the annotation.</b> 027 * 028 * Configures the container to be started for the tests and the browser to be used. 029 * @since 5.4 030 */ 031@Target(ElementType.TYPE) 032@Retention(RetentionPolicy.RUNTIME) 033@Documented 034public @interface TapestryTestConfiguration 035{ 036 /** 037 * The folder for the web application root relative to the working directory. Defaults to "src/main/webapp". 038 */ 039 String webAppFolder() default "src/main/webapp"; 040 041 /** 042 * Which container to use. Can be one of {@link SeleniumTestCase#JETTY_7} or {@link SeleniumTestCase#TOMCAT_6}. 043 * Defaults to {@link SeleniumTestCase#JETTY_7}. 044 */ 045 String container() default SeleniumTestCase.JETTY_7; 046 047 /** 048 * The context path to make the application available under. Defaults to "", i.e. the context root. 049 */ 050 String contextPath() default ""; 051 052 /** 053 * The port to listen on for HTTP requests. Defaults to "9090". 054 */ 055 int port() default 9090; 056 057 /** 058 * The port to listen on fot HTTPS requests. Defaults to "8443". 059 */ 060 int sslPort() default 8443; 061 062 /** 063 * The browser start command to use with Selenium. Defaults to "*firefox". 064 */ 065 String browserStartCommand() default "*firefox"; 066}