001    /*
002     * Created on Dec 12, 2004
003     *
004     * Copyright 2004 Chris Nelson
005     * 
006     * Licensed under the Apache License, Version 2.0 (the "License"); 
007     * you may not use this file except in compliance with the License. 
008     * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
009     * Unless required by applicable law or agreed to in writing, 
010     * software 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 limitations under the License.
013     */
014    package org.tynamo.test;
015    
016    import com.gargoylesoftware.htmlunit.html.HtmlPage;
017    import org.testng.Assert;
018    import org.testng.annotations.BeforeClass;
019    import org.testng.annotations.BeforeTest;
020    
021    import java.io.IOException;
022    import java.net.URL;
023    import java.util.Properties;
024    
025    public class FunctionalTest extends AbstractContainerTest
026    {
027    
028            protected HtmlPage startPage;
029    
030            @BeforeClass
031            public void startContainer() throws Exception
032            {
033                    //do nothing! we don't need to start the container here.
034                    //it will be started externally
035            }
036    
037    
038            @BeforeTest
039            public void configureWebClient()
040            {
041                    Properties testProperties = new Properties();
042                    try
043                    {
044                            testProperties.load(this.getClass().getResourceAsStream("/functionaltest.properties"));
045                            startPage = (HtmlPage) webClient.getPage(new URL(testProperties.getProperty("test.url")));
046                    } catch (IOException e)
047                    {
048                            Assert.fail(e.getMessage());
049                    }
050    
051                    // disabling javascript for all the functional test cases
052                    webClient.setJavaScriptEnabled(false);
053                    super.configureWebClient();
054            }
055    }