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


Java ITestResult.getAttribute方法代码示例

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


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

示例1: nab

import org.testng.ITestResult; //导入方法依赖的package包/类
/**
 * If present, get the object from the attributes collection.
 * 
 * @return (optional) stored object
 */
private Optional<?> nab() {
    ITestResult result = Reporter.getCurrentTestResult();
    Object val = result.getAttribute(key);
    if (val != null) {
        return (Optional<?>) val;
    } else {
        return set(null);
    }
}
 
开发者ID:Nordstrom,项目名称:Selenium-Foundation,代码行数:15,代码来源:TestNgBase.java

示例2: recordArtifactPath

import org.testng.ITestResult; //导入方法依赖的package包/类
/**
 * Record the path at which the specified artifact was store in the indicated test result.
 * @param artifactPath path at which the captured artifact was stored 
 * @param result TestNG test result object
 */
private static void recordArtifactPath(Path artifactPath, ITestResult result) {
    @SuppressWarnings("unchecked")
    List<Path> artifactPaths = (List<Path>) result.getAttribute(ARTIFACT_PATHS);
    if (artifactPaths == null) {
        artifactPaths = new ArrayList<>();
        result.setAttribute(ARTIFACT_PATHS, artifactPaths);
    }
    artifactPaths.add(artifactPath);
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:15,代码来源:ArtifactCollector.java

示例3: retrieveArtifactPaths

import org.testng.ITestResult; //导入方法依赖的package包/类
/**
 * Retrieve the paths of artifacts that were stored in the indicated test result.
 * 
 * @param result TestNG test result object
 * @return (optional) list of artifact paths
 */
public static Optional<List<Path>> retrieveArtifactPaths(ITestResult result) {
    @SuppressWarnings("unchecked")
    List<Path> artifactPaths = (List<Path>) result.getAttribute(ARTIFACT_PATHS);
    if (artifactPaths != null) {
        return Optional.of(artifactPaths);
    } else {
        return Optional.empty();
    }
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:16,代码来源:ArtifactCollector.java

示例4: getConfig

import org.testng.ITestResult; //导入方法依赖的package包/类
/**
 * Get the TestNG configuration object for the specified context.
 * 
 * @param testResult configuration context (TestNG test result object)
 * @return TestNG configuration object
 */
public static TestNGConfig getConfig(ITestResult testResult) {
    if (testResult == null) {
        return testNGConfig.get();
    }
    
    TestNGConfig config = (TestNGConfig) testResult.getAttribute(TESTNG_CONFIG);
    
    if (config == null) {
        config = testNGConfig.get();
        testResult.setAttribute(TESTNG_CONFIG, config);
    }
    
    return config;
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:21,代码来源:TestNGConfig.java

示例5: canGet

import org.testng.ITestResult; //导入方法依赖的package包/类
static boolean canGet(ITestResult result) {
    return (null == result.getAttribute(CAPTURE_DISABLED));
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:4,代码来源:UnitTestArtifact.java

示例6: willGet

import org.testng.ITestResult; //导入方法依赖的package包/类
static boolean willGet(ITestResult result) {
    return (null == result.getAttribute(CAPTURE_CRIPPLED));
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:4,代码来源:UnitTestArtifact.java

示例7: getCaptureState

import org.testng.ITestResult; //导入方法依赖的package包/类
static CaptureState getCaptureState(ITestResult result) {
    return (CaptureState) result.getAttribute(CAPTURE_STATE);
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:4,代码来源:UnitTestArtifact.java

示例8: getArtifactPath

import org.testng.ITestResult; //导入方法依赖的package包/类
/**
 * Get the path at which the captured artifact was stored.
 * 
 * @param testResult TestNG test result object
 * @return path at which the captured artifact was stored (may be 'null')
 */
@SuppressWarnings("unchecked")
public static Optional<Path> getArtifactPath(ITestResult testResult) {
    return (Optional<Path>) testResult.getAttribute(ARTIFACT_PATH);
}
 
开发者ID:Nordstrom,项目名称:TestNG-Foundation,代码行数:11,代码来源:UnitTestCapture.java


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