use of org.apache.metron.stellar.common.StellarStatefulExecutor in project metron by apache.
the class ProfilerFunctionsTest method testProfilerInitWithNoGlobalConfig.
@Test
public void testProfilerInitWithNoGlobalConfig() {
state.put("config", helloWorldProfilerDef);
String expression = "PROFILER_INIT(config)";
// use an executor with no GLOBAL_CONFIG defined in the context
StellarStatefulExecutor executor = new DefaultStellarStatefulExecutor(new SimpleFunctionResolver().withClass(ProfilerFunctions.ProfilerInit.class).withClass(ProfilerFunctions.ProfilerApply.class).withClass(ProfilerFunctions.ProfilerFlush.class), Context.EMPTY_CONTEXT());
StandAloneProfiler profiler = executor.execute(expression, state, StandAloneProfiler.class);
assertNotNull(profiler);
assertEquals(1, profiler.getProfileCount());
assertEquals(0, profiler.getMessageCount());
assertEquals(0, profiler.getRouteCount());
}
use of org.apache.metron.stellar.common.StellarStatefulExecutor in project metron by apache.
the class ProfilerFunctionsTest method testProfilerInitWithNoGlobalConfig.
@Test
public void testProfilerInitWithNoGlobalConfig() {
state.put("config", helloWorldProfilerDef);
String expression = "PROFILER_INIT(config)";
// use an executor with no GLOBAL_CONFIG defined in the context
StellarStatefulExecutor executor = new DefaultStellarStatefulExecutor(new SimpleFunctionResolver().withClass(ProfilerFunctions.ProfilerInit.class).withClass(ProfilerFunctions.ProfilerApply.class).withClass(ProfilerFunctions.ProfilerFlush.class), Context.EMPTY_CONTEXT());
StandAloneProfiler profiler = executor.execute(expression, state, StandAloneProfiler.class);
assertNotNull(profiler);
assertEquals(1, profiler.getProfileCount());
assertEquals(0, profiler.getMessageCount());
assertEquals(0, profiler.getRouteCount());
}
Aggregations