use of io.engineblock.activityimpl.ActivityDef in project engineblock by engineblock.
the class StdoutActivityTypeTest method testDiagActivity.
@Test
public void testDiagActivity() {
StdoutActivityType stdoutAt = new StdoutActivityType();
String atname = stdoutAt.getName();
assertThat(atname.equals("stdout"));
ActivityDef ad = ActivityDef.parseActivityDef("type=stdout; yaml=stdout-test;");
StdoutActivity stdoutActivity = stdoutAt.getActivity(ad);
ActionDispenser actionDispenser = stdoutAt.getActionDispenser(stdoutActivity);
Action action = actionDispenser.getAction(1);
}
use of io.engineblock.activityimpl.ActivityDef in project engineblock by engineblock.
the class ActivityExecutorTest method getActivityMotorFactory.
private MotorDispenser getActivityMotorFactory(final ActivityDef ad, Action lc, final Input ls) {
MotorDispenser cmf = new MotorDispenser() {
@Override
public Motor getMotor(ActivityDef activityDef, int slotId) {
Activity activity = new SimpleActivity(activityDef);
Motor cm = new CoreMotor(activity, slotId, ls);
cm.setAction(lc);
return cm;
}
};
return cmf;
}
use of io.engineblock.activityimpl.ActivityDef in project engineblock by engineblock.
the class MetricsIntegrationTest method testHistogramLogger.
@Test
public void testHistogramLogger() {
ActivityDef ad = ActivityDef.parseActivityDef("alias=foo;type=diag");
Histogram testhistogram = ActivityMetrics.histogram(ad, "testhistogram");
ActivityMetrics.addHistoLogger("testsession", ".*", "testhisto.log", "1s");
testhistogram.update(400);
testhistogram.getSnapshot();
File logfile = new File("testhisto.log");
assertThat(logfile).exists();
assertThat(logfile.lastModified()).isGreaterThan(System.currentTimeMillis() - 10000);
}
use of io.engineblock.activityimpl.ActivityDef in project engineblock by engineblock.
the class ScenarioController method run.
public synchronized void run(int timeout, String activityDefString) {
ActivityDef activityDef = ActivityDef.parseActivityDef(activityDefString);
run(timeout, activityDef);
}
use of io.engineblock.activityimpl.ActivityDef in project engineblock by engineblock.
the class ScenarioController method start.
/**
* Start an activity, given a map which holds the activity definition for it. The activity will be known in
* the scenario by the alias parameter.
*
* @param activityDefMap A map containing the activity definition
*/
public synchronized void start(Map<String, String> activityDefMap) {
ActivityDef ad = new ActivityDef(new ParameterMap(activityDefMap));
start(ad);
}
Aggregations