/** * Test threaded component execution. */ @Agent(keepalive=Boolean3.FALSE) @Results(@Result(name="testresults", clazz=Testcase.class)) public class SimpleBlockingTestAgent { /** * Execute the agent */ @AgentBody public void execute(final IInternalAccess agent) { agent.getComponentFeature(IExecutionFeature.class).waitForDelay(500).get(); agent.getComponentFeature(IArgumentsResultsFeature.class).getResults().put("testresults", new Testcase(1, new TestReport[]{new TestReport("#1", "Test blocking wait.", true, null)})); } }
/** * Test threaded access to raw services. */ @Agent(keepalive=Boolean3.FALSE) @Results(@Result(name="testresults", clazz=Testcase.class)) public class RawBlockingTestAgent { /** * Execute the agent */ @AgentBody public void execute(final IInternalAccess agent) { IComponentManagementService cms = SServiceProvider.getService(agent, IComponentManagementService.class, RequiredServiceInfo.SCOPE_PLATFORM).get(); cms.getComponentDescriptions().get(); agent.getComponentFeature(IArgumentsResultsFeature.class).getResults().put("testresults", new Testcase(1, new TestReport[]{new TestReport("#1", "Test blocking wait.", true, null)})); } }
@Results(@Result(name="testresults", clazz=Testcase.class)) public class RemoteBlockingTestAgent extends TestAgent
@Agent(keepalive=Boolean3.FALSE) @Results(@Result(name="testresults", clazz=Testcase.class)) public abstract class InterfaceInjectionBDI implements IBDIAgent
@Agent @Results(@Result(name="res", clazz=int.class)) public class ResultProducerAgent
@Results(@Result(name="testresults", clazz=Testcase.class)) public class TestAgent implements ITestService
/** * A minimal test case agent serving as a demonstrator. */ @Description("A simple test showing how the test center works with micro agents.") @Results(@Result(name="testresults", clazz=Testcase.class)) @Agent public class SimpleTestAgent { @Agent protected IInternalAccess agent; /** * Just finish the test by setting the result and killing the agent. */ @AgentBody public void executeBody() { TestReport tr = new TestReport("#1", "Simple micro test."); tr.setSucceeded(true); agent.getComponentFeature(IArgumentsResultsFeature.class).getResults().put("testresults", new Testcase(1, new TestReport[]{tr})); agent.killComponent(); } }
@Results(@Result(name="testresults", clazz=Testcase.class)) public class GoalsWithCapabilityBDI
@Results(@Result(name="testresults", clazz=Testcase.class)) @Plans(@Plan(body=@Body(ExternalPlan.class))) public class ExternalPlanBDI
/** * Simple test agent with one service. */ @ProvidedServices(@ProvidedService(type=IAService.class, implementation=@Implementation(expression="$pojoagent"))) @Results(@Result(name="testcases", clazz=List.class)) @Service(IAService.class) @Agent public class AAgent implements IAService { @Agent protected IInternalAccess agent; /** * Init service method. */ @AgentCreated public IFuture<Void> test() { boolean ext = !agent.getComponentFeature(IExecutionFeature.class).isComponentThread(); String reason = ext? "Wrong thread: "+Thread.currentThread(): null; List<TestReport> tests = new ArrayList<TestReport>(); tests.add(new TestReport("#A1", "Test if service is called on component thread.", !ext, reason)); agent.getComponentFeature(IArgumentsResultsFeature.class).getResults().put("testcases", tests); // System.out.println("called service"); return IFuture.DONE; } }
/** * Test if pojo services can be passed as local parameters. */ @Agent @ProvidedServices(@ProvidedService(type=IDService.class, implementation=@Implementation(PojoDService.class))) @RequiredServices(@RequiredService(name="cms", type=IComponentManagementService.class, binding=@Binding(scope=Binding.SCOPE_PLATFORM))) @Results(@Result(name="testresults", clazz=Testcase.class)) @Configurations({@Configuration(name="first"), @Configuration(name="second")}) public class ServiceParameterAgent { }
@Arguments(@Argument(name = TagProperty.NAME, clazz = String.class, defaultvalue="null")) @NFProperties(@NFProperty(value = TagProperty.class)) @Results(@Result(name="testresults", description= "The test results.", clazz=Testcase.class)) public class NullTagAgent
@Service @Description("Test if a pojo agent can be injected into a service as servicecomponent.") @Results(@Result(name="testresults", clazz=Testcase.class)) public class PojoInjectionAgent implements IAService
@Results(@Result(name="testresults", clazz=Testcase.class)) public class RequiredServicesAgent
@Configuration(name="b") }) @Results(@Result(name="testresults", clazz=Testcase.class)) @Agent(keepalive=Boolean3.FALSE) public class RequiredServiceConfigurationsAgent
@RequiredServices(@RequiredService(name = "MessageService", type = IMessageService.class, binding = @Binding(scope = RequiredServiceInfo.SCOPE_GLOBAL))) @ProvidedServices(@ProvidedService(type = IMessageService.class, name = "MessageService", implementation = @Implementation(MessageService.class))) @Results(@Result(name="found", clazz=IServiceIdentifier[].class)) public class FirstAgent
/** * Base class agent. */ @Agent @Description("Base description") @Imports({"b1", "b2"}) @Properties({@NameValue(name="a", value="\"ba\""), @NameValue(name="b", value="\"bb\"")}) @RequiredServices(@RequiredService(name="clock", type=IClockService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @ProvidedServices(@ProvidedService(name="myservice", type=IAService.class, implementation=@Implementation(Object.class))) @Arguments(@Argument(name="arg1", defaultvalue="\"bval\"", clazz=String.class)) @Results(@Result(name="res1", defaultvalue="\"bres\"", clazz=String.class)) @Configurations({@Configuration(name="config1"), @Configuration(name="config2")}) public abstract class BaseAgent { }
@RequiredServices(@RequiredService(name = "ser1", type=IService1.class, binding = @Binding(scope = Binding.SCOPE_PLATFORM))) @Results(@Result(name="testresults", clazz=Testcase.class)) @ComponentTypes(
@Agent @Results(@Result(name="testresults", clazz=Testcase.class)) public class AbstractBeliefsBDI