teiid SVN: r1711 - in trunk/engine/src: test/java/com/metamatrix/query/processor/relational and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-01-05 15:32:42 -0500 (Tue, 05 Jan 2010)
New Revision: 1711
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/BlockingFakeRelationalNode.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestUnionAllNode.java
Log:
TEIID-920 fix for dup remove when the entire schema is specified
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2010-01-05 19:55:45 UTC (rev 1710)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2010-01-05 20:32:42 UTC (rev 1711)
@@ -98,16 +98,16 @@
this.schema = this.sourceID.getSchema();
int distinctIndex = sortElements != null? sortElements.size() - 1:0;
if (mode != Mode.SORT) {
- if (sortElements != null && sortElements.size() < schema.size()) {
+ if (sortElements == null) {
+ sortElements = this.schema;
+ sortTypes = Collections.nCopies(sortElements.size(), OrderBy.ASC);
+ } else if (sortElements.size() < schema.size()) {
sortElements = new ArrayList(sortElements);
List<SingleElementSymbol> toAdd = new ArrayList<SingleElementSymbol>(schema);
toAdd.removeAll(sortElements);
sortElements.addAll(toAdd);
sortTypes = new ArrayList<Boolean>(sortTypes);
sortTypes.addAll(Collections.nCopies(sortElements.size() - sortTypes.size(), OrderBy.ASC));
- } else {
- sortElements = this.schema;
- sortTypes = Collections.nCopies(sortElements.size(), OrderBy.ASC);
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/BlockingFakeRelationalNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/BlockingFakeRelationalNode.java 2010-01-05 19:55:45 UTC (rev 1710)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/BlockingFakeRelationalNode.java 2010-01-05 20:32:42 UTC (rev 1711)
@@ -28,12 +28,6 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.buffer.*;
-/**
- * @author amiller
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
public class BlockingFakeRelationalNode extends FakeRelationalNode {
private boolean blocked = false;
@@ -63,6 +57,7 @@
blocked = true;
throw BlockedException.INSTANCE;
}
+ blocked = false;
return super.nextBatchDirect();
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java 2010-01-05 19:55:45 UTC (rev 1710)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java 2010-01-05 20:32:42 UTC (rev 1711)
@@ -26,10 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import org.junit.Test;
@@ -52,22 +49,16 @@
public static final int BATCH_SIZE = 100;
- private void helpTestSort(List elements, List[] data, List sortElements, List sortTypes, List[] expected, Set blockOn, Mode mode) throws MetaMatrixComponentException, MetaMatrixProcessingException {
+ private void helpTestSort(List elements, List[] data, List sortElements, List sortTypes, List[] expected, Mode mode) throws MetaMatrixComponentException, MetaMatrixProcessingException {
BufferManager mgr = NodeTestUtil.getTestBufferManager(100, BATCH_SIZE, BATCH_SIZE);
CommandContext context = new CommandContext ("pid", "test", null, null, null); //$NON-NLS-1$ //$NON-NLS-2$
- FakeRelationalNode dataNode = new FakeRelationalNode(2, data);
+ FakeRelationalNode dataNode = new BlockingFakeRelationalNode(2, data);
dataNode.setElements(elements);
dataNode.initialize(context, mgr, null);
SortNode sortNode = new SortNode(1);
- if (mode == Mode.DUP_REMOVE) {
- sortTypes = Arrays.asList(new Boolean[elements.size()]);
- Collections.fill(sortTypes, OrderBy.ASC);
- sortNode.setSortElements(elements, sortTypes);
- } else {
- sortNode.setSortElements(sortElements, sortTypes);
- }
+ sortNode.setSortElements(sortElements, sortTypes);
sortNode.setMode(mode);
sortNode.setElements(elements);
sortNode.addChild(dataNode);
@@ -77,16 +68,20 @@
int currentRow = 1;
while(true) {
- TupleBatch batch = sortNode.nextBatch();
- if (mode != Mode.DUP_REMOVE) {
- for(int row = currentRow; row <= batch.getEndRow(); row++) {
- assertEquals("Rows don't match at " + row, expected[row-1], batch.getTuple(row)); //$NON-NLS-1$
- }
- }
- currentRow += batch.getRowCount();
- if(batch.getTerminationFlag()) {
- break;
- }
+ try {
+ TupleBatch batch = sortNode.nextBatch();
+ if (mode != Mode.DUP_REMOVE) {
+ for(int row = currentRow; row <= batch.getEndRow(); row++) {
+ assertEquals("Rows don't match at " + row, expected[row-1], batch.getTuple(row)); //$NON-NLS-1$
+ }
+ }
+ currentRow += batch.getRowCount();
+ if(batch.getTerminationFlag()) {
+ break;
+ }
+ } catch (BlockedException e) {
+
+ }
}
assertEquals(expected.length, currentRow - 1);
}
@@ -121,23 +116,10 @@
List sortTypes = new ArrayList();
sortTypes.add(new Boolean(OrderBy.ASC));
- /*
- * the following code will do four tests.
- * no blocking
- * blocking during sort phase
- * blocking during merge (for remove dups this tests defect 24736)
- * blocking during sort node output
- */
- for (int i = 0; i < 4; i++) {
- Set blockedOn = new HashSet();
- if (i > 0) {
- blockedOn.add(new Integer(i));
- }
- helpTestSort(elements, data, sortElements, sortTypes, expected, blockedOn, mode);
- }
+ helpTestSort(elements, data, sortElements, sortTypes, expected, mode);
}
- private void helpTestBiggerSort(int batches, int inMemoryBatches) throws Exception {
+ private void helpTestAllSorts(int batches) throws Exception {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
@@ -146,14 +128,14 @@
int rows = batches * BATCH_SIZE;
- List unsortedNumbers = new ArrayList();
+ List[] expected = new List[rows];
List[] data = new List[rows];
for(int i=0; i<rows; i++) {
data[i] = new ArrayList();
-
+ expected[i] = new ArrayList();
Integer value = new Integer((i*51) % 12321);
data[i].add(value);
- unsortedNumbers.add(value);
+ expected[i].add(value);
}
List sortElements = new ArrayList();
@@ -162,35 +144,25 @@
List sortTypes = new ArrayList();
sortTypes.add(new Boolean(OrderBy.ASC));
- Collections.sort(unsortedNumbers);
- List[] expected = new List[rows];
- for(int i=0; i<unsortedNumbers.size(); i++) {
- expected[i] = new ArrayList();
- expected[i].add(unsortedNumbers.get(i));
+ ListNestedSortComparator comparator = new ListNestedSortComparator(new int[] {0}, OrderBy.ASC);
+ Arrays.sort(expected, comparator);
+
+ for (Mode mode : Mode.values()) {
+ helpTestSort(elements, data, sortElements, sortTypes, expected, mode);
}
+ comparator = new ListNestedSortComparator(new int[] {0}, OrderBy.DESC);
+ Arrays.sort(expected, comparator);
+ sortTypes.clear();
+ sortTypes.add(new Boolean(OrderBy.DESC));
for (Mode mode : Mode.values()) {
- /*
- * the following code will do four tests, blocking in a variety of places
- */
- for (int i = 0; i < 3; i++) {
- Set blockedOn = new HashSet();
- if (i > 0) {
- //block on a variety of positions
- blockedOn.add(new Integer(i));
- blockedOn.add(new Integer(inMemoryBatches*i));
- blockedOn.add(new Integer(batches*i));
- blockedOn.add(new Integer(batches*(i+1)));
- }
- //5 batches in memory out of 10 total
- helpTestSort(elements, data, sortElements, sortTypes, expected, blockedOn, mode);
- }
+ helpTestSort(elements, data, sortElements, sortTypes, expected, mode);
}
}
@Test public void testNoSort() throws Exception {
- helpTestBiggerSort(0, 2);
+ helpTestAllSorts(0);
}
@Test public void testBasicSort() throws Exception {
@@ -220,6 +192,33 @@
helpTestBasicSort(expected, Mode.SORT);
}
+ @Test public void testDupSortDesc() throws Exception {
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "5" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "4" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(3), "6" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(3), "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(4), "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(5), "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(5), "5" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(6), "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(6), "4" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(7), "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(7), "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(8), "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(9), "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(9), "5" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(10), "9" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(10), "4" }) //$NON-NLS-1$
+ };
+
+ helpTestBasicSort(expected, Mode.SORT);
+ }
+
/**
* Note the ordering here is not stable
* @throws Exception
@@ -277,21 +276,12 @@
}
@Test public void testBiggerSort() throws Exception {
- helpTestBiggerSort(10, 5);
+ helpTestAllSorts(10);
}
- @Test public void testBiggerSortLowMemory() throws Exception {
- helpTestBiggerSort(5, 1);
+ @Test public void testAllSort() throws Exception {
+ helpTestAllSorts(1);
}
-
- /**
- * Progress can be made here since 2 batches fit in memory
- *
- * This is also a test of the multi-pass merge
- */
- @Test public void testBiggerSortLowMemory2() throws Exception {
- helpTestBiggerSort(5, 2);
- }
@Test public void testDupRemove() throws Exception {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestUnionAllNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestUnionAllNode.java 2010-01-05 19:55:45 UTC (rev 1710)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestUnionAllNode.java 2010-01-05 20:32:42 UTC (rev 1711)
@@ -205,24 +205,24 @@
public void testMultipleSourceMultiBatchAllBlocking() throws MetaMatrixComponentException, MetaMatrixProcessingException {
List expected[] = new List[] {
Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+
Arrays.asList(new Object[] { new Integer(0) }),
Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1) }),
-
Arrays.asList(new Object[] { new Integer(2) }),
Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2) }),
Arrays.asList(new Object[] { new Integer(2) })
};
15 years
teiid SVN: r1710 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/socket/client and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-01-05 14:55:45 -0500 (Tue, 05 Jan 2010)
New Revision: 1710
Removed:
trunk/client/src/main/java/com/metamatrix/dqp/internal/
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
trunk/client/src/main/resources/teiid-client-settings.properties
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java
trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
Log:
TEIID-916 updating client timeouts to values that are safer under load
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java 2010-01-05 19:55:45 UTC (rev 1710)
@@ -28,7 +28,10 @@
public interface ObjectChannel {
- Object read() throws IOException, ClassNotFoundException;
+ /**
+ * Callers must obtain a lock prior to calling read
+ */
+ Object read(int timeout) throws IOException, ClassNotFoundException;
SocketAddress getRemoteAddress();
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/OioOjbectChannelFactory.java 2010-01-05 19:55:45 UTC (rev 1710)
@@ -58,7 +58,6 @@
private final Socket socket;
private ObjectOutputStream outputStream;
private ObjectInputStream inputStream;
- private Object readLock = new Object();
private OioObjectChannel(Socket socket) throws IOException {
log.fine("creating new OioObjectChannel"); //$NON-NLS-1$
@@ -117,17 +116,16 @@
//## JDBC4.0-begin ##
@Override
//## JDBC4.0-end ##
- public Object read() throws IOException, ClassNotFoundException {
+ public Object read(int timeout) throws IOException, ClassNotFoundException {
log.finer("reading message from socket"); //$NON-NLS-1$
- synchronized (readLock) {
- try {
- return inputStream.readObject();
- } catch (SocketTimeoutException e) {
- throw e;
- } catch (IOException e) {
- close();
- throw e;
- }
+ socket.setSoTimeout(timeout);
+ try {
+ return inputStream.readObject();
+ } catch (SocketTimeoutException e) {
+ throw e;
+ } catch (IOException e) {
+ close();
+ throw e;
}
}
@@ -154,7 +152,7 @@
private int receiveBufferSize = 0;
private int sendBufferSize = 0;
private boolean conserveBandwidth;
- private int soTimeout = 3000;
+ private int soTimeout = 30000;
private volatile SSLSocketFactory sslSocketFactory;
public OioOjbectChannelFactory(Properties props) {
@@ -187,7 +185,7 @@
socket.setSendBufferSize(sendBufferSize);
}
socket.setTcpNoDelay(!conserveBandwidth); // enable Nagle's algorithm to conserve bandwidth
- socket.connect(address);
+ socket.connect(address, soTimeout);
socket.setSoTimeout(soTimeout);
return new OioObjectChannel(socket);
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2010-01-05 19:55:45 UTC (rev 1710)
@@ -95,7 +95,7 @@
InetSocketAddress address = new InetSocketAddress(hostInfo.getInetAddress(), hostInfo.getPortNumber());
this.socketChannel = channelFactory.createObjectChannel(address, ssl);
try {
- doHandshake();
+ doHandshake(channelFactory.getSoTimeout());
} catch (CommunicationException e) {
this.socketChannel.close();
throw e;
@@ -123,10 +123,10 @@
return ApplicationInfo.getInstance().getMajorReleaseNumber();
}
- private void doHandshake() throws IOException, CommunicationException {
+ private void doHandshake(int timeout) throws IOException, CommunicationException {
final Handshake handshake;
try {
- Object obj = this.socketChannel.read();
+ Object obj = this.socketChannel.read(timeout);
if (!(obj instanceof Handshake)) {
throw new CommunicationException(CommPlatformPlugin.Util.getString("SocketServerInstanceImpl.handshake_error")); //$NON-NLS-1$
@@ -288,7 +288,7 @@
}
@Override
- public synchronized Object get() throws InterruptedException, ExecutionException {
+ public Object get() throws InterruptedException, ExecutionException {
try {
return this.get(SocketServerConnectionFactory.getInstance().getSynchronousTtl(), TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
@@ -301,25 +301,26 @@
* the actual reads.
*/
@Override
- public synchronized Object get(long timeout, TimeUnit unit)
+ public Object get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException,
TimeoutException {
int timeoutMillis = (int)Math.min(unit.toMillis(timeout), Integer.MAX_VALUE);
- while (!isDone()) {
- if (timeoutMillis <= 0) {
- throw new TimeoutException();
- }
- long start = System.currentTimeMillis();
- try {
- receivedMessage(socketChannel.read());
- } catch (IOException e) {
- if (e instanceof SocketTimeoutException) {
+ synchronized (SocketServerInstanceImpl.this) {
+ while (!isDone()) {
+ if (timeoutMillis <= 0) {
+ throw new TimeoutException();
+ }
+ long start = System.currentTimeMillis();
+ try {
+ receivedMessage(socketChannel.read(timeoutMillis));
timeoutMillis -= (System.currentTimeMillis() - start);
- continue;
+ } catch (SocketTimeoutException e) {
+ throw new TimeoutException();
+ } catch (IOException e) {
+ exceptionOccurred(e);
+ } catch (ClassNotFoundException e) {
+ exceptionOccurred(e);
}
- exceptionOccurred(e);
- } catch (ClassNotFoundException e) {
- exceptionOccurred(e);
}
}
return super.get(timeout, unit);
Modified: trunk/client/src/main/resources/teiid-client-settings.properties
===================================================================
--- trunk/client/src/main/resources/teiid-client-settings.properties 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/client/src/main/resources/teiid-client-settings.properties 2010-01-05 19:55:45 UTC (rev 1710)
@@ -71,10 +71,8 @@
# A timeout during the initialization, handshake, or
# a server ping will be treated as an error.
#
-# Setting this value too low may cause read errors.
-#
-org.teiid.sockets.soTimeout=3000
+org.teiid.sockets.soTimeout=30000
#
# The max number of cached server instances
@@ -100,7 +98,7 @@
# synchronous calls.
#
-org.teiid.sockets.synchronousttl=120000
+org.teiid.sockets.synchronousttl=240000
#
# Set the socket receive buffer size (in bytes)
Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java 2010-01-05 19:55:45 UTC (rev 1710)
@@ -80,7 +80,7 @@
//## JDBC4.0-begin ##
@Override
//## JDBC4.0-end ##
- public Object read() throws IOException,
+ public Object read(int timeout) throws IOException,
ClassNotFoundException {
Object msg = readMsgs.get(readCount++);
if (msg instanceof IOException) {
Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-01-05 18:46:34 UTC (rev 1709)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-01-05 19:55:45 UTC (rev 1710)
@@ -86,7 +86,7 @@
}
@Override
- public Object read() throws IOException,
+ public Object read(int timeout) throws IOException,
ClassNotFoundException {
throw new UnsupportedOperationException();
}
15 years
teiid SVN: r1709 - trunk/test-integration/db/src/main/resources/ctc_tests.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-01-05 13:46:34 -0500 (Tue, 05 Jan 2010)
New Revision: 1709
Modified:
trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
Log:
Teiid 781 - updates so the error flagged file will contain the query sets / scenarios that failed.
Modified: trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-01-05 17:56:52 UTC (rev 1708)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-01-05 18:46:34 UTC (rev 1709)
@@ -40,7 +40,9 @@
<not>
<isset property="single"/>
</not>
- </condition>
+ </condition>
+
+ <delete file="${ERROR_FILE}"/>
</target>
@@ -100,19 +102,21 @@
</java>
- <antcall target="is.there.output" inheritall="true" >
- </antcall>
+ <antcall target="are.there.errors" inheritall="true" />
</target>
- <target name="is.there.output" >
- <loadproperties srcFile="${scenario.file}" />
+ <target name="are.there.errors" >
+ <!-- load the scenario file to get the queryset thats being run -->
+ <loadproperties srcFile="${scenario.file}" />
+
+ <!-- get the scenario name based on the scenario file, strip the suffix -->
<basename property="scenario.name" file="${scenario.file}"
suffix=".properties"/>
- <echo>Are there any files ${root_output}//${queryset.dir}/output/${scenario.name}</echo>
+ <echo>Are there any files ${root_output}/${queryset.dir}/output/${scenario.name}</echo>
<path id="output.dir.files">
<fileset dir="${root_output}/${queryset.dir}/output/${scenario.name}">
@@ -122,7 +126,6 @@
<condition property="has.output">
<resourcecount refid="output.dir.files" when="greater" count="0" />
-
</condition>
<echo>Is there output ${has.output}</echo>
@@ -156,9 +159,11 @@
<target name="touch.error.file"
if="error.exist">
- <echo>Touch to Flag Error at ${ERROR_FILE} </echo>
- <touch file="${ERROR_FILE}"/>
-
+ <echo>Flag Error - Query Set: ${queryset.dir} Scenario: ${scenario.name} </echo>
+
+ <concat destfile="${ERROR_FILE}" append="true">Query Set: ${queryset.dir} Scenario: ${scenario.name} </concat>
+
+
</target>
15 years
teiid SVN: r1708 - trunk/test-integration/db/src/main/resources/ctc_tests.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-01-05 12:56:52 -0500 (Tue, 05 Jan 2010)
New Revision: 1708
Modified:
trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
Log:
Teiid 781 - updates for running the ctc client so that the process can determine if a error occurred across all scenarios and trigger the failure at the end
Modified: trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-01-05 16:53:42 UTC (rev 1707)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-01-05 17:56:52 UTC (rev 1708)
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ctc" default="main" >
+
+ <property name="root_output" value="${proj.dir}/target/bulk-query-tests" />
+
+ <property name="ERROR_FILE" value="${root_output}/ERROR_FOUND.txt" />
-
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement path="${maven.runtime.classpath}" />
@@ -11,14 +14,16 @@
<target name="main" depends="init" if="" unless="" description="create all property files">
<antcall target="run.all.test" inheritall="true" />
<antcall target="run.single.test" inheritall="true" />
+
+ <available file="${ERROR_FILE}" property="error.flagged"/>
+
+ <fail if="error.flagged" message="One or more ctc tests failed" />
+
+
</target>
<target name="init" depends="" >
- <path id="test.classpath">
- <pathelement path="${maven.runtime.classpath}" />
- <pathelement location="${basedir}/lib/*.jar" />
- </path>
<available file="${scenario.dir}" type="dir" property="dir.exist"/>
@@ -30,15 +35,7 @@
<path location="${install.dir}"/>
</pathconvert>
-->
- <!--
- Load the default connection properties. These connection properties can be used in cases
- when automation isn't being used.
- Its expected that when run from Hudson, that the properties will set at the system level
-
- <loadproperties srcFile="${install_dir}/bin/connection.properties"/>
- -->
-
<condition property="all">
<not>
<isset property="single"/>
@@ -58,6 +55,7 @@
<sequential>
<antcall target="exec.scenario" inheritall="true" >
<param name="scenario.file" value="@{file}" />
+ <param name="scenario.dir" value="@{file}" />
</antcall>
<!--
@@ -101,8 +99,67 @@
<jvmarg value="-Dvdb.artifacts.dir=${vdb.artifacts.dir}" />
</java>
+
+ <antcall target="is.there.output" inheritall="true" >
+ </antcall>
+
</target>
+
+ <target name="is.there.output" >
+ <loadproperties srcFile="${scenario.file}" />
+
+ <basename property="scenario.name" file="${scenario.file}"
+ suffix=".properties"/>
+ <echo>Are there any files ${root_output}//${queryset.dir}/output/${scenario.name}</echo>
+
+ <path id="output.dir.files">
+ <fileset dir="${root_output}/${queryset.dir}/output/${scenario.name}">
+ <include name="*.txt"/>
+ </fileset>
+ </path>
+
+ <condition property="has.output">
+ <resourcecount refid="output.dir.files" when="greater" count="0" />
+ </condition>
+ <echo>Is there output ${has.output}</echo>
+
+ <path id="error.files">
+ <fileset dir="${root_output}/${queryset.dir}/output/${scenario.name}">
+ <include name="ERROR*"/>
+ </fileset>
+ </path>
+
+ <condition property="error.files.exist">
+ <resourcecount refid="error.files" when="greater" count="0" />
+
+ </condition>
+
+ <echo>Do Error files exists ${error.files.exist}</echo>
+
+ <condition property="error.exist">
+ <not>
+ <isset property="has.output"/>
+ </not>
+ </condition>
+ <condition property="error.exist">
+ <isset property="error.files.exist"/>
+ </condition>
+
+ <echo>Is this considered an error ${error.exist}</echo>
+
+ <antcall target="touch.error.file" inheritall="true" />
+
+ </target>
+
+ <target name="touch.error.file"
+ if="error.exist">
+ <echo>Touch to Flag Error at ${ERROR_FILE} </echo>
+ <touch file="${ERROR_FILE}"/>
+
+ </target>
+
+
</project>
\ No newline at end of file
15 years
teiid SVN: r1707 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/query.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-01-05 11:53:42 -0500 (Tue, 05 Jan 2010)
New Revision: 1707
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/query/AbstractQueryTransactionTest.java
Log:
Teiid 781 - fix NPE occuring when expection wasnt found
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/query/AbstractQueryTransactionTest.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/query/AbstractQueryTransactionTest.java 2010-01-05 15:50:15 UTC (rev 1706)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/query/AbstractQueryTransactionTest.java 2010-01-05 16:53:42 UTC (rev 1707)
@@ -297,8 +297,11 @@
if (super.getLastException() != null) {
return super.getLastException();
}
+ if (this.applicationException != null) {
+ return new SQLException(this.applicationException.getClass().getName() + ":" + this.applicationException.getMessage());
+ }
- return new SQLException(this.applicationException.getClass().getName() + ":" + this.applicationException.getMessage());
+ return null;
}
@Override
15 years
teiid SVN: r1706 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-01-05 10:50:15 -0500 (Tue, 05 Jan 2010)
New Revision: 1706
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OffWrapTransactionTests.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OnWrapTransactionTests.java
Log:
Teiid-897 - updated tests so that its makes it easier to identify the test thats running when problems are occuring
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.java 2009-12-24 05:21:00 UTC (rev 1705)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.java 2010-01-05 15:50:15 UTC (rev 1706)
@@ -12,7 +12,6 @@
import org.teiid.test.framework.query.QueryExecution;
import org.teiid.test.framework.transaction.TxnAutoTransaction;
-import com.arjuna.common.internal.util.logging.commonPropertyManager;
import com.metamatrix.jdbc.api.AbstractQueryTest;
@@ -34,7 +33,7 @@
* result = rollback
*/
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 200; i < 210; i++) {
Integer val = new Integer(i);
@@ -70,7 +69,7 @@
* result = rollback
*/
public void testSingleSourceBatchCommandReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceBatchCommandReferentialIntegrityRollback") {
public void testCase() throws Exception {
ArrayList list = new ArrayList();
for (int i = 200; i < 210; i++) {
@@ -106,7 +105,7 @@
* result = commit
*/
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
ArrayList list = new ArrayList();
public void testCase() throws Exception {
for (int i = 100; i < 120; i++) {
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OffWrapTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OffWrapTransactionTests.java 2009-12-24 05:21:00 UTC (rev 1705)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OffWrapTransactionTests.java 2010-01-05 15:50:15 UTC (rev 1706)
@@ -113,7 +113,7 @@
* result = rollback
*/
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 200; i < 210; i++) {
@@ -151,7 +151,7 @@
* result = commit
*/
public void testMultipleSourceSelect() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelect") {
public void testCase() throws Exception {
execute("select * from pm1.g1 join pm2.g1 on pm1.g1.e1 = pm2.g1.e1 where pm1.g1.e1 < 100");
assertRowCount(100);
@@ -169,7 +169,7 @@
* result = commit
*/
public void testMultipleSourceUpdate() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceUpdate") {
public void testCase() throws Exception {
execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(500, '500', 500, '500')");
}
@@ -198,7 +198,7 @@
*/
public void testMultipleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 700; i < 710; i++) {
@@ -243,7 +243,7 @@
public void testMultipleSourceBulkRowInsert() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsert") {
ArrayList list = new ArrayList();
public void testCase() throws Exception {
for (int i = 800; i < 807; i++) {
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OnWrapTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OnWrapTransactionTests.java 2009-12-24 05:21:00 UTC (rev 1705)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OnWrapTransactionTests.java 2010-01-05 15:50:15 UTC (rev 1706)
@@ -36,7 +36,7 @@
* result = rollback
*/
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 200; i < 210; i++) {
Integer val = new Integer(i);
@@ -73,7 +73,7 @@
* result = rollback
*/
public void testSingleSourceBatchCommandReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceBatchCommandReferentialIntegrityRollback") {
public void testCase() throws Exception {
ArrayList list = new ArrayList();
for (int i = 200; i < 210; i++) {
@@ -109,7 +109,7 @@
* result = commit
*/
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
ArrayList list = new ArrayList();
public void testCase() throws Exception {
for (int i = 100; i < 110; i++) {
15 years