org.testng.internal.Utils.isStringNotEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.testng.internal.Utils.isStringNotEmpty()方法的一些代码示例,展示了Utils.isStringNotEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.isStringNotEmpty()方法的具体详情如下:
包路径:org.testng.internal.Utils
类名称:Utils
方法名:isStringNotEmpty

Utils.isStringNotEmpty介绍

暂无

代码示例

代码示例来源:origin: org.testng/testng

/**
 * Sets the output directory where the reports will be created.
 * @param outputdir The directory.
 */
public void setOutputDirectory(final String outputdir) {
 if (isStringNotEmpty(outputdir)) {
  m_outputDir = outputdir;
 }
}

代码示例来源:origin: cbeust/testng

/**
 * Sets the output directory where the reports will be created.
 *
 * @param outputdir The directory.
 */
public void setOutputDirectory(final String outputdir) {
 if (isStringNotEmpty(outputdir)) {
  m_outputDir = outputdir;
 }
}

代码示例来源:origin: org.testng/testng

private void generateExcludedMethodsReport(XmlSuite xmlSuite, ISuite suite) {
  Collection<ITestNGMethod> excluded = suite.getExcludedMethods();
 StringBuilder sb2 = new StringBuilder("<h2>Methods that were not run</h2><table>\n");
  for (ITestNGMethod method : excluded) {
   ConstructorOrMethod m = method.getConstructorOrMethod();
   if (m != null) {
    sb2.append("<tr><td>")
    .append(m.getDeclaringClass().getName()).append(".").append(m.getName());
    String description = method.getDescription();
    if(isStringNotEmpty(description)) {
     sb2.append("<br/>").append(SP2).append("<i>").append(description).append("</i>");
    }
    sb2.append("</td></tr>\n");
   }
  }
  sb2.append("</table>");
  Utils.writeFile(getOutputDirectory(xmlSuite), METHODS_NOT_RUN, sb2.toString());
}

代码示例来源:origin: cbeust/testng

private void generateExcludedMethodsReport(XmlSuite xmlSuite, ISuite suite) {
 Collection<ITestNGMethod> excluded = suite.getExcludedMethods();
 StringBuilder sb2 = new StringBuilder("<h2>Methods that were not run</h2><table>\n");
 for (ITestNGMethod method : excluded) {
  ConstructorOrMethod m = method.getConstructorOrMethod();
  if (m != null) {
   sb2.append("<tr><td>")
     .append(m.getDeclaringClass().getName())
     .append(".")
     .append(m.getName());
   String description = method.getDescription();
   if (isStringNotEmpty(description)) {
    sb2.append("<br/>").append(SP2).append("<i>").append(description).append("</i>");
   }
   sb2.append("</td></tr>\n");
  }
 }
 sb2.append("</table>");
 Utils.writeFile(getOutputDirectory(xmlSuite), METHODS_NOT_RUN, sb2.toString());
}

代码示例来源:origin: org.testng/testng

public ClassImpl(ITestContext context, Class<?> cls, XmlClass xmlClass, Object instance,
         Map<Class<?>, IClass> classes, IAnnotationFinder annotationFinder,
         ITestObjectFactory objectFactory) {
 m_testContext = context;
 m_class = cls;
 m_classes = classes;
 m_xmlClass = xmlClass;
 m_annotationFinder = annotationFinder;
 m_instance = instance;
 m_objectFactory = objectFactory;
 if (instance instanceof ITest) {
  m_testName = ((ITest) instance).getTestName();
 }
 if (m_testName == null) {
  ITestAnnotation annotation = m_annotationFinder.findAnnotation(cls, ITestAnnotation.class);
  if (annotation != null && !annotation.getTestName().isEmpty()) {
   m_testName = annotation.getTestName();
  }
 }
 m_hasParentModule = isStringNotEmpty(m_testContext.getSuite().getParentModule());
}

代码示例来源:origin: org.testng/testng

public Injector getParentInjector() {
 ISuite suite = m_testContext.getSuite();
 // Reuse the previous parent injector, if any
 Injector injector = suite.getParentInjector();
 if (injector == null) {
  String stageString = suite.getGuiceStage();
  Stage stage;
  if (isStringNotEmpty(stageString)) {
   stage = Stage.valueOf(stageString);
  } else {
   stage = Stage.DEVELOPMENT;
  }
  if (m_hasParentModule) {
   Class<Module> parentModule = (Class<Module>) ClassHelper.forName(suite.getParentModule());
   if (parentModule == null) {
    throw new TestNGException("Cannot load parent Guice module class: " + suite.getParentModule());
   }
   Module module = newModule(parentModule);
   injector = com.google.inject.Guice.createInjector(stage, module);
  } else {
   injector = com.google.inject.Guice.createInjector(stage);
  }
  suite.setParentInjector(injector);
 }
 return injector;
}

代码示例来源:origin: cbeust/testng

public ClassImpl(
  ITestContext context,
  Class<?> cls,
  XmlClass xmlClass,
  Object instance,
  Map<Class<?>, IClass> classes,
  IAnnotationFinder annotationFinder,
  ITestObjectFactory objectFactory) {
 m_testContext = context;
 m_class = cls;
 m_classes = classes;
 m_xmlClass = xmlClass;
 m_annotationFinder = annotationFinder;
 m_instance = instance;
 m_objectFactory = objectFactory;
 if (instance instanceof ITest) {
  m_testName = ((ITest) instance).getTestName();
 }
 if (m_testName == null) {
  ITestAnnotation annotation = m_annotationFinder.findAnnotation(cls, ITestAnnotation.class);
  if (annotation != null && !annotation.getTestName().isEmpty()) {
   m_testName = annotation.getTestName();
  }
 }
 m_hasParentModule = isStringNotEmpty(m_testContext.getSuite().getParentModule());
}

代码示例来源:origin: cbeust/testng

@SuppressWarnings("unchecked")
public Injector getParentInjector() {
 ISuite suite = m_testContext.getSuite();
 // Reuse the previous parent injector, if any
 Injector injector = suite.getParentInjector();
 if (injector == null) {
  String stageString = suite.getGuiceStage();
  Stage stage;
  if (isStringNotEmpty(stageString)) {
   stage = Stage.valueOf(stageString);
  } else {
   stage = Stage.DEVELOPMENT;
  }
  if (m_hasParentModule) {
   Class<Module> parentModule = (Class<Module>) ClassHelper.forName(suite.getParentModule());
   if (parentModule == null) {
    throw new TestNGException(
      "Cannot load parent Guice module class: " + suite.getParentModule());
   }
   Module module = newModule(parentModule);
   injector = com.google.inject.Guice.createInjector(stage, module);
  } else {
   injector = com.google.inject.Guice.createInjector(stage);
  }
  suite.setParentInjector(injector);
 }
 return injector;
}

代码示例来源:origin: org.testng/testng

XmlUtils.setProperty(p, "data-provider-thread-count", String.valueOf(xmlSuite.getDataProviderThreadCount()),
    DEFAULT_DATA_PROVIDER_THREAD_COUNT.toString());
if (isStringNotEmpty(xmlSuite.getTimeOut())) {
  p.setProperty("time-out", xmlSuite.getTimeOut());
  p.setProperty("object-factory", xmlSuite.getObjectFactory().getClass().getName());
if (isStringNotEmpty(xmlSuite.getParentModule())) {
  p.setProperty("parent-module", xmlSuite.getParentModule());
if (isStringNotEmpty(xmlSuite.getGuiceStage())) {
  p.setProperty("guice-stage", xmlSuite.getGuiceStage());

代码示例来源:origin: cbeust/testng

String.valueOf(xmlSuite.getDataProviderThreadCount()),
  DEFAULT_DATA_PROVIDER_THREAD_COUNT.toString());
if (isStringNotEmpty(xmlSuite.getTimeOut())) {
 p.setProperty("time-out", xmlSuite.getTimeOut());
 p.setProperty("object-factory", xmlSuite.getObjectFactory().getClass().getName());
if (isStringNotEmpty(xmlSuite.getParentModule())) {
 p.setProperty("parent-module", xmlSuite.getParentModule());
if (isStringNotEmpty(xmlSuite.getGuiceStage())) {
 p.setProperty("guice-stage", xmlSuite.getGuiceStage());

相关文章