private void runQuery( String epl, String fields, Object[][] expected, ContextPartitionSelector[] selectors) { // try FAF without prepare EPOnDemandQueryResult result = epService.getEPRuntime().executeQuery(epl, selectors); EPAssertionUtil.assertPropsPerRowAnyOrder(result.getArray(), fields.split(","), expected); // test prepare and execute EPOnDemandPreparedQuery preparedQuery = epService.getEPRuntime().prepareQuery(epl); EPOnDemandQueryResult resultPrepared = preparedQuery.execute(selectors); EPAssertionUtil.assertPropsPerRowAnyOrder( resultPrepared.getArray(), fields.split(","), expected); }
private void runQueryAll(String epl, String fields, Object[][] expected, int numStreams) { ContextPartitionSelector[] selectors = new ContextPartitionSelector[numStreams]; for (int i = 0; i < numStreams; i++) { selectors[i] = ContextPartitionSelectorAll.INSTANCE; } runQuery(epl, fields, expected, selectors); // run same query without selector EPOnDemandQueryResult result = epService.getEPRuntime().executeQuery(epl); EPAssertionUtil.assertPropsPerRowAnyOrder(result.getArray(), fields.split(","), expected); }