teiid SVN: r1508 - trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-09-30 14:47:20 -0400 (Wed, 30 Sep 2009)
New Revision: 1508
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java
Log:
TEIID-865
Getting SoapAction from model.
Modified: trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java
===================================================================
--- trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java 2009-09-30 18:33:01 UTC (rev 1507)
+++ trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java 2009-09-30 18:47:20 UTC (rev 1508)
@@ -72,6 +72,14 @@
Source.class,
Service.Mode.PAYLOAD);
+ // I should be able to send no value here, but the dispatch throws an exception
+ // if soapAction == null. We allow the default "" to get sent in that case.
+ // In SOAP 1.1 we must send a SoapAction.
+ String soapAction = (String)exeInfo.getOtherProperties().get("SOAPAction");
+ if(null != soapAction) {
+ dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, soapAction);
+ }
+
String requestDocument = xmlOutputter.outputString(doc);
attemptConditionalLog(requestDocument);
StringReader reader = new StringReader(requestDocument);
16 years, 2 months
teiid SVN: r1507 - in trunk: metadata/src/test/java/com/metamatrix/connector/metadata/index and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-30 14:33:01 -0400 (Wed, 30 Sep 2009)
New Revision: 1507
Modified:
trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java
trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java
Log:
TEIID-750 cleaning up some of the visibility logic and adding a test case for resolving against only public models.
Modified: trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java 2009-09-30 18:18:30 UTC (rev 1506)
+++ trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java 2009-09-30 18:33:01 UTC (rev 1507)
@@ -59,7 +59,6 @@
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
-import com.metamatrix.query.sql.visitor.CommandCollectorVisitor;
import com.metamatrix.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import com.metamatrix.query.util.ErrorMessageKeys;
Modified: trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java 2009-09-30 18:18:30 UTC (rev 1506)
+++ trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java 2009-09-30 18:33:01 UTC (rev 1507)
@@ -25,6 +25,8 @@
import java.util.HashMap;
import java.util.Map;
+import junit.framework.TestCase;
+
import org.teiid.connector.metadata.MetadataLiteralCriteria;
import org.teiid.connector.metadata.MetadataResultsPostProcessor;
import org.teiid.connector.metadata.VdbMetadataContext;
@@ -32,8 +34,7 @@
import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import junit.framework.TestCase;
-
+import com.metamatrix.dqp.service.FakeVDBService;
import com.metamatrix.dqp.service.VDBService;
16 years, 2 months
teiid SVN: r1506 - in trunk: engine/src/test/java/com/metamatrix/dqp/service and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-30 14:18:30 -0400 (Wed, 30 Sep 2009)
New Revision: 1506
Removed:
trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/FakeVDBService.java
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/ModelVisibilityValidationVisitor.java
trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeVDBService.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataConnectorMetadata.java
Log:
TEIID-750 cleaning up some of the visibility logic and adding a test case for resolving against only public models.
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/ModelVisibilityValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/ModelVisibilityValidationVisitor.java 2009-09-30 17:01:20 UTC (rev 1505)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/ModelVisibilityValidationVisitor.java 2009-09-30 18:18:30 UTC (rev 1506)
@@ -34,7 +34,6 @@
import com.metamatrix.query.function.FunctionLibrary;
import com.metamatrix.query.metadata.TempMetadataID;
import com.metamatrix.query.resolver.util.ResolverUtil;
-import com.metamatrix.query.resolver.util.ResolverUtil.ResolvedLookup;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Delete;
import com.metamatrix.query.sql.lang.Insert;
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeVDBService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeVDBService.java 2009-09-30 17:01:20 UTC (rev 1505)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeVDBService.java 2009-09-30 18:18:30 UTC (rev 1506)
@@ -24,8 +24,10 @@
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -37,52 +39,16 @@
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
import com.metamatrix.common.vdb.api.ModelInfo;
import com.metamatrix.common.vdb.api.VDBArchive;
+import com.metamatrix.vdb.runtime.VDBKey;
/**
*/
public class FakeVDBService extends FakeAbstractService implements VDBService {
private Map vdbsMap = new HashMap(); // VdbInfo -> Map<Model name (upper), <ModelInfo>>
private Map bindingNames = new HashMap(); // binding UUID -> binding name
+ public Collection publicFiles = new HashSet();
+ private boolean defaultPrivate;
- private static class VdbInfo {
- private final String vdbName;
- private final String vdbVersion;
-
- private final String key;
-
- public VdbInfo(String name, String version) {
- this.vdbName = name;
- this.vdbVersion = version;
- this.key = name.toUpperCase() + ":" + version; //$NON-NLS-1$
- }
-
- public String getName() {
- return this.vdbName;
- }
-
- public String getVersion() {
- return this.vdbVersion;
- }
-
- public boolean equals(Object obj) {
- if(obj == null) {
- return false;
- } else if(obj == this) {
- return true;
- } else {
- return this.key.equals(((VdbInfo)obj).key);
- }
- }
-
- public int hashCode() {
- return this.key.hashCode();
- }
-
- public String toString() {
- return vdbName + ":" + vdbVersion; //$NON-NLS-1$
- }
- }
-
private static class FakeModel {
String modelName;
boolean multiSource = false;
@@ -91,6 +57,10 @@
List bindingUUIDs = new ArrayList(); // mapped to names
}
+ public void setDefaultPrivate(boolean defaultPrivate) {
+ this.defaultPrivate = defaultPrivate;
+ }
+
/**
* Method for testing - add a model with the specified properties. The vdb will be created
* automatically under the hood.
@@ -107,7 +77,7 @@
model.multiSource = multiSource;
model.modelName = modelName;
- VdbInfo vdb = new VdbInfo(vdbName, version);
+ VDBKey vdb = new VDBKey(vdbName, version);
Map vdbModels = (Map)this.vdbsMap.get(vdb);
if(vdbModels == null) {
vdbModels = new HashMap();
@@ -131,7 +101,7 @@
FakeModel model = null;
// Find existing model
- VdbInfo vdb = new VdbInfo(vdbName, version);
+ VDBKey vdb = new VDBKey(vdbName, version);
Map vdbModels = (Map)this.vdbsMap.get(vdb);
if(vdbModels != null) {
model = (FakeModel) vdbModels.get(modelName.toUpperCase());
@@ -158,14 +128,14 @@
* @see com.metamatrix.dqp.service.VDBService#isActiveVDB(java.lang.String, java.lang.String)
*/
public boolean isActiveVDB(String vdbName, String vdbVersion) {
- return vdbsMap.containsKey(new VdbInfo(vdbName, vdbVersion));
+ return vdbsMap.containsKey(new VDBKey(vdbName, vdbVersion));
}
/* (non-Javadoc)
* @see com.metamatrix.dqp.service.VDBService#getConnectorBinding(java.lang.String, java.lang.String, java.lang.String)
*/
public List getConnectorBindingNames(String vdbName, String vdbVersion, String modelName) {
- VdbInfo vdb = new VdbInfo(vdbName, vdbVersion);
+ VDBKey vdb = new VDBKey(vdbName, vdbVersion);
Map vdbModels = (Map)this.vdbsMap.get(vdb);
if(vdbModels != null) {
FakeModel model = (FakeModel) vdbModels.get(modelName.toUpperCase());
@@ -187,7 +157,7 @@
* @see com.metamatrix.dqp.service.VDBService#getModelVisibility(java.lang.String, java.lang.String, java.lang.String)
*/
public int getModelVisibility(String vdbName, String vdbVersion, String modelName) {
- VdbInfo vdb = new VdbInfo(vdbName, vdbVersion);
+ VDBKey vdb = new VDBKey(vdbName, vdbVersion);
Map vdbModels = (Map)this.vdbsMap.get(vdb);
if(vdbModels != null) {
FakeModel model = (FakeModel) vdbModels.get(modelName.toUpperCase());
@@ -195,7 +165,9 @@
return model.visibility;
}
}
-
+ if (defaultPrivate) {
+ return ModelInfo.PRIVATE;
+ }
return ModelInfo.PUBLIC;
}
@@ -204,7 +176,10 @@
* @since 4.2
*/
public int getFileVisibility(String vdbName, String vdbVersion, String pathInVDB) throws MetaMatrixComponentException {
- return ModelInfo.PUBLIC;
+ if(this.publicFiles.contains(pathInVDB)) {
+ return ModelInfo.PUBLIC;
+ }
+ return ModelInfo.PRIVATE;
}
/* (non-Javadoc)
@@ -240,7 +215,7 @@
public List getMultiSourceModels(String vdbName,
String vdbVersion) throws MetaMatrixComponentException {
- VdbInfo vdb = new VdbInfo(vdbName, vdbVersion);
+ VDBKey vdb = new VDBKey(vdbName, vdbVersion);
Map vdbModels = (Map)this.vdbsMap.get(vdb);
if(vdbModels != null) {
List multiModels = new ArrayList();
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2009-09-30 17:01:20 UTC (rev 1505)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2009-09-30 18:18:30 UTC (rev 1506)
@@ -80,8 +80,8 @@
env.bindService(DQPServiceNames.DATA_SERVICE, new AutoGenDataService());
env.bindService(DQPServiceNames.TRANSACTION_SERVICE, new FakeTransactionService());
FakeVDBService vdbService = new FakeVDBService();
+ vdbService.setDefaultPrivate(true);
vdbService.addBinding(vdbName, vdbVersion, "BQT1", "mmuuid:blah", "BQT"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- vdbService.addBinding(vdbName, vdbVersion, "BQT2", "mmuuid:blah", "BQT"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
vdbService.addBinding(vdbName, vdbVersion, "BQT3", "mmuuid:blah", "BQT"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
vdbService.addModel(vdbName, vdbVersion, "BQT3", ModelInfo.PRIVATE, false); //$NON-NLS-1$
env.bindService(DQPServiceNames.VDB_SERVICE, vdbService);
@@ -247,6 +247,10 @@
helpTestVisibilityFails(xquery);
}
+ @Test public void testResolvingVisibility() throws Exception {
+ String sql = "SELECT * FROM SmallA"; //$NON-NLS-1$
+ helpExecute(sql, "a"); //$NON-NLS-1$
+ }
///////////////////////////Helper method///////////////////////////////////
private ResultsMessage helpExecute(String sql, String userName) throws Exception {
Deleted: trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/FakeVDBService.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/FakeVDBService.java 2009-09-30 17:01:20 UTC (rev 1505)
+++ trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/FakeVDBService.java 2009-09-30 18:18:30 UTC (rev 1506)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.connector.metadata.index;
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.application.ApplicationEnvironment;
-import com.metamatrix.common.application.exception.ApplicationInitializationException;
-import com.metamatrix.common.application.exception.ApplicationLifecycleException;
-import com.metamatrix.common.vdb.api.ModelInfo;
-import com.metamatrix.common.vdb.api.VDBArchive;
-import com.metamatrix.dqp.service.VDBService;
-
-
-/**
- * @since 4.3
- */
-public class FakeVDBService implements
- VDBService {
- public Collection publicModels = new HashSet();
-
- public Collection publicFiles = new HashSet();
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getConnectorBindingNames(java.lang.String, java.lang.String, java.lang.String)
- * @since 4.3
- */
- public List getConnectorBindingNames(String vdbName,
- String vdbVersion,
- String modelName) throws MetaMatrixComponentException {
- return null;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getModelVisibility(java.lang.String, java.lang.String, java.lang.String)
- * @since 4.3
- */
- public int getModelVisibility(String vdbName,
- String vdbVersion,
- String modelName) throws MetaMatrixComponentException {
- if(this.publicModels.contains(modelName)) {
- return ModelInfo.PUBLIC;
- }
- return ModelInfo.PRIVATE;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getFileVisibility(java.lang.String, java.lang.String, java.lang.String)
- * @since 4.3
- */
- public int getFileVisibility(String vdbName,
- String vdbVersion,
- String pathInVDB) throws MetaMatrixComponentException {
- if(this.publicFiles.contains(pathInVDB)) {
- return ModelInfo.PUBLIC;
- }
- return ModelInfo.PRIVATE;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getVDBResource(java.lang.String, java.lang.String)
- * @since 4.3
- */
- public InputStream getVDBResource(String vdbName,
- String vdbVersion) throws MetaMatrixComponentException {
- return null;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getMultiSourceModels(java.lang.String, java.lang.String)
- * @since 4.3
- */
- public List getMultiSourceModels(String vdbName,
- String vdbVersion) throws MetaMatrixComponentException {
- return null;
- }
-
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getAvailableVDBs()
- * @since 4.3
- */
- public List getAvailableVDBs() throws MetaMatrixComponentException {
- return null;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getVDBStatus(java.lang.String, java.lang.String)
- * @since 4.3
- */
- public int getVDBStatus(String vdbName,
- String vdbVersion) throws MetaMatrixComponentException {
- return 0;
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#changeVDBStatus(java.lang.String, java.lang.String, int)
- * @since 4.3
- */
- public void changeVDBStatus(String vdbName,
- String vdbVersion,
- int status) throws ApplicationLifecycleException,
- MetaMatrixComponentException {
- }
-
- /**
- * @see com.metamatrix.dqp.service.VDBService#getConnectorName(java.lang.String)
- * @since 4.3
- */
- public String getConnectorName(String connectorBindingID) {
- return null;
- }
-
- /**
- * @see com.metamatrix.common.application.ApplicationService#initialize(java.util.Properties)
- * @since 4.3
- */
- public void initialize(Properties props) throws ApplicationInitializationException {
- }
-
- /**
- * @see com.metamatrix.common.application.ApplicationService#start(com.metamatrix.common.application.ApplicationEnvironment)
- * @since 4.3
- */
- public void start(ApplicationEnvironment environment) throws ApplicationLifecycleException {
- }
-
- /**
- * @see com.metamatrix.common.application.ApplicationService#stop()
- * @since 4.3
- */
- public void stop() throws ApplicationLifecycleException {
- }
-
- @Override
- public String getActiveVDBVersion(String vdbName, String vdbVersion) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public VDBArchive getVDB(String vdbName, String vdbVersion)
- throws MetaMatrixComponentException {
- throw new UnsupportedOperationException();
- }
-
-}
Modified: trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataConnectorMetadata.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataConnectorMetadata.java 2009-09-30 17:01:20 UTC (rev 1505)
+++ trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataConnectorMetadata.java 2009-09-30 18:18:30 UTC (rev 1506)
@@ -28,6 +28,8 @@
import java.util.HashMap;
import java.util.Map;
+import junit.framework.TestCase;
+
import org.teiid.connector.metadata.FileRecordImpl;
import org.teiid.connector.metadata.MetadataConnectorMetadata;
import org.teiid.connector.metadata.MetadataLiteralCriteria;
@@ -39,10 +41,10 @@
import org.teiid.metadata.index.IndexConstants;
import org.teiid.metadata.index.IndexMetadataStore;
-import junit.framework.TestCase;
-
+import com.metamatrix.common.vdb.api.ModelInfo;
import com.metamatrix.common.vdb.api.VDBArchive;
import com.metamatrix.core.util.UnitTestUtil;
+import com.metamatrix.dqp.service.FakeVDBService;
import com.metamatrix.dqp.service.VDBService;
import com.metamatrix.metadata.runtime.api.MetadataSource;
@@ -78,13 +80,15 @@
return new MetadataConnectorMetadata(context, new CompositeMetadataStore(Arrays.asList(composite), source));
}
- public VDBService helpGetVdbService() {
- return new FakeVDBService();
+ public FakeVDBService helpGetVdbService() {
+ FakeVDBService vdbService = new FakeVDBService();
+ vdbService.setDefaultPrivate(true);
+ return vdbService;
}
public void testGetFileRecords() throws Exception {
String entityPath = "/parts/partsmd/PartsSupplier.xmi"; //$NON-NLS-1$
- FakeVDBService service = (FakeVDBService) helpGetVdbService();
+ FakeVDBService service = helpGetVdbService();
service.publicFiles.add(entityPath);
MetadataLiteralCriteria literalcriteria = new MetadataLiteralCriteria(FileRecordImpl.MetadataMethodNames.PATH_IN_VDB_FIELD, entityPath);
Map criteria = new HashMap();
@@ -97,8 +101,8 @@
public void testGetPublicModelRecords() throws Exception {
String modelName = "PartsSupplier"; //$NON-NLS-1$
- FakeVDBService service = (FakeVDBService) helpGetVdbService();
- service.publicModels.add(modelName);
+ FakeVDBService service = helpGetVdbService();
+ service.addModel(TEST_VDB_NAME, TEST_VDB_VERSION, modelName, ModelInfo.PUBLIC, false);
MetadataLiteralCriteria literalcriteria = new MetadataLiteralCriteria(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD, modelName);
Map criteria = new HashMap();
criteria.put(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD.toUpperCase(), literalcriteria);
@@ -112,7 +116,7 @@
public void testGetPrivateModelRecords() throws Exception {
String modelName = "PartsSupplier"; //$NON-NLS-1$
- FakeVDBService service = (FakeVDBService) helpGetVdbService();
+ FakeVDBService service = helpGetVdbService();
//service.publicModels.add(modelName);
MetadataLiteralCriteria literalcriteria = new MetadataLiteralCriteria(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD, modelName);
Map criteria = new HashMap();
@@ -126,7 +130,7 @@
}
public void testGetWrappedVdbRecords() throws Exception {
- FakeVDBService service = (FakeVDBService) helpGetVdbService();
+ FakeVDBService service = helpGetVdbService();
Map criteria = new HashMap();
MetadataConnectorMetadata metadata = helpGetMetadata(TEST_FILE_NAME, TEST_VDB_NAME, TEST_VDB_VERSION, service);
Collection records = metadata.getObjects(IndexConstants.INDEX_NAME.VDBS_INDEX, criteria);
@@ -138,8 +142,8 @@
public void testGetRecordsWithFalseCriteria() throws Exception {
String modelName = "PartsSupplier"; //$NON-NLS-1$
- FakeVDBService service = (FakeVDBService) helpGetVdbService();
- service.publicModels.add(modelName);
+ FakeVDBService service = helpGetVdbService();
+ service.addModel(TEST_VDB_NAME, TEST_VDB_VERSION, modelName, ModelInfo.PUBLIC, false);
MetadataLiteralCriteria literalcriteria = new MetadataLiteralCriteria(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD, modelName);
literalcriteria.setFieldFunction("UPPER"); //$NON-NLS-1$
Map criteria = new HashMap();
16 years, 2 months
teiid SVN: r1505 - in trunk/test-integration/db/src/main/resources/datasources: mysql and 4 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 13:01:20 -0400 (Wed, 30 Sep 2009)
New Revision: 1505
Modified:
trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties
Log:
Teiid 773 - changes to properties names for correct case sensitive
Modified: trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=localhost
-databasename=(databasename)
-portnumber=1527
+ServerName=localhost
+SatabaseNMame=(databasename)
+PortNumber=1527
ds-jndiname=localhost_1527
Immutable=true
Modified: trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=(servername)
-databasename=(databasename)
-portnumber=3306
+ServerName=(servername)
+DatabaseName=(databasename)
+PortNumber=3306
ds-jndiname=mysql_3306
Immutable=true
Modified: trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=(servername)
-databasename=(databasename)
-portnumber=1527
+ServerName=(servername)
+DatabaseName=(databasename)
+PortNumber=1527
ds-jndiname=(servername)_1527
Immutable=true
Modified: trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=(servername)
-databasename=(databasename)
-portnumber=5432
+ServerName=(servername)
+DatabaseName=(databasename)
+PortNumber=5432
ds-jndiname=(servername)_5432
Immutable=true
Modified: trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=(servername)
-databasename=(databasename)
-portnumber=1433
+ServerName=(servername)
+DatabaseName=(databasename)
+PortNumber=1433
ds-jndiname=microsoft_1433
Immutable=true
Modified: trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties 2009-09-30 16:47:23 UTC (rev 1504)
+++ trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties 2009-09-30 17:01:20 UTC (rev 1505)
@@ -9,9 +9,9 @@
User=
Password=
-servername=(servername)
-databasename=(databasename)
-portnumber=3306
+ServerName=(servername)
+DatabaseName=(databasename)
+PortNumber=3306
ds-jndiname=microsoft_3306
Immutable=true
16 years, 2 months
teiid SVN: r1504 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:47:23 -0400 (Wed, 30 Sep 2009)
New Revision: 1504
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
Log:
Teiid 773 - cleanup
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-09-30 16:34:39 UTC (rev 1503)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-09-30 16:47:23 UTC (rev 1504)
@@ -27,7 +27,7 @@
protected void setUp() throws Exception {
super.setUp();
- this.addProperty(ConfigPropertyNames.USE_DATASOURCES_PROP, "oracle,sqlserver");
+// this.addProperty(ConfigPropertyNames.USE_DATASOURCES_PROP, "oracle,sqlserver");
this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
16 years, 2 months
teiid SVN: r1503 - trunk/test-integration/db/src/main/resources.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:34:39 -0400 (Wed, 30 Sep 2009)
New Revision: 1503
Modified:
trunk/test-integration/db/src/main/resources/default-config.properties
trunk/test-integration/db/src/main/resources/xa-config.properties
Log:
Teiid 773 - changed the following:
- the testcase will not use system property to pass in overrides/additions to the loaded config.properties file. Now will use an addProperty() method provided on the abstract testcase that will apply the properties per test.
- remove the datasource_mapping.xml. There is no need to distinquish between xa and nonxa connector types. The connector type will be specified in the connection.properties file.
- if using the -DuserDataSources property to control datasource, it will imply order based on whats specified. The config.properties file will now map the model to order (i.e., pm1:1), where this order determines which datasource it will correspond to based on the userDataSources property. This mapping is done so that the nightly testing process can control which datasources are being used and can ensure retestability.
Modified: trunk/test-integration/db/src/main/resources/default-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/default-config.properties 2009-09-30 16:25:50 UTC (rev 1502)
+++ trunk/test-integration/db/src/main/resources/default-config.properties 2009-09-30 16:34:39 UTC (rev 1503)
@@ -21,9 +21,9 @@
URL=jdbc:metamatrix:Transaction@target/classes/transactions/transaction.properties;user=admin;password=teiid
User=admin
Password=teiid
-databasename=Transaction
-servername=target/classes/transactions/transaction.properties
-portnumber=0
+DatabaseName=Transaction
+ServerName=target/classes/transactions/transaction.properties
+PortNumber=0
application-name=txn-test
# jboss
Modified: trunk/test-integration/db/src/main/resources/xa-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/xa-config.properties 2009-09-30 16:25:50 UTC (rev 1502)
+++ trunk/test-integration/db/src/main/resources/xa-config.properties 2009-09-30 16:34:39 UTC (rev 1503)
@@ -18,9 +18,9 @@
URL=jdbc:metamatrix:Transaction@target/classes/transactions/transaction.properties;user=admin;password=teiid
User=admin
Password=teiid
-databasename=Transaction
-servername=target/classes/transactions/transaction.properties
-portnumber=0
+DatabaseName=Transaction
+ServerName=target/classes/transactions/transaction.properties
+PortNumber=0
application-name=txn-test
# jboss
16 years, 2 months
teiid SVN: r1502 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:25:50 -0400 (Wed, 30 Sep 2009)
New Revision: 1502
Removed:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/DataSourceSetup.java
Log:
Teiid 773 - changed the following:
- the testcase will not use system property to pass in overrides/additions to the loaded config.properties file. Now will use an addProperty() method provided on the abstract testcase that will apply the properties per test.
- remove the datasource_mapping.xml. There is no need to distinquish between xa and nonxa connector types. The connector type will be specified in the connection.properties file.
- if using the -DuserDataSources property to control datasource, it will imply order based on whats specified. The config.properties file will now map the model to order (i.e., pm1:1), where this order determines which datasource it will correspond to based on the userDataSources property. This mapping is done so that the nightly testing process can control which datasources are being used and can ensure retestability.
Deleted: trunk/test-integration/db/src/main/java/org/teiid/test/framework/DataSourceSetup.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/DataSourceSetup.java 2009-09-30 16:09:30 UTC (rev 1501)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/DataSourceSetup.java 2009-09-30 16:25:50 UTC (rev 1502)
@@ -1,11 +0,0 @@
-package org.teiid.test.framework;
-
-public interface DataSourceSetup {
-
-
- void setup() throws Exception;
-
-
- int getDataSourceCnt();
-
-}
16 years, 2 months
teiid SVN: r1501 - in trunk/test-integration/db/src/main/resources: datasources and 6 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:09:30 -0400 (Wed, 30 Sep 2009)
New Revision: 1501
Removed:
trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml
Modified:
trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties
trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties
trunk/test-integration/db/src/main/resources/default-config.properties
trunk/test-integration/db/src/main/resources/xa-config.properties
Log:
Teiid 773 - changed the following:
- the testcase will not use system property to pass in overrides/additions to the loaded config.properties file. Now will use an addProperty() method provided on the abstract testcase that will apply the properties per test.
- remove the datasource_mapping.xml. There is no need to distinquish between xa and nonxa connector types. The connector type will be specified in the connection.properties file.
- if using the -DuserDataSources property to control datasource, it will imply order based on whats specified. The config.properties file will now map the model to order (i.e., pm1:1), where this order determines which datasource it will correspond to based on the userDataSources property. This mapping is done so that the nightly testing process can control which datasources are being used and can ensure retestability.
Deleted: trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ======================================================================
- Aug 26, 2009 9:05:03 AM
-
- description: This datasource configuration file is used to define the
- different datasources that "may be" used during test execution.
- I say may be used, because these are all the types that are supported
- by Teiid, but only if the defined "dir" exist under the "datasources"
- directory that contains a connection.properties file will it actually be used.
-
- The organization of the datasources splits them between groups XA and Non-XA
- related transactional types so that when a test is run the process will obtain
- a connection from a datasoure defined for that group.
-
- To use a datasource(s) in a test, map the model(s) to a datasource indicated here.
- The mapping is done in the configuration properties file (see default-config.properties).
-
- This configuration specifies the following information:
- - It indicates the location ("dir") to find the datasource connection
- information that is used to populate the connector bindings and create
- direct connections to the source.
-
- - It provides a mapping to the Connector Type that needs
- to be specified when deploying the ConnectorBinding and assigning it to
- the mapped model (see default.config.properties)
-
- NOTE: the name of datasource must be unique across all datasources in the file
-
- vanhalbert
- ====================================================================== -->
-
-<datasourceconfig>
- <datasourcetype name="nonxa">
- <datasource name="ds_mysql">
- <property name="dir">mysql</property>
- <property name="connectortype">MySQL JDBC Connector</property>
- </datasource>
- <datasource name="ds_oracle">
- <property name="dir">oracle</property>
- <property name="connectortype">Oracle Connector</property>
- </datasource>
- <datasource name="ds_sqlserver">
- <property name="dir">sqlserver</property>
- <property name="connectortype">SQL Server Connector</property>
- </datasource>
- <datasource name="ds_db2">
- <property name="dir">db2</property>
- <property name="connectortype">DB2 Connector</property>
- </datasource>
- <datasource name="ds_postgres">
- <property name="dir">postgres</property>
- <property name="connectortype">PostgreSQL JDBC Connector</property>
- </datasource>
-
- <datasource name="ds_derby">
- <property name="dir">derby</property>
- <property name="connectortype">Apache Derby Network Connector</property>
- </datasource>
-
- </datasourcetype>
-
- <datasourcetype name="xa">
- <datasource name="ds_mysql_xa">
- <property name="dir">mysql</property>
- <property name="connectortype">MySQL JDBC XA Connector</property>
- </datasource>
- <datasource name="ds_oracle_xa">
- <property name="dir">oracle</property>
- <property name="connectortype">Oracle XA Connector</property>
- </datasource>
- <datasource name="ds_sqlserve_xa">
- <property name="dir">sqlserver</property>
- <property name="connectortype">SQL Server XA Connector</property>
- </datasource>
- <datasource name="ds_db2_xa">
- <property name="dir">db2</property>
- <property name="connectortype">DB2 XA Connector</property>
- </datasource>
- <datasource name="ds_postgres_xa">
- <property name="dir">postgres</property>
- <property name="connectortype">PostgreSQL XA JDBC Connector</property>
- </datasource>
-
- </datasourcetype>
-
-</datasourceconfig>
\ No newline at end of file
Modified: trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/derby/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,4 +1,9 @@
+# db.type must match a ddl folder
db.type=derby
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectortype=Apache Derby Network XA Connector
+
+
driver=org.apache.derby.jdbc.ClientDriver
URL=jdbc:derby://localhost:1527//(derbyinstallloc)
User=
Modified: trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/mysql/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,5 +1,9 @@
-# db.type must match a ddl folder and it also represents the ANT sql datatype used during execution
+# db.type must match a ddl folder
db.type=mysql
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectortype=MySQL JDBC XA Connector
+
+
driver=com.mysql.jdbc.Driver
URL=jdbc:mysql://(servername):3306/(databasename)
User=
Modified: trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/oracle/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,5 +1,9 @@
# db.type must match a ddl folder
db.type=oracle
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectortype=Oracle XA Connector
+
+
driver=oracle.jdbc.OracleDriver
URL=jdbc:oracle:thin:@(servername):1521:(sid)
User=
Modified: trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/postgres/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,5 +1,9 @@
# db.type must match a ddl folder
db.type=postgres
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectortype=PostgreSQL XA JDBC Connector
+
+
driver=org.postgresql.Driver
URL=jdbc:postgresql://(servername):5432/(databasename)
User=
Modified: trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/sqlserver/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,5 +1,9 @@
# db.type must match a ddl folder
db.type=sqlserver
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectortype=SQL Server XA Connector
+
+
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
URL=jdbc:sqlserver://(servername):1433;databaseName=(databasename)
User=
Modified: trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/datasources/sybase/example_connection.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -1,5 +1,9 @@
# db.type must match a ddl folder
db.type=sybase
+# db.connectortype must match a connector type defined in the configuration.xml
+db.connectorytype=
+
+
driver=com.mysql.jdbc.Driver
URL=jdbc:mysql://(servername):3306/(databasename)
User=
Modified: trunk/test-integration/db/src/main/resources/default-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/default-config.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/default-config.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -4,7 +4,7 @@
# local, xa, jndi
-transaction-type=local
+#transaction-type=local
process-batch = 20
connector-batch = 20
@@ -34,20 +34,18 @@
mm.ds-jndiname=mmXA
usertxn-jndiname=java:comp/UserTransaction
-# === Mode-to-Datasource Mapping ======
-# <model>=<datasource type name>
-# This mapping will be used by the set of testcases that load this config file.
-# These mapping control what datasource is mapped to which model
+# These mappings control what datasource is mapped to which model when the -Dusedatasources=<comma seperated datasource names> option is used
+# or the system environment is set.
#
-# See the resources/datasources/datasource_mapping.xml for the available datasource type names
+# By providing the numerical order, it indicates which datasource to assign based on the order in the usedatasources property.
#
-# <datasource type name> can be the name of either a datasourcegroup or datasource
+# If -Dusedatasources is not set, then the datasource will be assigned in the order they are calling to obtain a datasource.
#
#
-pm1=nonxa
-pm2=nonxa
+pm1=1
+pm2=2
##########################################
Modified: trunk/test-integration/db/src/main/resources/xa-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/xa-config.properties 2009-09-30 16:08:14 UTC (rev 1500)
+++ trunk/test-integration/db/src/main/resources/xa-config.properties 2009-09-30 16:09:30 UTC (rev 1501)
@@ -31,20 +31,17 @@
mm.ds-jndiname=mmXA
usertxn-jndiname=java:comp/UserTransaction
-# === Mode-to-Datasource Mapping ======
-# <model>=<datasource type name>
-
-# This mapping will be used by the set of testcases that load this config file.
-# These mapping control what datasource is mapped to which model
+# These mappings control what datasource is mapped to which model when the -Dusedatasources=<comma seperated datasource names> option is used
+# or the system environment is set.
#
-# See the resources/datasources/datasource_mapping.xml for the available datasource type names
+# By providing the numerical order, it indicates which datasource to assign based on the order in the usedatasources property.
#
-# <datasource type name> can be the name of either a datasourcegroup or datasource
+# If -Dusedatasources is not set, then the datasource will be assigned in the order they are calling to obtain a datasource.
#
#
-pm1=xa
-pm2=xa
+pm1=1
+pm2=2
##########################################
16 years, 2 months
teiid SVN: r1500 - in trunk/test-integration/db/src/test/java/org/teiid/test: framework/datasource and 1 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:08:14 -0400 (Wed, 30 Sep 2009)
New Revision: 1500
Added:
trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetup.java
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java
trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetupFactory.java
trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/SingleDataSourceSetup.java
trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/TwoDataSourceSetup.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionScenarios.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java
Log:
Teiid 773 - changed the following:
- the testcase will not use system property to pass in overrides/additions to the loaded config.properties file. Now will use an addProperty() method provided on the abstract testcase that will apply the properties per test.
- remove the datasource_mapping.xml. There is no need to distinquish between xa and nonxa connector types. The connector type will be specified in the connection.properties file.
- if using the -DuserDataSources property to control datasource, it will imply order based on whats specified. The config.properties file will now map the model to order (i.e., pm1:1), where this order determines which datasource it will correspond to based on the userDataSources property. This mapping is done so that the nightly testing process can control which datasources are being used and can ensure retestability.
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -16,12 +16,13 @@
import javax.sql.XAConnection;
+import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
import org.teiid.test.framework.connection.ConnectionStrategy;
import org.teiid.test.framework.connection.ConnectionUtil;
import org.teiid.test.framework.datasource.DataSource;
+import org.teiid.test.framework.datasource.DataSourceSetup;
import org.teiid.test.framework.datasource.DataSourceSetupFactory;
import org.teiid.test.framework.exception.QueryTestFailedException;
-import org.teiid.test.framework.exception.TransactionRuntimeException;
import com.metamatrix.jdbc.api.AbstractQueryTest;
@@ -40,7 +41,9 @@
protected Map<String, DataSource> datasources = null;
+ protected ConnectionStrategy connStrategy;
+
public AbstractQueryTransactionTest() {
super();
}
@@ -53,18 +56,16 @@
public String getTestName() {
return this.testname;
}
+
- /**
- * Called to set the datasources used during this test
- *
- * @since
- */
- public void setDataSources(Map<String, DataSource> datasources) {
- this.datasources = datasources;
+ @Override
+ public void setConnectionStrategy(ConnectionStrategy connStrategy) {
+ this.connStrategy = connStrategy;
+ this.datasources = this.connStrategy.getDataSources();
+
}
-
-
- public void setExecutionProperties(Properties props) {
+
+ public void setExecutionProperties(Properties props) {
assertNotNull(props);
this.executionProperties = props;
}
@@ -77,13 +78,13 @@
if (this.executionProperties != null) {
if (stmt instanceof com.metamatrix.jdbc.api.Statement) {
com.metamatrix.jdbc.api.Statement statement = (com.metamatrix.jdbc.api.Statement)stmt;
- String txnautowrap = this.executionProperties.getProperty(ConnectionStrategy.TXN_AUTO_WRAP);
+ String txnautowrap = this.executionProperties.getProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP);
if (txnautowrap != null) {
- statement.setExecutionProperty(ConnectionStrategy.TXN_AUTO_WRAP, txnautowrap);
+ statement.setExecutionProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP, txnautowrap);
}
- if (this.executionProperties.getProperty(ConnectionStrategy.FETCH_SIZE) != null) {
- statement.setExecutionProperty(ConnectionStrategy.FETCH_SIZE, this.executionProperties.getProperty(ConnectionStrategy.FETCH_SIZE));
+ if (this.executionProperties.getProperty(CONNECTION_STRATEGY_PROPS.FETCH_SIZE) != null) {
+ statement.setExecutionProperty(CONNECTION_STRATEGY_PROPS.FETCH_SIZE, this.executionProperties.getProperty(CONNECTION_STRATEGY_PROPS.FETCH_SIZE));
}
}
}
@@ -102,28 +103,26 @@
/**
* Override <code>setupDataSource</code> if there is different mechinism for
* setting up the datasources for the testcase
+ * @throws QueryTestFailedException
+ * @throws QueryTestFailedException
*
* @since
*/
@Override
- public void setupDataSources() {
- DataSourceSetup dss = null;
- try {
-
- dss = DataSourceSetupFactory.createDataSourceSetup(this.datasources);
- dss.setup();
- } catch(Exception e) {
- throw new TransactionRuntimeException(e.getMessage());
- }
+ public void setupDataSource() throws QueryTestFailedException {
+
+ DataSourceSetup dss = DataSourceSetupFactory.createDataSourceSetup(this.getNumberRequiredDataSources());
+ dss.setup(datasources, connStrategy);
+
}
public Connection getSource(String identifier) throws QueryTestFailedException {
- return ConnectionUtil.getConnection(identifier, this.datasources);
+ return ConnectionUtil.getConnection(identifier, this.datasources, this.connStrategy);
}
public XAConnection getXASource(String identifier) throws QueryTestFailedException {
- return ConnectionUtil.getXAConnection(identifier, this.datasources);
+ return ConnectionUtil.getXAConnection(identifier, this.datasources, this.connStrategy);
}
@@ -173,7 +172,7 @@
/**
- * At end of each test, perfrom any cleanup that your test requires.
+ * At end of each test, perfoom any cleanup that your test requires.
* Note: Do not cleanup any connections. That is performed by
* the {@link TransactionContainer#runTransaction(TransactionQueryTest)} at the end of the test.
*/
Copied: trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetup.java (from rev 1482, trunk/test-integration/db/src/main/java/org/teiid/test/framework/DataSourceSetup.java)
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetup.java (rev 0)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetup.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -0,0 +1,22 @@
+package org.teiid.test.framework.datasource;
+
+import java.util.Map;
+
+import org.teiid.test.framework.connection.ConnectionStrategy;
+import org.teiid.test.framework.datasource.DataSource;
+import org.teiid.test.framework.exception.QueryTestFailedException;
+
+/**
+ * The DataSourceSetup
+ * @author vanhalbert
+ *
+ */
+public interface DataSourceSetup {
+
+
+ void setup(Map<String, DataSource> datasources, ConnectionStrategy connStrategy) throws QueryTestFailedException;
+
+
+ int getDataSourceCnt();
+
+}
Property changes on: trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetupFactory.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetupFactory.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/DataSourceSetupFactory.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -1,26 +1,23 @@
package org.teiid.test.framework.datasource;
-import java.util.Map;
+import org.teiid.test.framework.exception.TransactionRuntimeException;
-import org.teiid.test.framework.DataSourceSetup;
-import org.teiid.test.framework.exception.QueryTestFailedException;
-
public class DataSourceSetupFactory {
- public static DataSourceSetup createDataSourceSetup(Map<String, DataSource> datasources) throws QueryTestFailedException {
+ public static DataSourceSetup createDataSourceSetup(int numofsources) {
DataSourceSetup dss = null;
- switch (datasources.size()) {
+ switch (numofsources) {
case 1:
- dss = new SingleDataSourceSetup(datasources);
+ dss = new SingleDataSourceSetup();
break;
case 2:
- dss = new TwoDataSourceSetup(datasources);
+ dss = new TwoDataSourceSetup();
break;
default:
- throw new QueryTestFailedException("Number of datasources " + datasources.size() + " is not supported");
+ throw new TransactionRuntimeException("Number of datasources " + numofsources + " is not supported");
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/SingleDataSourceSetup.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/SingleDataSourceSetup.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/SingleDataSourceSetup.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -6,9 +6,10 @@
import java.util.Map;
-import org.teiid.test.framework.DataSourceSetup;
import org.teiid.test.framework.QueryExecution;
+import org.teiid.test.framework.connection.ConnectionStrategy;
import org.teiid.test.framework.connection.ConnectionUtil;
+import org.teiid.test.framework.exception.QueryTestFailedException;
import com.metamatrix.jdbc.api.AbstractQueryTest;
@@ -18,16 +19,10 @@
* This performs the data setup for SingleSource test cases
*/
public class SingleDataSourceSetup implements DataSourceSetup {
-
- private Map ds=null;
-
- public SingleDataSourceSetup(Map datasources) {
- this.ds = datasources;
- }
-
+
@Override
- public void setup() throws Exception {
+ public void setup(Map<String, DataSource> datasources, ConnectionStrategy connStrategy) throws QueryTestFailedException {
// NOTE: dont close the connections here because in most cases they are reused
// to validate the results
// The connections will be closed at teardown
@@ -36,7 +31,7 @@
// Only one of the models are needed because pm1 and pm2 point to the same datasource
- AbstractQueryTest test1 = new QueryExecution(ConnectionUtil.getConnection("pm1", ds) ); //$NON-NLS-1$
+ AbstractQueryTest test1 = new QueryExecution(ConnectionUtil.getConnection("pm1", datasources, connStrategy) ); //$NON-NLS-1$
test1.execute("delete from g2"); //$NON-NLS-1$
test1.execute("delete from g1"); //$NON-NLS-1$
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/TwoDataSourceSetup.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/TwoDataSourceSetup.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/datasource/TwoDataSourceSetup.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -6,9 +6,10 @@
import java.util.Map;
-import org.teiid.test.framework.DataSourceSetup;
import org.teiid.test.framework.QueryExecution;
+import org.teiid.test.framework.connection.ConnectionStrategy;
import org.teiid.test.framework.connection.ConnectionUtil;
+import org.teiid.test.framework.exception.QueryTestFailedException;
import com.metamatrix.jdbc.api.AbstractQueryTest;
@@ -18,22 +19,18 @@
* This performs the data setup for SingleSource test cases
*/
public class TwoDataSourceSetup implements DataSourceSetup {
- private Map ds=null;
-
- public TwoDataSourceSetup(Map datasources) {
- this.ds = datasources;
- }
+
@Override
- public void setup() throws Exception {
+ public void setup(Map<String, DataSource> datasources, ConnectionStrategy connStrategy) throws QueryTestFailedException {
// NOTE: dont close the connections here because in most cases they are reused
// to validate the results
// The connections will be closed at teardown
System.out.println("Run TwoSource Setup...");
- AbstractQueryTest test1 = new QueryExecution(ConnectionUtil.getConnection("pm1", ds));//$NON-NLS-1$
+ AbstractQueryTest test1 = new QueryExecution(ConnectionUtil.getConnection("pm1", datasources, connStrategy));//$NON-NLS-1$
test1.execute("delete from g2"); //$NON-NLS-1$
test1.execute("delete from g1"); //$NON-NLS-1$
@@ -63,7 +60,7 @@
test1.assertRowCount(100);
- AbstractQueryTest test2 = new QueryExecution(ConnectionUtil.getConnection("pm2", ds));//$NON-NLS-1$
+ AbstractQueryTest test2 = new QueryExecution(ConnectionUtil.getConnection("pm2", datasources, connStrategy));//$NON-NLS-1$
test2.execute("delete from g2"); //$NON-NLS-1$
test2.execute("delete from g1"); //$NON-NLS-1$
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -8,34 +8,38 @@
import junit.framework.TestCase;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
-import org.teiid.test.framework.datasource.DataSourceMgr;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.transaction.TransactionFactory;
public class BaseAbstractTransactionTestCase extends TestCase {
+ protected ConfigPropertyLoader config = null;
public BaseAbstractTransactionTestCase(String name) {
super(name);
}
- @Override
+
+
+ @Override
protected void setUp() throws Exception {
- DataSourceMgr.reset();
+ // TODO Auto-generated method stub
+ super.setUp();
+
+ config = ConfigPropertyLoader.createInstance();
+
}
+
+
+
+ protected void addProperty(String key, String value) {
+ config.setProperty(key, value);
+ }
protected TransactionContainer getTransactionContainter() throws QueryTestFailedException {
- return TransactionFactory.create();
- }
+ return TransactionFactory.create(config);
+ }
-
-// public Connection getSource(String identifier) throws QueryTestFailedException {
-// return ConnectionUtil.getSource(identifier);
-// }
-//
-// public XAConnection getXASource(String identifier) throws QueryTestFailedException {
-// return ConnectionUtil.getXASource(identifier);
-// }
-
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -5,7 +5,7 @@
package org.teiid.test.testcases;
import org.teiid.test.framework.ConfigPropertyNames;
-import org.teiid.test.framework.connection.ConnectionStrategy;
+import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
/**
@@ -25,10 +25,14 @@
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
+ this.addProperty(ConfigPropertyNames.USE_DATASOURCES_PROP, "oracle,sqlserver");
- System.setProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
- System.setProperty(ConnectionStrategy.AUTOCOMMIT, "false");
- System.setProperty(ConnectionStrategy.TXN_AUTO_WRAP, "off");
+ this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
+
+ this.addProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT, "false");
+ this.addProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP, "off");
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -5,7 +5,7 @@
package org.teiid.test.testcases;
import org.teiid.test.framework.ConfigPropertyNames;
-import org.teiid.test.framework.connection.ConnectionStrategy;
+import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
/**
@@ -25,11 +25,12 @@
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
+ this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
+ this.addProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT, "true");
+ this.addProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP, "off");
- System.setProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
- System.setProperty(ConnectionStrategy.AUTOCOMMIT, "true");
- System.setProperty(ConnectionStrategy.TXN_AUTO_WRAP, "off");
-
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionScenarios.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionScenarios.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionScenarios.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -296,7 +296,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
- public void testMultipleSourceMultipleCommands() throws Exception {
+ public void lookat_testMultipleSourceMultipleCommands() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommands") {
public void testCase() throws Exception {
execute("delete from pm1.g2 where e1 >= ?", new Object[] {new Integer(100)});
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java 2009-09-30 16:07:17 UTC (rev 1499)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java 2009-09-30 16:08:14 UTC (rev 1500)
@@ -5,7 +5,7 @@
package org.teiid.test.testcases;
import org.teiid.test.framework.ConfigPropertyNames;
-import org.teiid.test.framework.connection.ConnectionStrategy;
+import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
/**
@@ -34,13 +34,13 @@
//XATransactions currently doesn't support using sqlserver
//{@see TEIID-559}
- System.setProperty(ConfigPropertyNames.EXCLUDE_DATASBASE_TYPES_PROP, "sqlserver");
+ this.addProperty(ConfigPropertyNames.EXCLUDE_DATASBASE_TYPES_PROP, "sqlserver");
- System.setProperty(ConfigPropertyNames.CONFIG_FILE, "xa-config.properties");
+ this.addProperty(ConfigPropertyNames.CONFIG_FILE, "xa-config.properties");
- System.setProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION);
- System.setProperty(ConnectionStrategy.AUTOCOMMIT, "false");
- // System.setProperty(ConnectionStrategy.TXN_AUTO_WRAP, "on");
+ this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION);
+ this.addProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT, "false");
+ // this.addProperty(ConnectionStrategy.TXN_AUTO_WRAP, "on");
}
16 years, 2 months