本文整理汇总了Java中com.qmetry.qaf.automation.util.StringUtil.isNotBlank方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isNotBlank方法的具体用法?Java StringUtil.isNotBlank怎么用?Java StringUtil.isNotBlank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.qmetry.qaf.automation.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isNotBlank方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResults
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
@Override
public String getResults(Collection<CheckpointResultBean> bean) {
StringBuilder sb = new StringBuilder(SEC_Header);
for (CheckpointResultBean checkpointResultBean : bean) {
String msg = checkpointResultBean.getMessage();
if (StringUtil.isNotBlank(checkpointResultBean.getScreenshot())) {
msg = msg + formatScreenshot(checkpointResultBean.getScreenshot());
}
sb.append(MessageTypes.valueOf(checkpointResultBean.getType()).formatMessage(msg));
if (!checkpointResultBean.getSubCheckPoints().isEmpty()) {
sb.append(getResults(checkpointResultBean.getSubCheckPoints()));
}
}
sb.append(SEC_Footer);
return sb.toString();
}
示例2: verifyUiElements
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
final public boolean verifyUiElements(String... fieldmapnames) {
Field[] flds = this.getClass().getDeclaredFields();
List<String> includeLst = null;
boolean outcome = true;
if ((fieldmapnames != null) && (fieldmapnames.length > 0)) {
includeLst = Arrays.asList(fieldmapnames);
}
for (Field fld : flds) {
fld.setAccessible(true);
if (fld.isAnnotationPresent(UiElement.class)) {
UiElement map = fld.getAnnotation(UiElement.class);
String mapName = StringUtil.isNotBlank(map.viewLoc()) ? map.viewLoc() : fld.getName();
if ((includeLst == null) || includeLst.contains(mapName)) {
outcome = outcome && verifyUiData(fld);
}
}
}
return outcome;
}
示例3: verifyUiVaules
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
final public boolean verifyUiVaules(String... fieldmapnames) {
Field[] flds = this.getClass().getDeclaredFields();
List<String> includeLst = null;
boolean outcome = true;
if ((fieldmapnames != null) && (fieldmapnames.length > 0)) {
includeLst = Arrays.asList(fieldmapnames);
}
for (Field fld : flds) {
fld.setAccessible(true);
if (fld.isAnnotationPresent(UiElement.class)) {
UiElement map = fld.getAnnotation(UiElement.class);
String mapName = StringUtil.isNotBlank(map.viewLoc()) ? map.viewLoc() : fld.getName();
if ((includeLst == null) || includeLst.contains(mapName)) {
outcome = outcome && verifyUiData(fld);
}
}
}
return outcome;
}
示例4: quoteParams
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
public static String quoteParams(String call) {
String exp = "(\\s|^)\\$\\{[\\w\\.]*}(\\s|$)";
Pattern p = Pattern.compile(exp);
Matcher matcher = p.matcher(call);
String resultString = new String(call);
while (matcher.find()) {
for (int i = 0; i <= matcher.groupCount(); i++) {
String unQuatedparam = (matcher.group(i));
if (StringUtil.isNotBlank(unQuatedparam)) {
String quatedparam =
unQuatedparam.replace("${", "'${").replace("}", "}'");
resultString = new String(StringUtil.replace(new String(resultString),
unQuatedparam, quatedparam));
}
}
}
return resultString;
}
示例5: getTestsFromFile
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
@Factory
public Object[] getTestsFromFile(ITestContext context) {
if (null != context) {
includeGroups = Arrays.asList(context.getIncludedGroups());
excludeGroups = Arrays.asList(context.getExcludedGroups());
}
String sanariosloc = MetaDataScanner.getParameter(context, "scenario.file.loc");
if (StringUtil.isNotBlank(sanariosloc)) {
ConfigurationManager.getBundle().setProperty("scenario.file.loc", sanariosloc);
}
System.out.printf("include groups %s\n exclude groups: %s Scanarios location: %s \n", includeGroups,
excludeGroups, sanariosloc);
logger.info("scenario.file.loc"
+ ConfigurationManager.getBundle().getStringArray("scenario.file.loc", "./scenarios"));
for (String fileName : ConfigurationManager.getBundle().getStringArray("scenario.file.loc", "./scenarios")) {
process(fileName);
}
logger.info("total test found: " + scenarios.size());
return scenarios.toArray(new Object[scenarios.size()]);
}
示例6: parseStepCall
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
protected TestStep parseStepCall(Object[] statement, String referece, int lineNo) {
String currStepName = (String) statement[0];
Object[] currStepArgs = null;
try {
currStepArgs = (StringUtil.isNotBlank((String) statement[1]))
? gson.fromJson((String) statement[1], Object[].class) : null;
} catch (JsonSyntaxException jse) {
logger.error(jse.getMessage() + statement[1], jse);
}
String currStepRes = statement.length > 2 ? (String) statement[2] : "";
StringTestStep step = new StringTestStep(currStepName, currStepArgs);
step.setResultParamName(currStepRes);
step.setFileName(referece);
step.setLineNumber(lineNo);
return step;
}
示例7: beforeInitialize
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
@Override
public void beforeInitialize(Capabilities desiredCapabilities) {
if (ConfigurationUtils.getBaseBundle().getString("remote.server", "").contains("perfecto")) {
String eclipseExecutionId = ConfigurationUtils.getExecutionIdCapability();
if (StringUtil.isNotBlank(eclipseExecutionId)) {
((DesiredCapabilities) desiredCapabilities)
.setCapability("eclipseExecutionId", eclipseExecutionId);
}
}
}
示例8: getFailureMessage
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
private String getFailureMessage(Throwable t) {
if (null == t)
return "";
String msg = t.getMessage();
if (StringUtil.isNotBlank(msg))
return msg;
return t.toString();
}
示例9: deployResult
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
private void deployResult(ITestResult tr, ITestContext context) {
QAFTestBase stb = TestBaseProvider.instance().get();
try {
if ((tr.getMethod() instanceof TestNGScenario) && ((tr.getStatus() == ITestResult.FAILURE)
|| (tr.getStatus() == ITestResult.SUCCESS || tr.getStatus() == ITestResult.SKIP))) {
ConstructorOrMethod testCase = tr.getMethod().getConstructorOrMethod();
testCase.getMethod().getAnnotation(Test.class);
TestCaseRunResult result = tr.getStatus() == ITestResult.SUCCESS ? TestCaseRunResult.PASS
: tr.getStatus() == ITestResult.FAILURE ? TestCaseRunResult.FAIL : TestCaseRunResult.SKIPPED;
// String method = testCase.getName();
String updator = getBundle().getString("result.updator");
if (StringUtil.isNotBlank(updator)) {
Class<?> updatorCls = Class.forName(updator);
TestCaseResultUpdator updatorObj = (TestCaseResultUpdator) updatorCls.newInstance();
TestNGScenario scenario = (TestNGScenario) tr.getMethod();
Map<String, Object> params = new HashMap<String, Object>(scenario.getMetaData());
params.put("duration", tr.getEndMillis() - tr.getStartMillis());
ResultUpdator.updateResult(result, stb.getHTMLFormattedLog() + stb.getAssertionsLog(), updatorObj,
params);
}
}
} catch (Exception e) {
logger.warn("Unable to deploy result", e);
}
}
示例10: getParameter
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
/**
* Get parameter value from the system property, context or configuration.
*
* @param context
* @param parameter
* @return parameter value, first preference is system property, second is
* context and last is configuration/properties.
*/
public static String getParameter(ITestContext context, String parameter) {
if (System.getProperties().containsKey(parameter)) {
return System.getProperty(parameter);
}
String paramValue = null != context ? context.getCurrentXmlTest().getParameter(parameter) : "";
if (StringUtil.isNotBlank(paramValue)) {
return paramValue;
}
return ConfigurationManager.getBundle().getString(parameter);
}
示例11: getMessageFromCause
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
private static String getMessageFromCause(Throwable cause) {
if (cause != null && StringUtil.isNotBlank(cause.getMessage())) {
return cause.getMessage();
}
return cause == null ? "Unknown cause"
: cause.toString().replaceAll(StepInvocationException.class.getCanonicalName() + ": ", "");
}
示例12: getSynonyms
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
/**
* @return Synonyms for keyword defined in properties using
* {@link BDDKeyword} name as key.
*/
public List<String> getSynonyms() {
List<String> synonyms = new ArrayList<String>();
for (Object object : getBundle().getList(name())) {
if (null != object && StringUtil.isNotBlank(object.toString()))
synonyms.add(object.toString());
}
return synonyms;
}
示例13: getClassFinder
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
public static ClassFinder getClassFinder() {
String clsFinderImpl = ConfigurationManager.getBundle().getString("class.finder");
if(StringUtil.isNotBlank(clsFinderImpl)){
try {
Class<?> cls = (Class<?>) Class.forName(clsFinderImpl);
return (ClassFinder) cls.newInstance();
} catch (Exception e) {
e.printStackTrace();
System.err.println("Unable to initiate " + clsFinderImpl + "\n Will use default class finder");
}
}
return new DefaultClassFinder();
}
示例14: QAFExtendedWebElement
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
public static QAFWebElement $(String loc) {
QAFExtendedWebElement eleToReturn = new QAFExtendedWebElement(loc);
String compClass = (String) eleToReturn.getMetaData().get("component-class");
if(StringUtil.isNotBlank(compClass)){
try {
return (QAFWebElement) ComponentFactory.getObject(Class.forName(compClass), loc, null);
} catch (Exception e) {
logger.error(e);
}
}
return eleToReturn;
}
示例15: loadDriverResouces
import com.qmetry.qaf.automation.util.StringUtil; //导入方法依赖的package包/类
private static void loadDriverResouces(String browserName){
String driverResourcesKey = String.format(
ApplicationProperties.DRIVER_RESOURCES_FORMAT.key,
browserName);
String driverResources = ConfigurationManager.getBundle().getString(driverResourcesKey,"");
if(StringUtil.isNotBlank(driverResources)){
ConfigurationManager.addBundle(driverResources);
}
}