亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? abstracttestcase.java

?? struts的源代碼
?? JAVA
字號(hào):
/*
 * Copyright 2002,2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.struts.faces.sysclient;

import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlBody;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlHead;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.apache.commons.httpclient.Cookie;
import org.apache.commons.httpclient.HttpState;



/**
 * <p>Abstract base class for system integration tests based on HtmlUnit.</p>
 *
 * @version $Rev: 54934 $ $Date: 2004-10-16 18:07:50 +0100 (Sat, 16 Oct 2004) $
 */

public abstract class AbstractTestCase extends TestCase {


    // ------------------------------------------------------------ Constructors


    /**
     * <p>Construct a new instance of this test case.</p>
     *
     * @param name Name of the new test case
     */
    public AbstractTestCase(String name) {

        super(name);

    }


    // ------------------------------------------------------ Instance Variables


    /**
     * <p>The HTTP state information for this test case.</p>
     */
    protected HttpState httpState = null;


    /**
     * <p>The most recently retrieved page from the server.</p>
     */
    protected HtmlPage page = null;


    /**
     * <p>The calculated URL for the installed "systest" web application.
     * This value is based on a system property named <code>systest</code>,
     * which must be defined as part of the command line that executes
     * each test case.</p>
     */
    protected URL url = null;


    /**
     * <p>The web client for this test case.</p>
     */
    protected WebClient webClient = null;


    // ------------------------------------------------------ Test Setup Methods


    /**
     * <p>Set up the instance variables required for this test case.</p>
     */
    public void setUp() throws Exception {

        // Calculate the URL for the installed "systest" web application
        String systest = System.getProperty("systest");
        url = new URL(systest + "/");

        // Initialize HtmlUnit constructs for this test case
        webClient = new WebClient();
        httpState = webClient.getWebConnection().getStateForUrl(url("/"));

    }


    /**
     * <p>Return the set of tests included in this test suite.</p>
     */
    public static Test suite() {

        return (new TestSuite(AbstractTestCase.class));

    }


    /**
     * <p>Tear down instance variables required by this test case.</p>
     */
    public void tearDown() {

        httpState = null;
        page = null;
        // sessionId = null;
        url = null;
        webClient = null;

    }



    // ------------------------------------------------------- Protected Methods


    /**
     * <p>Return the body element for the most recently retrieved page.
     * If there is no such element, return <code>null</code>.</p>
     */
    protected HtmlBody body() throws Exception {

        Iterator elements = page.getChildElements().iterator();
        while (elements.hasNext()) {
            HtmlElement element = (HtmlElement) elements.next();
            if (element instanceof HtmlBody) {
                return ((HtmlBody) element);
            }
        }
        return (null);

    }


    /**
     * <p>Return the HTML element with the specified <code>id</code> from the
     * most recently retrieved page.  If there is no such element, return
     * <code>null</code>.</p>
     *
     * @param id Identifier of the requested element.
     */
    protected HtmlElement element(String id) throws Exception {

        try {
            return (page.getHtmlElementById(id));
        } catch (ElementNotFoundException e) {
            return (null);
        }

    }


    /**
     * <p>Return the form with the specified <code>id</code> from the most
     * recently retrieved page.  If there is no such form, return
     * <code>null</code>.<p>
     *
     * @param id Identifier of the requested form.
     */
    protected HtmlForm form(String id) throws Exception {

        Iterator forms = page.getAllForms().iterator();
        while (forms.hasNext()) {
            HtmlForm form = (HtmlForm) forms.next();
            if (id.equals(form.getAttributeValue("id"))) {
                return (form);
            }
        }
        return (null);

    }


    /**
     * <p>Return the head element for the most recently retrieved page.
     * If there is no such element, return <code>null</code>.</p>
     */
    protected HtmlHead head() throws Exception {

        Iterator elements = page.getChildElements().iterator();
        while (elements.hasNext()) {
            HtmlElement element = (HtmlElement) elements.next();
            if (element instanceof HtmlHead) {
                return ((HtmlHead) element);
            }
        }
        return (null);

    }


    /**
     * <p>Click the specified hyperlink, and retrieve the subsequent page,
     * saving a reference so that other utility methods may be used to
     * retrieve information from it.</p>
     *
     * @param anchor Anchor component to click
     *
     * @exception IOException if an input/output error occurs
     */
    protected HtmlPage link(HtmlAnchor anchor) throws IOException {

        HtmlPage page = (HtmlPage) anchor.click();
        this.page = page;
        return page;

    }


    /**
     * <p>Retrieve and return the page at the specified context relative path.
     * Save a reference to this page so that other utility methods may be used
     * to retrieve information from it.</p>
     *
     * @param path Context relative path
     *
     * @exception IllegalArgumentException if the context relative path
     *  does not begin with a '/' character
     */
    protected HtmlPage page(String path) throws Exception {

        HtmlPage page = (HtmlPage) webClient.getPage(url(path));
        /*
        if (sessionId == null) {
            saveSessionId(page);
        }
        */
        this.page = page;
        return (page);

    }


    /**
     * <p>Submit the current page, using the specified component, and retrieve
     * the subsequent page, saving a reference so that other utility methods
     * may be used to retrieve information from it.</p>
     *
     * @param submit Submit button component to click
     *
     * @exception IOException if an input/output error occurs
     */
    protected HtmlPage submit(HtmlSubmitInput submit) throws IOException {

        HtmlPage page = (HtmlPage) submit.click();
        this.page = page;
        return page;

    }


    /**
     * <p>Return the page title from the most recently retrieved page.
     * Any leading and trailing whitespace will be trimmed.</p>
     */
    protected String title() throws Exception {

        return (page.getTitleText().trim());

    }


    /**
     * <p>Calculate and return an absolute URL for the specified context
     * relative path, which must begin with a '/' character.</p>
     *
     * @param path Context relative path
     *
     * @exception IllegalArgumentException if the context relative path
     *  does not begin with a '/' character
     */
    protected URL url(String path) throws Exception {

        if (path.charAt(0) != '/') {
            throw new IllegalArgumentException("Context path '" + path +
                                               "' does not start with '/'");
        }
        return new URL(url, path.substring(1));

    }


}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品日产第一区二区三区高清版| 日韩高清在线电影| 中文字幕日韩av资源站| 91精品办公室少妇高潮对白| 日本欧美肥老太交大片| 国产亚洲午夜高清国产拍精品| 色综合天天综合网天天狠天天| 欧美aaaaaa午夜精品| 国产精品美日韩| 91麻豆精品国产91久久久更新时间| 日本欧美韩国一区三区| 欧美精品 日韩| 久久99久久久久| 欧美国产在线观看| 色综合久久88色综合天天免费| 亚洲免费观看高清完整| 欧美在线播放高清精品| 国产真实乱对白精彩久久| 久久久www成人免费毛片麻豆| 色综合天天狠狠| 亚洲成a人v欧美综合天堂下载 | 国产精品一二一区| 亚洲一区二区三区四区不卡| 久久综合精品国产一区二区三区 | 国产原创一区二区| 怡红院av一区二区三区| 久久久精品中文字幕麻豆发布| 成人动漫视频在线| 亚洲综合一区二区| 欧美韩国日本不卡| 在线播放/欧美激情| 91一区在线观看| 国内久久精品视频| 国产欧美精品在线观看| 欧美亚洲动漫精品| 91视频一区二区| 国产成人aaa| 韩国成人福利片在线播放| 亚洲超碰97人人做人人爱| 中文字幕一区二区视频| 国产欧美日本一区二区三区| 日韩欧美国产成人一区二区| 在线观看视频一区二区欧美日韩| 国产精品主播直播| 美女精品自拍一二三四| 天堂一区二区在线| 亚洲一区二区三区自拍| 亚洲永久精品国产| 亚洲韩国精品一区| 亚洲成av人片一区二区| 一区二区三区不卡视频| 国产精品久久三区| 亚洲精品免费看| 日本在线观看不卡视频| 色综合中文字幕| 久久久久97国产精华液好用吗| 亚洲已满18点击进入久久| 盗摄精品av一区二区三区| 欧美一区二视频| 久久精品人人爽人人爽| 亚洲天堂久久久久久久| 五月综合激情婷婷六月色窝| 国产成人免费视频| 欧美精品久久99| 中文字幕一区二区三区在线不卡 | 欧美电影影音先锋| 欧美高清视频在线高清观看mv色露露十八 | 91麻豆精品国产91久久久久| 久久影视一区二区| 亚洲国产欧美一区二区三区丁香婷| 日本特黄久久久高潮| 99久久99久久综合| 精品国产一区二区亚洲人成毛片| 国产精品网曝门| 高清久久久久久| 亚洲综合色噜噜狠狠| 日韩精品免费视频人成| 91精品国产综合久久福利| 中文字幕成人在线观看| 国产精品视频第一区| 国产精品1区2区| 国产欧美一区二区精品仙草咪| 美腿丝袜亚洲一区| 精品国产一区a| 国产一区二区美女| 中文字幕在线观看不卡视频| 国产成人免费视频网站| 亚洲视频小说图片| 在线观看中文字幕不卡| 午夜一区二区三区在线观看| 懂色av一区二区三区免费观看| 极品销魂美女一区二区三区| 亚洲高清免费一级二级三级| 精品一区二区三区不卡 | 欧美精品高清视频| 久久免费看少妇高潮| 亚洲一区电影777| 色94色欧美sute亚洲线路一ni | 亚洲国产中文字幕| 韩国成人在线视频| 男男视频亚洲欧美| 97久久精品人人做人人爽| 91精品国产免费久久综合| 综合亚洲深深色噜噜狠狠网站| 久久草av在线| 91首页免费视频| 亚洲人123区| 欧美主播一区二区三区美女| 国产精品免费av| 懂色av噜噜一区二区三区av| 亚洲欧美国产毛片在线| 精品欧美乱码久久久久久| 欧美一区二区三区在线| 日本不卡中文字幕| 色av一区二区| 国产精品美女久久久久av爽李琼| 日本不卡一区二区| 欧美日韩免费视频| 亚洲精品伦理在线| 成人av动漫在线| 国产女人aaa级久久久级 | 久久99国产乱子伦精品免费| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产午夜精品久久| 国产高清不卡二三区| 精品国产乱码久久久久久老虎| 日本不卡不码高清免费观看| 欧美日韩中文精品| 天天操天天干天天综合网| 欧美日韩美少妇| 午夜精品成人在线视频| 欧美日韩视频不卡| 视频在线观看国产精品| 欧美午夜电影一区| 亚洲一区在线观看免费 | 亚洲精品一区二区三区蜜桃下载 | 日韩欧美资源站| 亚洲成年人影院| 欧美精品在线观看播放| 亚洲一区在线看| 欧美午夜寂寞影院| 一区二区三区四区在线免费观看| 成人免费电影视频| 国产日韩欧美不卡在线| 国产成人啪午夜精品网站男同| 欧美videos大乳护士334| 热久久久久久久| 日韩精品一区二区三区四区视频 | 亚洲免费观看高清| 91激情在线视频| 亚洲三级在线免费观看| 99精品视频在线免费观看| 欧美成人猛片aaaaaaa| 卡一卡二国产精品| 精品乱码亚洲一区二区不卡| 精品91自产拍在线观看一区| 久久99久久久欧美国产| 国产精品视频线看| 91精品国产91热久久久做人人 | 亚洲日本乱码在线观看| 99re在线精品| 久久精品国产久精国产爱| 亚洲欧美激情小说另类| 日本丶国产丶欧美色综合| 寂寞少妇一区二区三区| 一区二区三区日本| 国产精品―色哟哟| 日韩欧美在线综合网| 韩日av一区二区| 日韩成人精品在线观看| 日韩一区在线看| 日韩精品中文字幕一区二区三区| 欧美日韩精品一区视频| 成人高清伦理免费影院在线观看| 国产suv一区二区三区88区| 欧美午夜一区二区三区| 欧美疯狂性受xxxxx喷水图片| 国产精品香蕉一区二区三区| 精品av综合导航| 欧美日韩国产美| 在线观看免费一区| 一道本成人在线| 精品国产一区二区三区四区四| 美女在线一区二区| 日韩午夜av电影| 欧美男人的天堂一二区| 国产乱一区二区| 一区二区三区四区在线免费观看| 欧美精品vⅰdeose4hd| 国产伦精品一区二区三区在线观看| 欧美精品在线观看一区二区| 高清国产一区二区| 午夜电影久久久| 国产精品私人自拍| 欧美精选一区二区| 精品一区二区av| 在线精品视频免费播放| 欧美午夜精品免费| 日韩视频永久免费| 在线观看免费视频综合|