001// Copyright 2009, 2010 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.testng.ITestContext;
018import org.testng.annotations.BeforeTest;
019
020/**
021 * This class is no longer necessary (as part of the TAP5-1315 fix) and the reference to it inside testng.xml
022 * may be removed.
023 * 
024 * @since 5.2.0
025 * @deprecated To be removed in Tapestry 5.3.
026 */
027@Deprecated
028public class SeleniumLauncher
029{
030    @BeforeTest(dependsOnGroups =
031    { "beforeStartup" })
032    public void startup() throws Exception
033    {
034        System.err.println("***\n*** Class org.apache.tapestry5.test.SeleniumLauncher is not longer used, and may be\n"
035                + "*** removed from testng.xml.\n***");
036    }
037
038    /**
039     * Launches the web server to be tested. The return value is a Runnable that
040     * will shut down the launched server at the end of the test (it is coded
041     * this way so that the default Jetty web server can be more easily replaced).
042     * 
043     * @param webAppFolder
044     *            path to the web application context
045     * @param contextPath
046     *            the path the context is mapped to, usually the empty string
047     * @param port
048     *            the port number the server should handle
049     * @param sslPort
050     *            the port number on which the server should handle secure requests
051     * @return Runnable used to shut down the server
052     * @throws Exception
053     */
054    protected Runnable launchWebServer(String webAppFolder, String contextPath, int port, int sslPort) throws Exception
055    {
056        return null;
057    }
058}