0

Esper で簡単なテストを実行しようとしています (第 14 章、http://dl.e-book-free.com/2013/07/activiti_in_action.pdf )。コードは非常に単純です。

public class EventLengthWindowTest {
  public class LoanRequestEvent {
    public int amount =2;

    public LoanRequestEvent(int a){
        amount += a;
    }
}

private int sumAmount = 0;

@Test
public void testEventLengthWindow() {
  Configuration configuration = new Configuration();
  configuration.addEventType(LoanRequestEvent.class); 

  EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(configuration);
  EPAdministrator admin = epService.getEPAdministrator();
  EPStatement epStatement = admin.createEPL("select sum(amount) as sumAmount from LoanRequestEvent.win:length(2)");

  ...
}

EPL パーツに関するエラー メッセージが表示されます。

"select sum(amount) as sumAmount from LoanRequestEvent.win:length(2)"

それは言います:

com.espertech.esper.client.EPStatementException: Error starting statement: Failed to validate select-clause expression 'sum(amount)': Property named 'amount' is not valid in any stream [select sum(amount) as sumAmount from LoanRequestEvent.win:length(2)]

なぜこれが起こるのですか?

4

1 に答える 1