001//  Copyright 2011-2013 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 java.lang.annotation.*;
018
019/**
020 * To be used on Selenium-based integration tests that extend {@link SeleniumTestCase} as an alternative to using a
021 * TestNG XML configuration file. Using the XML file, it's intricate to run <em>individual</em> test classes or
022 * methods using IDEA's or Eclipse's TestNG integration.
023 *
024 * <b>Parameters coming from a TestNG XML configuration file take precedence over those supplied with the annotation.</b>
025 *
026 * Configures the container to be started for the tests and the browser to be used.
027 * @since 5.4
028 */
029@Target(ElementType.TYPE)
030@Retention(RetentionPolicy.RUNTIME)
031@Inherited
032@Documented
033public @interface TapestryTestConfiguration
034{
035    /**
036     * The folder for the web application root relative to the working directory. Defaults to "src/main/webapp".
037     */
038    String webAppFolder() default "src/main/webapp";
039
040    /**
041     * Which container to use. Can be one of {@link SeleniumTestCase#JETTY_7} or {@link SeleniumTestCase#TOMCAT_6}.
042     * Defaults to {@link SeleniumTestCase#JETTY_7}.
043     */
044    String container() default SeleniumTestCase.JETTY_7;
045
046    /**
047     * The context path to make the application available under. Defaults to "", i.e. the context root.
048     */
049    String contextPath() default "";
050
051    /**
052     * The port to listen on for HTTP requests. Defaults to "9090".
053     */
054    int port() default 9090;
055
056    /**
057     * The port to listen on fot HTTPS requests. Defaults to "8443".
058     */
059    int sslPort() default 8443;
060
061    /**
062     * The browser start command to use with Selenium. Defaults to "*firefox".
063     */
064    String browserStartCommand() default "*firefox";
065}