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

hudson.plugins.PerfPublisher.matrixBuild.PerfPublisherMatrixSubBuild Maven / Gradle / Ivy

Go to download

The PerfPublisher plug-in scans for xml tests reports defined in the administration panel and generates trend graphs, computes stats and underline regressions and modifications. The xml files must be generated by your own testing tool.

There is a newer version: 7.97
Show newest version
package hudson.plugins.PerfPublisher.matrixBuild;

import hudson.plugins.PerfPublisher.Report.ReportContainer;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;

public class PerfPublisherMatrixSubBuild implements Comparable {

	/**
	 * List of axes value for this subBuild
	 */
	private Map combinations;
	
	private ReportContainer report;
	
	public PerfPublisherMatrixSubBuild(Map comb, ReportContainer report) {
		this.combinations = comb;
		this.report = report;
	}

	public boolean hasCombination(Map combination) {
		Set> entry = this.combinations.entrySet();
		Iterator>  iterator = entry.iterator();
		while (iterator.hasNext()) {
			Entry axe = iterator.next();
			if (combination.containsKey(axe.getKey()) && combination.get(axe.getKey()).equals(axe.getValue())) {
				return true;
			}			
		}
		return false;		
	}

	public Map getCombinations() {
		return combinations;
	}
	
	public String getStringCombinations() {
		StringBuilder strb = new StringBuilder();
		
		Set> entry = this.combinations.entrySet();
		Iterator>  iterator = entry.iterator();
		while (iterator.hasNext()) {
			Entry axe = iterator.next();
			strb.append(axe.getKey()+"="+axe.getValue()+" ; ");		
		}
		
		return strb.toString();
	}

	
	
	public ReportContainer getReport() {
		return report;
	}

	public List getAxis() {
		List result = new ArrayList();
		Set axis = this.combinations.keySet();
		Object[] arr = (Object[]) axis.toArray();
		for (int i=0; i getAxisValues(String axe) {
		List result = new ArrayList();
		Set> entry = this.combinations.entrySet();
		Iterator>  iterator = entry.iterator();
		while (iterator.hasNext()) {
			Entry a = iterator.next();
			if (a.getKey().equals(axe) && !result.contains(a.getValue())) {
				result.add(a.getValue());
			}
		}
		return result;
	}
	/**
	 * Comparable function which offers a sorting solution
	 * 
	 */
	public int compareTo(PerfPublisherMatrixSubBuild subBuild) {
		return this.getStringCombinations().compareTo(subBuild.getStringCombinations());		
	}
	
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy