ScriptletProcessor extends AbstractVirtualSensor { @Override public boolean initialize() { return initialize( getVirtualSensorConfiguration().getOutputStructure(), getVirtualSensorConfiguration().getMainClassInitialParams() ); }  @Override boolean initialize(); @Override void dispose(); @Override void dataAvailable(String inputStreamName, StreamElement se);  }
@Test public void testCorrectProcessorParameters() { ScriptletProcessor processor = new ScriptletProcessor(); TreeMap<String,String> parameters = new TreeMap<String,String>(); boolean status = processor.initialize(dataFields1, parameters); assertFalse(status); parameters = new TreeMap<String,String>(); parameters.put("anyparam","println 'Hello World!';"); status = processor.initialize(dataFields1, parameters); assertFalse(status); parameters = new TreeMap<String,String>(); parameters.put("scriptlet","println 'Hello World!';"); status = processor.initialize(dataFields1, parameters); assertTrue(status); parameters = new TreeMap<String,String>(); parameters.put("scriplet-periodic","println 'Hello World!';"); status = processor.initialize(dataFields1, parameters); assertFalse(status); parameters = new TreeMap<String,String>(); parameters.put("scriplet-periodic","println 'Hello World!';"); parameters.put("period","2000"); status = processor.initialize(dataFields1, parameters); assertTrue(status); }