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

org.conqat.engine.sourcecode.coverage.testwise_coverage.FileInfo Maven / Gradle / Ivy

The newest version!
package org.conqat.engine.sourcecode.coverage.testwise_coverage;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.conqat.engine.commons.util.LineRangeDeserializer;
import org.conqat.engine.commons.util.LineRangeSerializer;
import org.conqat.lib.commons.collections.CompactLines;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * Container for detailed information about covered files. This includes paths and coverable lines.
 * File infos are referenced elsewhere in the report by their index in the array.
 *
 * This class is a DTO used to deserialize testwise coverage reports. Field names and structure may
 * not be changed. Present in reports of version 2+.
 */
public class FileInfo {

	private static final String PATH_PROPERTY = "path";

	private static final String COVERABLE_LINES_PROPERTY = "coverableLines";

	/** Path within the repository. */
	@JsonProperty(PATH_PROPERTY)
	public final String path;

	/**
	 * Line range string for the lines in the source code that are considered coverable by the coverage
	 * tool.
	 */
	@JsonProperty(COVERABLE_LINES_PROPERTY)
	@Nullable
	@JsonSerialize(using = LineRangeSerializer.class)
	@JsonDeserialize(using = LineRangeDeserializer.class)
	public final CompactLines coverableLines;

	@JsonCreator
	public FileInfo(@JsonProperty(PATH_PROPERTY) String path,
			@JsonProperty(COVERABLE_LINES_PROPERTY) @Nullable CompactLines coverableLines) {
		this.path = path;
		this.coverableLines = coverableLines;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy