Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.aventstack.chaintest.domain;
import com.aventstack.chaintest.util.ExceptionsUtil;
import com.aventstack.chaintest.util.TimeUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Queue;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.stream.Stream;
/**
* Represents a test in the ChainTest framework.
* This class contains information about the test such as its name, description,
* class name, start and end times, result, tags, error details, and child tests.
* It also provides methods to complete the test and update its statistics.
*/
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class Test implements ChainTestEntity {
/**
* The unique identifier for the test.
*/
private long id;
/**
* The identifier for the build associated with the test.
*/
private long buildId;
/**
* The identifier for the project associated with the test.
*/
private long projectId;
/**
* The unique client identifier for the test.
*/
private final UUID clientId = UUID.randomUUID();
/**
* The external identifier for the test.
*/
private String externalId;
/**
* The name of the test.
*/
private String name;
/**
* The description of the test.
*/
private String description;
/**
* The class name associated with the test.
*/
private String className;
/**
* The start time of the test in milliseconds.
*/
private long startedAt = System.currentTimeMillis();
/**
* The end time of the test in milliseconds.
*/
private long endedAt;
/**
* The duration of the test in milliseconds.
*/
private long durationMs;
/**
* The result of the test.
*/
private String result = Result.PASSED.getResult();
/**
* The tags associated with the test.
*/
private final Set tags = new HashSet<>();
/**
* The error details if the test failed.
*/
private String error;
/**
* The child tests of this test.
*/
private Queue children = new ConcurrentLinkedQueue<>();
/**
* The logs associated with the test.
*/
private final List logs = Collections.synchronizedList(new ArrayList<>());
/**
* The embedded media associated with the test.
*/
private final List