本文整理汇总了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);
}
}
}
示例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;
}
示例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()
+ "' " : "");
}
};
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
示例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()));
}
示例12: validate
import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
return StringUtils.hasContent(value);
}
示例13: validate
import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
return StringUtils.hasContent(variableName);
}
示例14: validate
import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
return StringUtils.hasContent(variableName) && StringUtils.hasContent(variableValue);
}
示例15: validate
import com.eviware.soapui.support.StringUtils; //导入方法依赖的package包/类
@Override
public boolean validate() {
return StringUtils.hasContent(script);
}