当前位置: 首页>>代码示例>>Java>>正文


Java ResponseAssertion.setToEqualsType方法代码示例

本文整理汇总了Java中org.apache.jmeter.assertions.ResponseAssertion.setToEqualsType方法的典型用法代码示例。如果您正苦于以下问题:Java ResponseAssertion.setToEqualsType方法的具体用法?Java ResponseAssertion.setToEqualsType怎么用?Java ResponseAssertion.setToEqualsType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jmeter.assertions.ResponseAssertion的用法示例。


在下文中一共展示了ResponseAssertion.setToEqualsType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTestElement

import org.apache.jmeter.assertions.ResponseAssertion; //导入方法依赖的package包/类
public TestElement getTestElement() {
    Preconditions.checkNotNull(name);
    Preconditions.checkNotNull(testString);

    ResponseAssertion assertion = new ResponseAssertion();
    assertion.setProperty(TestElement.GUI_CLASS, AssertionGui.class.getName());
    assertion.setProperty(TestElement.TEST_CLASS, ResponseAssertion.class.getName());
    assertion.setName(name);
    assertion.setEnabled(true);
    switch (responseField) {
        case TEXT:
            assertion.setTestFieldResponseData();
            break;
        case DOCUMENT:
            assertion.setTestFieldResponseDataAsDocument();
            break;
        case URL:
            assertion.setTestFieldURL();
            break;
        case RESPONSE_CODE:
            assertion.setTestFieldResponseCode();
            break;
        case RESPONSE_MESSAGE:
            assertion.setTestFieldResponseMessage();
            break;
        case RESPONSE_HEADERS:
            assertion.setTestFieldResponseHeaders();
            break;
    }
    if (ignoreStatus) assertion.setAssumeSuccess(!ignoreStatus);
    switch (responsePatternType) {
        case CONTAINS:
            assertion.setToContainsType();
            break;
        case MATCHES:
            assertion.setToMatchType();
            break;
        case EQUALS:
            assertion.setToEqualsType();
            break;
        case SUBSTRING:
            assertion.setToSubstringType();
            break;
    }
    if (not) assertion.setToNotType();
    assertion.addTestString(testString);
    return assertion;
}
 
开发者ID:lithiumtech,项目名称:mineraloil-jmeter,代码行数:49,代码来源:ResponseAssertionElement.java

示例2: modifyTestElement

import org.apache.jmeter.assertions.ResponseAssertion; //导入方法依赖的package包/类
@Override
public void modifyTestElement(TestElement el) {
    GuiUtils.stopTableEditing(stringTable);
    configureTestElement(el);
    if (el instanceof ResponseAssertion) {
        ResponseAssertion ra = (ResponseAssertion) el;

        saveScopeSettings(ra);

        ra.clearTestStrings();
        String[] testStrings = tableModel.getData().getColumn(COL_RESOURCE_NAME);
        for (String testString : testStrings) {
            ra.addTestString(testString);
        }

        if (responseStringButton.isSelected()) {
            ra.setTestFieldResponseData();
        } else if (responseAsDocumentButton.isSelected()) {
            ra.setTestFieldResponseDataAsDocument();
        } else if (responseCodeButton.isSelected()) {
            ra.setTestFieldResponseCode();
        } else if (responseMessageButton.isSelected()) {
            ra.setTestFieldResponseMessage();
        } else if (responseHeadersButton.isSelected()) {
            ra.setTestFieldResponseHeaders();
        } else { // Assume URL
            ra.setTestFieldURL();
        }

        ra.setAssumeSuccess(assumeSuccess.isSelected());

        if (containsBox.isSelected()) {
            ra.setToContainsType();
        } else if (equalsBox.isSelected()) {
            ra.setToEqualsType();
        } else if (substringBox.isSelected()) {
            ra.setToSubstringType();
        } else {
            ra.setToMatchType();
        }

        if (notBox.isSelected()) {
            ra.setToNotType();
        } else {
            ra.unsetNotType();
        }
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:49,代码来源:AssertionGui.java


注:本文中的org.apache.jmeter.assertions.ResponseAssertion.setToEqualsType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。