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

jadex.micro.testcases.prepostconditions.IContractService Maven / Gradle / Ivy

Go to download

The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.

There is a newer version: 4.0.267
Show newest version
package jadex.micro.testcases.prepostconditions;

import java.util.List;

import jadex.bridge.service.annotation.CheckIndex;
import jadex.bridge.service.annotation.CheckNotNull;
import jadex.bridge.service.annotation.CheckState;
import jadex.commons.future.IFuture;
import jadex.commons.future.IIntermediateFuture;

/**
 *  Example for contracts in services.
 *  
 *  As precondition it can be used: @CheckNotNull @CheckState @CheckIndex()
 *  As postcondition it can be used: @CheckNotNull @CheckState
 */
public interface IContractService
{
	/**
	 *  Test method for @CheckNotNull and @CheckState.
	 */
	public @CheckNotNull @CheckState("$res>0 && $res<100") IFuture doSomething(
		@CheckNotNull String a, 
		@CheckState("$arg>0 && $arg<100") int x,
		@CheckState("$arg>0") int y);
	
	/**
	 *  Test method for @CheckIndex.
	 */
	public IFuture getName(@CheckIndex(1) int idx, @CheckNotNull List names);

	/**
	 *  Test method for @CheckState with intermediate results.
	 *  
	 *  Will automatically try to determine the number of intermediate results to keep.
	 */
	public @CheckState(value="$res[-1] < $res", intermediate=true) 
		IIntermediateFuture getIncreasingValue2();
	
	/**
	 *  Test method for @CheckState with intermediate results.
	 */
	public @CheckState(value="$res[-1] < $res", intermediate=true, keep=1) 
		IIntermediateFuture getIncreasingValue();
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy