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

jadex.bdi.testcases.goals.ParameterSetPlan Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
package jadex.bdi.testcases.goals;

import jadex.base.test.TestReport;
import jadex.bdi.runtime.Plan;
import jadex.commons.SUtil;

/**
 *  Test if parameter sets work.
 */
public class ParameterSetPlan extends Plan
{
	public void body()
	{
		TestReport	report	= new TestReport("check_values", "Checks if the goal contains the correct parameter set .");
		Object[]	vals	= getParameterSet("names").getValues();
		if("[a, b, c]".equals(SUtil.arrayToString(vals)))
			report.setSucceeded(true);
		else
			report.setReason("Values should be [a, b, c], but were: "+SUtil.arrayToString(vals));
		getBeliefbase().getBeliefSet("testcap.reports").addFact(report);
		
		report	= new TestReport("check_value", "Checks if the goal contains the correct parameter set s.");
		vals	= getParameterSet("morenames").getValues();
		if("[d, e, f]".equals(SUtil.arrayToString(vals)))
			report.setSucceeded(true);
		else
			report.setReason("Values should be [d, e, f], but were: "+SUtil.arrayToString(vals));
		getBeliefbase().getBeliefSet("testcap.reports").addFact(report);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy