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    
015    package org.apache.tapestry5.test;
016    
017    import org.testng.ITestContext;
018    import 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
028    public 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         * Invoked from {@link #startup(String, String, int, String, ITestContext)} to launch the web
040         * server to be
041         * tested. The return value is a Runnable that will shut down the launched server at the end of
042         * the test (it is coded this way so that the default Jetty web server can be more easily
043         * replaced).
044         * 
045         * @param webAppFolder
046         *            path to the web application context
047         * @param contextPath
048         *            the path the context is mapped to, usually the empty string
049         * @param port
050         *            the port number the server should handle
051         * @param sslPort
052         *            the port number on which the server should handle secure requests
053         * @return Runnable used to shut down the server
054         * @throws Exception
055         */
056        protected Runnable launchWebServer(String webAppFolder, String contextPath, int port, int sslPort) throws Exception
057        {
058            return null;
059        }
060    }