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

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

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

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;

/**
 * Holds coverage of a single file.
 *
 * This class is a DTO used to deserialize testwise coverage reports. Field names and structure may
 * not be changed.
 */
public class FileCoverage {

	/** The name of the JSON property name for {@link #fileName}. */
	private static final String FILENAME_PROPERTY = "fileName";

	/** The name of the JSON property name for {@link #coveredLines}. */
	private static final String COVERED_LINES_PROPERTY = "coveredLines";

	/** The name of the file. */
	@JsonProperty(FILENAME_PROPERTY)
	public final String fileName;

	/** A list of line ranges that have been covered. */
	@JsonProperty(COVERED_LINES_PROPERTY)
	@JsonSerialize(using = LineRangeSerializer.class)
	@JsonDeserialize(using = LineRangeDeserializer.class)
	public final CompactLines coveredLines;

	@JsonCreator
	public FileCoverage(@JsonProperty(FILENAME_PROPERTY) String fileName,
			@JsonProperty(COVERED_LINES_PROPERTY) CompactLines coveredLines) {
		this.fileName = fileName;
		this.coveredLines = coveredLines;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy