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


Java StringUtils.hasContent方法代码示例

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


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

示例1: convertParameters

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
private void convertParameters(RestParamsPropertyHolder propertyHolder) {
    for (TestProperty property : propertyHolder.getPropertyList()) {
        if (property instanceof RestParamProperty && ((RestParamProperty) property).getStyle() == ParameterStyle.TEMPLATE) {
            property.setValue("{{" + property.getName() + "}}");
        }
        String convertedValue = VariableUtils.convertVariables(property.getValue());

        property.setValue(convertedValue);
        if (property instanceof RestParamProperty && StringUtils.hasContent(property.getDefaultValue())) {
            if (((RestParamProperty) property).getStyle() == ParameterStyle.TEMPLATE) {
                ((RestParamProperty) property).setDefaultValue("{{" + property.getName() + "}}");
            }
            convertedValue = VariableUtils.convertVariables(property.getDefaultValue());
            ((RestParamProperty) property).setDefaultValue(convertedValue);
        }
    }
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:18,代码来源:PostmanImporter.java

示例2: grabConnections

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
private static ArrayList<Connection> grabConnections(Project project){
    ArrayList<Connection> result = null;
    String settingValue = project.getSettings().getString(CONNECTIONS_SETTING_NAME, "");
    if(StringUtils.hasContent(settingValue)) {
        XmlObject root = null;
        try {
            root = XmlObject.Factory.parse(settingValue);
        }
        catch (XmlException e) {
            SoapUI.logError(e);
            return result;
        }
        result = new ArrayList<Connection>();
        XmlObject[] connectionSections = root.selectPath("$this/" + CONNECTION_SECTION_NAME);
        for(XmlObject section : connectionSections){
            Connection connection = new Connection();
            connection.load(section);
            result.add(connection);
        }
    }
    return result;
}
 
开发者ID:SmartBear,项目名称:ready-mqtt-plugin,代码行数:23,代码来源:ConnectionsManager.java

示例3: websocketException

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
public WebSocketException websocketException(final String message, final CloseReason closeReason) {
    return new WebSocketException(message) {

        @Override
        public CloseReason getCloseReason() {
            return closeReason;
        }

        @Override
        public String toString() {
            return getMessage()
                    + " ["
                    + closeReason.getCloseCode().getCode()
                    + "] "
                    + closeReason.getCloseCode()
                    + (StringUtils.hasContent(closeReason.getReasonPhrase()) ? " '" + closeReason.getReasonPhrase()
                            + "' " : "");
        }
    };
}
 
开发者ID:hschott,项目名称:ready-websocket-plugin,代码行数:21,代码来源:TyrusClient.java

示例4: grabConnections

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
private static ArrayList<Connection> grabConnections(Project project) {
    ArrayList<Connection> result = null;
    String settingValue = project.getSettings().getString(CONNECTIONS_SETTING_NAME, "");
    if (StringUtils.hasContent(settingValue)) {
        XmlObject root = null;
        try {
            root = XmlObject.Factory.parse(settingValue);
        } catch (XmlException e) {
            LOGGER.error(e);
            return result;
        }
        result = new ArrayList<Connection>();
        XmlObject[] connectionSections = root.selectPath("$this/" + CONNECTION_SECTION_NAME);
        for (XmlObject section : connectionSections) {
            Connection connection = new Connection();
            connection.load(section);
            result.add(connection);
        }
    }
    return result;
}
 
开发者ID:hschott,项目名称:ready-websocket-plugin,代码行数:22,代码来源:ConnectionsManager.java

示例5: execute

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public Object execute() {
    if (StringUtils.hasContent(condition)) {
        if (condition.startsWith(NOT_EQUAL)) {
            return addInvalidStatusAssertion();
        }
    }
    return addValidStatusAssertion();
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:10,代码来源:AddHttpCodeAssertionCommand.java

示例6: addValidStatusAssertion

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
private Object addValidStatusAssertion() {
    ValidHttpStatusCodesAssertion assertion = getValidHttpStatusCodesAssertion();
    String codes = assertion.getCodes();
    if (StringUtils.hasContent(codes)) {
        assertion.setCodes(codes + "," + value);
    } else {
        assertion.setCodes(value);
    }
    return null;
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:11,代码来源:AddHttpCodeAssertionCommand.java

示例7: addInvalidStatusAssertion

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
private Object addInvalidStatusAssertion() {
    InvalidHttpStatusCodesAssertion assertion = getInvalidHttpStatusCodesAssertion();
    String codes = assertion.getCodes();
    if (StringUtils.hasContent(codes)) {
        assertion.setCodes(codes + "," + value);
    } else {
        assertion.setCodes(value);
    }
    return null;
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:11,代码来源:AddHttpCodeAssertionCommand.java

示例8: perform

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public void perform(WorkspaceImpl workspace, Object param) {
    if (dialog == null) {
        dialog = ADialogBuilder.buildDialog(Form.class);
    } else {
        dialog.setValue(Form.POSTMAN_COLLECTION_FILE, "");
    }

    while (dialog.show()) {
        try {
            String fieldValue = dialog.getValue(Form.POSTMAN_COLLECTION_FILE);
            if (StringUtils.hasContent(fieldValue)) {
                String filePath = fieldValue.trim();
                if (StringUtils.hasContent(filePath)) {
                    if (new File(filePath).exists()) {
                        PostmanImporter importer = new PostmanImporter(new GuiTestCreator());
                        importer.importPostmanCollection(workspace, filePath);
                        sendAnalytics();
                    }
                    break;
                }
            }
        } catch (Exception ex) {
            UISupport.showErrorMessage(ex);
        }
    }
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:28,代码来源:ImportPostmanCollectionAction.java

示例9: readData

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
protected void readData(XmlObjectConfigurationReader reader){
    if(connection != null) {
        connection.removePropertyChangeListener(this);
        connection = null;
    }
    if(reader.readBoolean(LEGACY_CONNECTION_PROP_NAME, true)){
        connection = new Connection();
        connection.setServerUri(reader.readString(SERVER_URI_PROP_NAME, ""));
        connection.setFixedId(reader.readString(CLIENT_ID_PROP_NAME, ""));
        connection.setLogin(reader.readString(LOGIN_PROP_NAME, ""));
        connection.setPassword(reader.readString(PASSWORD_PROP_NAME, ""));
        connection.setCleanSession(true);
        connection.addPropertyChangeListener(this);
        legacyConnection = connection;
    }
    else{
        String connectionName = reader.readString(CONNECTION_NAME_PROP_NAME, "");
        if(StringUtils.hasContent(connectionName)) {
            connection = ConnectionsManager.getConnection(this, connectionName);
        }
        if(connection != null) connection.addPropertyChangeListener(this);
    }
    timeout = reader.readInt(TIMEOUT_PROP_NAME, 30000);
    try {
        timeoutMeasure = TimeMeasure.valueOf(reader.readString(TIMEOUT_MEASURE_PROP_NAME, TimeMeasure.Milliseconds.toString()));
    } catch(NumberFormatException | NullPointerException e) {
        timeoutMeasure = TimeMeasure.Milliseconds;
    }
}
 
开发者ID:SmartBear,项目名称:ready-mqtt-plugin,代码行数:30,代码来源:MqttConnectedTestStep.java

示例10: getExceptionMessage

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
public static String getExceptionMessage(Throwable e){
    String result = StringUtils.hasContent(e.getMessage())? String.format("%s \"%s\"", e.getClass().getName(), e.getMessage()) : e.getClass().getName();
    if(e.getCause() != null){
        result += "; cause: " + getExceptionMessage(e.getCause());
    }
    return result;
}
 
开发者ID:SmartBear,项目名称:ready-mqtt-plugin,代码行数:8,代码来源:Utils.java

示例11: readData

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
protected void readData(XmlObjectConfigurationReader reader) {
    if (connection != null) {
        connection.removePropertyChangeListener(this);
        connection = null;
    }
    String connectionName = reader.readString(CONNECTION_NAME_PROP_NAME, "");
    if (StringUtils.hasContent(connectionName))
        connection = ConnectionsManager.getConnection(this, connectionName);
    if (connection != null)
        connection.addPropertyChangeListener(this);

    timeout = reader.readInt(TIMEOUT_PROP_NAME, 30000);
    timeoutMeasure = TimeMeasure.valueOf(reader.readString(TIMEOUT_MEASURE_PROP_NAME,
            TimeMeasure.Milliseconds.name()));
}
 
开发者ID:hschott,项目名称:ready-websocket-plugin,代码行数:16,代码来源:ConnectedTestStep.java

示例12: validate

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
    return StringUtils.hasContent(value);
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:5,代码来源:AddEqualsAssertionCommand.java

示例13: validate

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
    return StringUtils.hasContent(variableName);
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:5,代码来源:GetGlobalVariableCommand.java

示例14: validate

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
    return StringUtils.hasContent(variableName) && StringUtils.hasContent(variableValue);
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:5,代码来源:SetGlobalVariableCommand.java

示例15: validate

import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
    return StringUtils.hasContent(script);
}
 
开发者ID:SmartBear,项目名称:readyapi-postman-plugin,代码行数:5,代码来源:AddScriptAssertionCommand.java


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