All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.allure.storages.TestRunStorage Maven / Gradle / Ivy

package ru.yandex.qatools.allure.storages;

import ru.yandex.qatools.allure.model.TestSuiteResult;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Dmitry Baev [email protected]
 *         Date: 06.11.13
 */
public final class TestRunStorage {

    private static final Map testRunData = new ConcurrentHashMap<>();

    private TestRunStorage() {
    }

    private static void checkTestRun(String uid) {
        if (!testRunData.containsKey(uid)) {
            testRunData.put(uid, new TestSuiteResult());
        }
    }

    public static TestSuiteResult getTestRun(String uid) {
        checkTestRun(uid);
        return testRunData.get(uid);
    }

    public static TestSuiteResult pollTestRun(String uid) {
        checkTestRun(uid);
        return testRunData.remove(uid);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy