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

com.teamscale.client.TestDetails Maven / Gradle / Ivy

Go to download

A tiny service client that only supports Teamscale's the external upload interface and impacted-tests service.

There is a newer version: 34.2.0
Show newest version
package com.teamscale.client;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

/**
 * Contains details about a test.
 */
public class TestDetails {

	/** Unique name of the test case by using a path like hierarchical description, which can be shown in the UI. */
	public String uniformPath;

	/**
	 * Path to the source of the method. Will be equal to uniformPath in most cases, but e.g. @Test methods in a base
	 * class will have the sourcePath pointing to the base class which contains the actual implementation whereas
	 * uniformPath will contain the the class name of the most specific subclass, from where it was actually executed.
	 */
	public String sourcePath;

	/**
	 * Some kind of content to tell whether the test specification has changed. Can be revision number or hash over the
	 * specification or similar. You can include e.g. a hash of each test's test data so that whenever the test data
	 * changes, the corresponding test is re-run.
	 */
	public String content;

	@JsonCreator
	public TestDetails(@JsonProperty("uniformPath") String uniformPath, @JsonProperty("sourcePath") String sourcePath,
					   @JsonProperty("content") String content) {
		this.uniformPath = uniformPath;
		this.sourcePath = sourcePath;
		this.content = content;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		TestDetails that = (TestDetails) o;
		return Objects.equals(uniformPath, that.uniformPath) &&
				Objects.equals(sourcePath, that.sourcePath) &&
				Objects.equals(content, that.content);
	}

	@Override
	public int hashCode() {
		return Objects.hash(uniformPath, sourcePath, content);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy