EsperTemplate implements EsperTemplateOperations { public void sendEvent(Object event) throws InvalidEsperConfigurationException { LOG.debug("Sending event to Esper"); if (epRuntime != null) { epRuntime.sendEvent(event); } else { LOG.error("Attempted to send message with null Esper Runtime."); throw new InvalidEsperConfigurationException( "Esper Runtime is null. Have you initialized the template before you attempt to send an event?"); } LOG.debug("Sent event to Esper"); }  void setName(String name); String getName(); void setStatements(Set<EsperStatement> statements); void setConfiguration(Resource configuration); void setUnmatchedListener(UnmatchedListener unmatchedListener); EPRuntime getEsperNativeRuntime(); Set<EsperStatement> getStatements(); synchronized void addStatement(EsperStatement statement); synchronized void destroyStatement(String statementId); synchronized void startStatement(String statementId); synchronized void stopStatement(String statementId); void sendEvent(Object event); synchronized void initialize(); void cleanup();  }
@Test(expected = InvalidEsperConfigurationException.class) public void testExceptionRaisedWhenTemplateNotInitialized() { template.sendEvent(new SampleEvent()); }