Author: shawkins
Date: 2012-07-30 19:32:11 -0400 (Mon, 30 Jul 2012)
New Revision: 4278
Modified:
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
Log:
TEIID-1598 fixing the isContinuous method
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2012-07-30
21:31:32 UTC (rev 4277)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2012-07-30
23:32:11 UTC (rev 4278)
@@ -760,7 +760,7 @@
@Override
public boolean isContinuous() {
- return globalState.reuseCount == null;
+ return globalState.reuseCount != null;
}
public void setContinuous() {
Modified:
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
===================================================================
---
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java 2012-07-30
21:31:32 UTC (rev 4277)
+++
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java 2012-07-30
23:32:11 UTC (rev 4278)
@@ -99,6 +99,7 @@
@Before public void setup() throws DataNotAvailableException, TranslatorException {
execution = Mockito.mock(FakeReusableExecution.class);
+ ec = null;
OngoingStubbing stubbing = Mockito.stub(execution.next()).toReturn((List)
Arrays.asList((Object)null)).toReturn(null);
for (int i = 1; i < EXEC_COUNT; i++) {
stubbing.toReturn((List<Object>) Arrays.asList((Object)null)).toReturn(null);
@@ -114,7 +115,9 @@
}
}).when(execution).dispose();
}
-
+
+ private static ExecutionContext ec;
+
@BeforeClass public static void oneTimeSetUp() throws Exception {
EmbeddedConfiguration config = new EmbeddedConfiguration();
config.setUserRequestSourceConcurrency(1);
@@ -129,6 +132,7 @@
ExecutionContext executionContext,
RuntimeMetadata metadata, Object connection)
throws TranslatorException {
+ ec = executionContext;
return execution;
};
};
@@ -187,6 +191,7 @@
}
}
assertEquals(EXEC_COUNT, result.get().intValue());
+ assertTrue(ec.getCommandContext().isContinuous());
Mockito.verify(execution, Mockito.times(1)).dispose();
Mockito.verify(execution, Mockito.times(EXEC_COUNT)).execute();
Mockito.verify(execution, Mockito.times(EXEC_COUNT)).close();