public void helpTestProjectFails(List elements, List[] data, List childElements, String expectedError) throws TeiidComponentException, TeiidProcessingException { ProjectNode projectNode = helpSetupProject(elements, data, childElements, null); try { projectNode.open(); while(true) { TupleBatch batch = projectNode.nextBatch(); if(batch.getTerminationFlag()) { break; } } fail("Expected error but test succeeded"); //$NON-NLS-1$ } catch(ExpressionEvaluationException e) { //note that this should not be a component exception, which would indicate that something abnormal happened assertEquals("Got unexpected exception", expectedError.toUpperCase(), e.getMessage().toUpperCase()); //$NON-NLS-1$ } }
public void helpTestProject(List elements, List[] data, List childElements, List[] expected, ProcessorDataManager dataMgr) throws TeiidComponentException, TeiidProcessingException { ProjectNode projectNode = helpSetupProject(elements, data, childElements, dataMgr); projectNode.open(); int currentRow = 1; while(true) { try { TupleBatch batch = projectNode.nextBatch(); for(int row = currentRow; row <= batch.getEndRow(); row++) { assertEquals("Rows don't match at " + row, expected[row-1], batch.getTuple(row)); //$NON-NLS-1$ } if(batch.getTerminationFlag()) { break; } currentRow += batch.getRowCount(); } catch(BlockedException e) { // ignore and try again } } }