/**
 * Copyright 2014 SAP AG
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.spotter.ext.dummy;

import org.aim.api.exceptions.InstrumentationException;
import org.aim.api.exceptions.MeasurementException;
import org.aim.api.measurement.dataset.DatasetCollection;
import org.aim.description.InstrumentationDescription;
import org.lpe.common.extension.IExtension;
import org.spotter.core.ProgressManager;
import org.spotter.core.detection.AbstractDetectionController;
import org.spotter.core.detection.IDetectionController;
import org.spotter.exceptions.WorkloadException;
import org.spotter.shared.result.model.SpotterResult;

public class TestDetection extends AbstractDetectionController {

	public TestDetection(IExtension<IDetectionController> provider) {
		super(provider);
	}

	@Override
	public void loadProperties() {

	}

	@Override
	protected void executeExperiments() throws InstrumentationException, MeasurementException, WorkloadException {
		executeDefaultExperimentSeries(TestDetection.class, 1, new InstrumentationDescription());
	}

	@Override
	protected SpotterResult analyze(DatasetCollection data) {

		SpotterResult result = new SpotterResult();
		result.setDetected(true);
		result.addMessage("Detection run finished successfully!");

		return result;
	}

	@Override
	public long getExperimentSeriesDuration() {
		return ProgressManager.getInstance().calculateDefaultExperimentSeriesDuration(1);
	}

}

@@ -1133,89 +1133,284 @@
 del.
-SpotterResult;%0A%0Apublic class TestDetection extends AbstractDetectionController %7B%0A
+ProblemOccurrence;%0Aimport org.spotter.shared.result.model.SpotterResult;%0A%0A/**%0A * A test detection controller.%0A */%0Apublic class TestDetection extends AbstractDetectionController %7B%0A%0A%09/**%0A%09 * Constructor.%0A%09 * %0A%09 * @param provider%0A%09 *            the provider of the extension%0A%09 */
 %0A%09pu
@@ -1880,16 +1880,522 @@
 sult();%0A
+%09%09String message = %22Detected a test bottleneck!%22;%0A%0A%09%09String methodA = %22methodA()%22;%0A%09%09ProblemOccurrence occurrenceA = new ProblemOccurrence(methodA, message);%0A%09%09String methodB = %22methodB()%22;%0A%09%09ProblemOccurrence occurrenceB = new ProblemOccurrence(methodB, message);%0A%09%09String methodC = %22methodC()%22;%0A%09%09ProblemOccurrence occurrenceC = new ProblemOccurrence(methodC, message);%0A%0A%09%09result.addProblemOccurrence(occurrenceA);%0A%09%09result.addProblemOccurrence(occurrenceB);%0A%09%09result.addProblemOccurrence(occurrenceC);%0A%0A
 %09%09result
@@ -2435,17 +2435,22 @@
 essage(%22
-D
+Test d
 etection

Add fake problem occurrences in TestDetection