]
Steven Hawkins resolved TEIID-4614.
-----------------------------------
Resolution: Rejected
Unchecked exceptions are simply handled in the ConnectorWorkItem - it does not quietly
fail.
statement executeOlapQuery quietly fails
----------------------------------------
Key: TEIID-4614
URL:
https://issues.jboss.org/browse/TEIID-4614
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 9.x, 8.7.9.6_2
Reporter: Johnathon Lee
Assignee: Steven Hawkins
cellSet = stmt.executeOlapQuery(mdxQuery) in OlapQueryExecution is quietly failing.
modify execute method to add Exception catch and printStackTrace
{code:java}
// Some comments here
public void execute() throws TranslatorException {
try {
stmt = this.connection.createStatement();
cellSet = stmt.executeOlapQuery(mdxQuery);
CellSetAxis rowAxis = this.cellSet.getAxes().get(Axis.ROWS.axisOrdinal());
rowPositionIterator = rowAxis.iterator();
columnsAxis = cellSet.getAxes().get(Axis.COLUMNS.axisOrdinal());
colWidth = rowAxis.getAxisMetaData().getHierarchies().size() +
this.columnsAxis.getPositions().size();
} catch (SQLException e) {
throw new TranslatorException(e);
} catch (Exception e) {
e.printStackTrace();
} finally {
System.out.println("in finally block");
}
}
{code}
run existing tests to see (not catching the exception has all tests passing)
{code:java}
Running org.teiid.translator.olap.TestOlapTranslator
org.teiid.core.TeiidRuntimeException
at org.teiid.translator.olap.OlapQueryExecution.execute(OlapQueryExecution.java:100)
at
org.teiid.translator.olap.TestOlapTranslator.testCannedProcedure(TestOlapTranslator.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
in finally block
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.541 sec <<<
FAILURE! - in org.teiid.translator.olap.TestOlapTranslator
testCannedProcedure(org.teiid.translator.olap.TestOlapTranslator) Time elapsed: 0.54 sec
<<< FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.fail(Assert.java:95)
at
org.teiid.translator.olap.TestOlapTranslator.testCannedProcedure(TestOlapTranslator.java:68)
Results :
Failed tests:
TestOlapTranslator.testCannedProcedure:68 null
{code}