當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。