// Path: src/main/java/org/harmony_analyser/jharmonyanalyser/plugins/chordanal_plugins/AverageChordComplexityDistancePlugin.java
// @SuppressWarnings("SameParameterValue")
// 
// public class AverageChordComplexityDistancePlugin extends ChordAnalyserPlugin {
// 	private final static int NUMBER_OUTPUTS = 3;
// 
// 	public AverageChordComplexityDistancePlugin() {
// 		key = "chord_analyser:average_chord_complexity_distance";
// 		name = "Avg Chord Complexity Distance";
// 		description = "Derives chord complexity distances from the subsequent chords and computes averages";
// 
// 		inputFileSuffixes = new ArrayList<>();
// 		inputFileSuffixes.add("-chromas");
// 		inputFileSuffixes.add("-chordino-labels");
// 		inputFileExtension = ".txt";
// 
// 		outputFileSuffix = "-average-cc-distance";
// 		outputFileExtension = ".txt";
// 
// 		parameters = new HashMap<>();
// 		parameters.put("audibleThreshold", (float) 0.07);
// 		parameters.put("maximumNumberOfChordTones", (float) 4.0);
// 		parameters.put("maximalComplexity", (float) 7.0);
// 
// 		setParameters();
// 	}
// 
// 	@Override
// 	public VisualizationData getDataFromOutput(String inputWavFile) throws IOException, AudioAnalyser.OutputNotReady, AudioAnalyser.ParseOutputError, AudioAnalyser.IncorrectInputException, AudioAnalyser.OutputAlreadyExists {
// 		VisualizationData data = super.prepareVisualizationData();
// 		List<Float> values = new ArrayList<>();
// 		List<String> labels = new ArrayList<>();
// 		List<String> linesList = readOutputFile(inputWavFile);
// 
// 		/* Plugin-specific parsing of the result */
// 		// get last NUMBER_OUTPUTS lines
// 		List<String> tail = linesList.subList(Math.max(linesList.size() - NUMBER_OUTPUTS, 0), linesList.size());
// 		for (String line : tail) {
// 			Scanner sc = new Scanner(line).useDelimiter("\\s*:\\s*");
// 			labels.add(sc.next());
// 			if (sc.hasNextFloat()) {
// 				values.add(sc.nextFloat());
// 			} else {
// 				throw new AudioAnalyser.ParseOutputError("Output did not have the required fields");
// 			}
// 			sc.close();
// 		}
// 		data.setValues(values);
// 		data.setLabels(labels);
// 		return data;
// 	}
// 
// 	protected String getTransitionOutput(float timestamp, int transitionComplexity) {
// 		return ""; // This plugin doesn't provide transition output
// 	}
// 
// 	protected String getFinalResult(float hc, float acc, float rtd) {
// 		return "Average Chord Complexity Distance (ACCD): " + hc + "\n" +
// 			"Average Chord Complexity (ACC): " + acc + "\n" +
// 			"Relative Chord Complexity Distance (RCCD): " + rtd + "\n";
// 	}
// }


import org.harmony_analyser.jharmonyanalyser.plugins.chordanal_plugins.AverageChordComplexityDistancePlugin;
import org.harmony_analyser.jharmonyanalyser.services.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.mockito.Mockito.mock;
import static org.powermock.api.mockito.PowerMockito.verifyNew;
import static org.powermock.api.mockito.PowerMockito.whenNew;
package org.harmony_analyser.jharmonyanalyser.plugins;



/**
 * Unit tests for AnalysisFactory class
 */

@SuppressWarnings("UnusedAssignment")
@RunWith(PowerMockRunner.class)
@PrepareForTest(AnalysisFactory.class)
public class AnalysisFactoryTest {
	private AnalysisFactory analysisFactory;

	@Before
	public void setUp() {
		analysisFactory = new AnalysisFactory();
	}

	@Test
	public void shouldCreateAnalysisPlugin() throws Exception {
// Path: src/main/java/org/harmony_analyser/jharmonyanalyser/plugins/chordanal_plugins/AverageChordComplexityDistancePlugin.java
// @SuppressWarnings("SameParameterValue")
// 
// public class AverageChordComplexityDistancePlugin extends ChordAnalyserPlugin {
// 	private final static int NUMBER_OUTPUTS = 3;
// 
// 	public AverageChordComplexityDistancePlugin() {
// 		key = "chord_analyser:average_chord_complexity_distance";
// 		name = "Avg Chord Complexity Distance";
// 		description = "Derives chord complexity distances from the subsequent chords and computes averages";
// 
// 		inputFileSuffixes = new ArrayList<>();
// 		inputFileSuffixes.add("-chromas");
// 		inputFileSuffixes.add("-chordino-labels");
// 		inputFileExtension = ".txt";
// 
// 		outputFileSuffix = "-average-cc-distance";
// 		outputFileExtension = ".txt";
// 
// 		parameters = new HashMap<>();
// 		parameters.put("audibleThreshold", (float) 0.07);
// 		parameters.put("maximumNumberOfChordTones", (float) 4.0);
// 		parameters.put("maximalComplexity", (float) 7.0);
// 
// 		setParameters();
// 	}
// 
// 	@Override
// 	public VisualizationData getDataFromOutput(String inputWavFile) throws IOException, AudioAnalyser.OutputNotReady, AudioAnalyser.ParseOutputError, AudioAnalyser.IncorrectInputException, AudioAnalyser.OutputAlreadyExists {
// 		VisualizationData data = super.prepareVisualizationData();
// 		List<Float> values = new ArrayList<>();
// 		List<String> labels = new ArrayList<>();
// 		List<String> linesList = readOutputFile(inputWavFile);
// 
// 		/* Plugin-specific parsing of the result */
// 		// get last NUMBER_OUTPUTS lines
// 		List<String> tail = linesList.subList(Math.max(linesList.size() - NUMBER_OUTPUTS, 0), linesList.size());
// 		for (String line : tail) {
// 			Scanner sc = new Scanner(line).useDelimiter("\\s*:\\s*");
// 			labels.add(sc.next());
// 			if (sc.hasNextFloat()) {
// 				values.add(sc.nextFloat());
// 			} else {
// 				throw new AudioAnalyser.ParseOutputError("Output did not have the required fields");
// 			}
// 			sc.close();
// 		}
// 		data.setValues(values);
// 		data.setLabels(labels);
// 		return data;
// 	}
// 
// 	protected String getTransitionOutput(float timestamp, int transitionComplexity) {
// 		return ""; // This plugin doesn't provide transition output
// 	}
// 
// 	protected String getFinalResult(float hc, float acc, float rtd) {
// 		return "Average Chord Complexity Distance (ACCD): " + hc + "\n" +
// 			"Average Chord Complexity (ACC): " + acc + "\n" +
// 			"Relative Chord Complexity Distance (RCCD): " + rtd + "\n";
// 	}
// }


// Path: src/test/java/org/harmony_analyser/jharmonyanalyser/plugins/AnalysisFactoryTest.java
import org.harmony_analyser.jharmonyanalyser.plugins.chordanal_plugins.AverageChordComplexityDistancePlugin;
import org.harmony_analyser.jharmonyanalyser.services.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.mockito.Mockito.mock;
import static org.powermock.api.mockito.PowerMockito.verifyNew;
import static org.powermock.api.mockito.PowerMockito.whenNew;

package org.harmony_analyser.jharmonyanalyser.plugins;



/**
 * Unit tests for AnalysisFactory class
 */

@SuppressWarnings("UnusedAssignment")
@RunWith(PowerMockRunner.class)
@PrepareForTest(AnalysisFactory.class)
public class AnalysisFactoryTest {
	private AnalysisFactory analysisFactory;

	@Before
	public void setUp() {
		analysisFactory = new AnalysisFactory();
	}

	@Test
	public void shouldCreateAnalysisPlugin() throws Exception {
		AverageChordComplexityDistancePlugin transitionComplexityPlugin = mock(AverageChordComplexityDistancePlugin.class);