teiid SVN: r2217 - in trunk: api/src/main/java/org/teiid/language/visitor and 81 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-10 17:59:07 -0400 (Thu, 10 Jun 2010)
New Revision: 2217
Added:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml
trunk/metadata/src/test/java/org/teiid/cdk/
trunk/metadata/src/test/java/org/teiid/cdk/api/
trunk/metadata/src/test/java/org/teiid/cdk/unittest/
trunk/metadata/src/test/java/org/teiid/core/
trunk/metadata/src/test/java/org/teiid/core/util/
trunk/metadata/src/test/java/org/teiid/internal/
trunk/metadata/src/test/java/org/teiid/internal/core/
trunk/metadata/src/test/java/org/teiid/internal/core/index/
trunk/runtime/src/test/java/org/teiid/dqp/
trunk/runtime/src/test/java/org/teiid/dqp/service/
trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/
trunk/test-integration/common/src/test/java/org/teiid/cdk/
trunk/test-integration/common/src/test/java/org/teiid/cdk/api/
Removed:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
trunk/common-core/src/test/java/com/
trunk/metadata/src/test/java/com/metamatrix/cdk/api/
trunk/metadata/src/test/java/com/metamatrix/cdk/unittest/
trunk/metadata/src/test/java/com/metamatrix/core/util/
trunk/metadata/src/test/java/com/metamatrix/internal/core/index/
trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/
trunk/test-integration/common/src/test/java/com/metamatrix/cdk/api/
Modified:
trunk/api/src/main/java/org/teiid/language/AggregateFunction.java
trunk/api/src/main/java/org/teiid/language/Comparison.java
trunk/api/src/main/java/org/teiid/language/SetQuery.java
trunk/api/src/main/java/org/teiid/language/visitor/DelegatingHierarchyVisitor.java
trunk/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java
trunk/api/src/test/java/org/teiid/logging/TestLogManager.java
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java
trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java
trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java
trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java
trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
trunk/common-core/src/main/java/org/teiid/core/util/Assertion.java
trunk/common-core/src/test/java/org/teiid/core/id/TestParsingObjectIDs.java
trunk/common-core/src/test/java/org/teiid/core/id/TestUUIDFactory.java
trunk/common-core/src/test/java/org/teiid/core/util/TestPropertiesUtils.java
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
trunk/connectors/sandbox/translator-yahoo/src/test/java/org/teiid/translator/yahoo/TestYahooTranslation.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/EscapeSyntaxModifier.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSearchDetails.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoobackAsynch.java
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
trunk/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java
trunk/engine/src/main/java/org/teiid/query/metadata/BasicQueryMetadata.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/DefaultCapabilitiesFinder.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/batch/BatchedUpdatePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/program/ProgramInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/Condition.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/ProcessorInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/BatchedUpdateResolver.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/ExistsCriteria.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryCompareCriteria.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/CommandStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/ScalarSubquery.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/CommandCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/ValueIteratorProviderCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/service/FakeBufferService.java
trunk/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java
trunk/metadata/src/main/java/org/teiid/internal/core/index/Util.java
trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
trunk/metadata/src/main/java/org/teiid/metadata/index/RuntimeMetadataPlugin.java
trunk/metadata/src/main/java/org/teiid/metadata/index/TransformationRecordImpl.java
trunk/metadata/src/test/java/org/teiid/cdk/api/ConnectorHost.java
trunk/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java
trunk/metadata/src/test/java/org/teiid/cdk/unittest/FakeTranslationFactory.java
trunk/metadata/src/test/java/org/teiid/core/util/TestCharOperation.java
trunk/metadata/src/test/java/org/teiid/internal/core/index/TestGammaCompressedIndexBlock.java
trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
trunk/test-integration/common/src/test/java/org/teiid/cdk/api/TestTranslationUtility.java
trunk/test-integration/common/src/test/java/org/teiid/connector/language/TestLanguageUtil.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestElement.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestGroup.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataObject.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestParams.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestProcedure.java
trunk/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
Log:
TEIID-1118 refining the web services calling procedure. cleaning java docs. fixing an issue with the exceptionholder, which wasn't catching exceptions during serialization. adding examples of calling webservices into the kit.
Modified: trunk/api/src/main/java/org/teiid/language/AggregateFunction.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/AggregateFunction.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/main/java/org/teiid/language/AggregateFunction.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -80,9 +80,6 @@
return this.expression;
}
- /**
- * @see org.teiid.language.LanguageObject#acceptVisitor(com.metamatrix.data.visitor.LanguageObjectVisitor)
- */
public void acceptVisitor(LanguageObjectVisitor visitor) {
visitor.visit(this);
}
Modified: trunk/api/src/main/java/org/teiid/language/Comparison.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/Comparison.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/main/java/org/teiid/language/Comparison.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -106,12 +106,8 @@
this.operator = operator;
}
- /**
- * @see org.teiid.language.LanguageObject#acceptVisitor(com.metamatrix.data.visitor.LanguageObjectVisitor)
- */
public void acceptVisitor(LanguageObjectVisitor visitor) {
visitor.visit(this);
}
-
}
Modified: trunk/api/src/main/java/org/teiid/language/SetQuery.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SetQuery.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/main/java/org/teiid/language/SetQuery.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -106,9 +106,6 @@
this.rightQuery = rightQuery;
}
- /**
- * @see org.teiid.language.LanguageObject#acceptVisitor(com.metamatrix.data.visitor.LanguageObjectVisitor)
- */
public void acceptVisitor(LanguageObjectVisitor visitor) {
visitor.visit(this);
}
Modified: trunk/api/src/main/java/org/teiid/language/visitor/DelegatingHierarchyVisitor.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/visitor/DelegatingHierarchyVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/main/java/org/teiid/language/visitor/DelegatingHierarchyVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -149,9 +149,7 @@
postVisitor.visit(obj);
}
}
- /*
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.IExistsCriteria)
- */
+
public void visit(Exists obj) {
if (preVisitor != null) {
preVisitor.visit(obj);
Modified: trunk/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -209,9 +209,6 @@
append(condition);
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.Delete)
- */
public void visit(Delete obj) {
buffer.append(DELETE)
.append(Tokens.SPACE);
@@ -247,9 +244,6 @@
return null;
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.ColumnReference)
- */
public void visit(ColumnReference obj) {
buffer.append(getElementName(obj, true));
}
@@ -308,9 +302,6 @@
return elementName;
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.IExecute)
- */
public void visit(Call obj) {
buffer.append(EXEC)
.append(Tokens.SPACE);
@@ -339,9 +330,6 @@
buffer.append(Tokens.RPAREN);
}
- /*
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.IExistsCriteria)
- */
public void visit(Exists obj) {
buffer.append(EXISTS)
.append(Tokens.SPACE)
@@ -354,9 +342,6 @@
return infixFunctions.contains(function);
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.Function)
- */
public void visit(Function obj) {
String name = obj.getName();
@@ -448,9 +433,6 @@
return true;
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.GroupBy)
- */
public void visit(GroupBy obj) {
buffer.append(GROUP)
.append(Tokens.SPACE)
@@ -459,9 +441,6 @@
append(obj.getElements());
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.In)
- */
public void visit(In obj) {
append(obj.getLeftExpression());
if (obj.isNegated()) {
@@ -488,9 +467,6 @@
buffer.append(obj.getCorrelationName());
}
- /**
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.language.Insert)
- */
public void visit(Insert obj) {
buffer.append(INSERT).append(Tokens.SPACE);
buffer.append(getSourceComment(obj));
Modified: trunk/api/src/test/java/org/teiid/logging/TestLogManager.java
===================================================================
--- trunk/api/src/test/java/org/teiid/logging/TestLogManager.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/api/src/test/java/org/teiid/logging/TestLogManager.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -111,9 +111,6 @@
public ListLogger() {
}
- /* (non-Javadoc)
- * @see com.metamatrix.core.log.LogListener#logMessage(org.eclipse.core.runtime.IStatus, long, java.lang.String, java.lang.String)
- */
public void log(int level, String context, Object msg){
this.messages.add(msg.toString());
}
@@ -122,9 +119,6 @@
this.messages.add(msg.toString());
}
- /* (non-Javadoc)
- * @see com.metamatrix.core.log.LogListener#shutdown()
- */
public void shutdown() {
messages.clear();
messages = null;
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-06-10 21:59:07 UTC (rev 2217)
@@ -1,7 +1,7 @@
Follow the same derby setup instructions as the portfolio example.
Copy the following files to the <jboss.home>/server/default/deploy directory.
- - portfolio-dynamic-vdb.xml
+ - portfolio-vdb.xml
- ../portfolio/marketdata-file-ds.xml
- ../portfolio/portfolio-ds.xml
Deleted: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-06-10 21:59:07 UTC (rev 2217)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<vdb name="DynamicPortfolio" version="1">
-
- <description>A Dynamic</description>
-
- <!--
- Setting to use connector supplied metadata. Can be "true" or "cached".
- "true" will obtain metadata once for every launch of Teiid.
- "cached" will save a file containing the metadata into
- the deploy/<vdb name>/<vdb version/META-INF directory
- -->
- <property name="UseConnectorMetadata" value="cached" />
-
-
- <!--
- Each model represents a access to one or more sources.
- The name of the model will be used as a top level schema name
- for all of the metadata imported from the connector.
-
- NOTE: Multiple model, with different import settings, can be bound to
- the same connector binding and will be treated as the same source at
- runtime.
- -->
- <model name="MarketData">
- <!--
- Each source represents a translator and data source. There are
- pre-defined translators, or you can create one. ConnectionFactories
- or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.
- -->
- <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
- </model>
-
- <model name="Accounts">
- <!--
- JDBC Import settings
-
- importer.useFullSchemaName directs the importer to drop the source
- schema from the Teiid object name, so that the Teiid fully qualified name
- will be in the form of <model name>.<table name>
- -->
- <property name="importer.useFullSchemaName" value="false"/>
-
- <!--
- This connector is defined in the "derby-connector-ds.xml"
- -->
- <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
- </model>
-
-</vdb>
\ No newline at end of file
Copied: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml (from rev 2216, trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml)
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml 2010-06-10 21:59:07 UTC (rev 2217)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vdb name="DynamicPortfolio" version="1">
+
+ <description>A Dynamic VDB</description>
+
+ <!--
+ Setting to use connector supplied metadata. Can be "true" or "cached".
+ "true" will obtain metadata once for every launch of Teiid.
+ "cached" will save a file containing the metadata into
+ the deploy/<vdb name>/<vdb version/META-INF directory
+ -->
+ <property name="UseConnectorMetadata" value="cached" />
+
+
+ <!--
+ Each model represents a access to one or more sources.
+ The name of the model will be used as a top level schema name
+ for all of the metadata imported from the connector.
+
+ NOTE: Multiple model, with different import settings, can be bound to
+ the same connector binding and will be treated as the same source at
+ runtime.
+ -->
+ <model name="MarketData">
+ <!--
+ Each source represents a translator and data source. There are
+ pre-defined translators, or you can create one. ConnectionFactories
+ or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.
+ -->
+ <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
+ </model>
+
+ <model name="Accounts">
+ <!--
+ JDBC Import settings
+
+ importer.useFullSchemaName directs the importer to drop the source
+ schema from the Teiid object name, so that the Teiid fully qualified name
+ will be in the form of <model name>.<table name>
+ -->
+ <property name="importer.useFullSchemaName" value="false"/>
+
+ <!--
+ This connector is defined in the "derby-connector-ds.xml"
+ -->
+ <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
+ </model>
+
+</vdb>
\ No newline at end of file
Added: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt 2010-06-10 21:59:07 UTC (rev 2217)
@@ -0,0 +1,40 @@
+Demonstrates how to use the WS Translator to call web services.
+See http://www.nws.noaa.gov/forecasts/xml/ for information on the National Weather
+Service's SOAP/REST services.
+
+Copy the following files to the <jboss.home>/server/default/deploy directory.
+ - weather-vdb.xml
+ - weather-ds.xml
+
+Start the JBoss Container
+
+Use the simple client example run script e.g.
+
+$./run.sh localhost 31000 weather "some query"
+
+Example queries:
+
+1. REST access of the default endpoint augmented by a query string. The query string is
+formed with the querystring function, which ensures proper encoding of the
+name/value pairs. The invoke procedure has a return parameter, called result that contains
+the XML value of the result document. This document is then fed into the XMLTABLE function
+to extract row values. Note that the default invocation binding has been set in the vdb xml
+to HTTP, which is the proper setting for REST.
+
+select t.* from
+ (call weather.invoke(action='GET',
+ endpoint=querystring('', '38.99,-77.02 39.70,-104.80 47.6,-122.30' as listLatLon, 'time-series' as product, '2004-01-01T00:00:00' as "begin", '2013-04-20T00:00:00' as "end", 'maxt' as maxt, 'mint' as mint)
+ )) w, XMLTABLE('/dwml/data/location' passing w.result columns "location-key" string, lattitude string path '/point/@latitude', longitude string path '/point/@longitude') t
+
+2. SOAP11 RPC call overriding all of the parameter values for the invoke procedure. With a SOAP
+invocation, the action is used to convey the SOAPAction header value if needed. Also note
+the use of the endpoint here with an absolute URL, which will be used instead of the default
+on the datasource.
+
+select xmlserialize(document w.result as string) from (call weather.invoke(action='http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonList...',
+ endpoint='http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php',
+ binding='SOAP11',
+ request='<ns1:LatLonListZipCode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"><zipCodeList xsi:type="ns2:zipCodeListType" xmlns:ns2="http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd">63303</zipCodeList></ns1:LatLonListZipCode>')) as w
+
+See the DatabaseMetadata on the invoke procedure for a full description of the parameters.
+
Property changes on: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml 2010-06-10 21:59:07 UTC (rev 2217)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connection-factories>
+
+ <no-tx-connection-factory>
+ <jndi-name>WeatherDS</jndi-name>
+ <rar-name>connector-ws-7.0.0-SNAPSHOT.rar</rar-name>
+ <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+
+ <config-property name="EndPoint">http://www.weather.gov/forecasts/xml/sample_products/browser_interface/nd...</config-property>
+
+ <max-pool-size>20</max-pool-size>
+
+ </no-tx-connection-factory>
+
+</connection-factories>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml 2010-06-10 21:59:07 UTC (rev 2217)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vdb name="weather" version="1">
+
+ <!--
+ See the dynamicvdb Portfolio example, or http://community.jboss.org/wiki/DynamicVDBinTeiid70
+ for more information on the format of a vdb.xml file.
+ -->
+
+ <description>Shows how to call Web Services</description>
+
+ <property name="UseConnectorMetadata" value="cached" />
+
+ <model name="Weather">
+ <source name="Weather" translator-name="MessageWeather" connection-jndi-name="java:WeatherDS"/>
+ </model>
+
+ <translator name="MessageWeather" type="ws">
+ <property name="DefaultBinding" value="HTTP"/>
+ </translator>
+
+</vdb>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt 2010-06-10 21:59:07 UTC (rev 2217)
@@ -1,3 +1,7 @@
+#
+# NOTE: due to changes affecting the text connector. This example is currently not functional.
+#
+
Install a recent version of Derby - see http://db.apache.org/derby/derby_downloads.html
Create the example dataset in Derby by running <derby home>/bin/ij customer-schema.sql
Modified: trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -164,13 +164,17 @@
return result;
}
- private byte[] writeAsByteArray(Throwable t) throws IOException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(t);
- oos.flush();
- oos.close();
- return baos.toByteArray();
+ private byte[] writeAsByteArray(Throwable t) {
+ try {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(t);
+ oos.flush();
+ oos.close();
+ return baos.toByteArray();
+ } catch (IOException e) {
+ return null;
+ }
}
private Throwable readFromByteArray(byte[] contents) throws IOException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -25,10 +25,13 @@
import org.teiid.client.RequestMessage;
/**
- * MetaMatrix-specific execution properties. These execution properties can
- * be set via the {@link com.metamatrix.jdbc.api.Statement#setExecutionProperty(String, String)}
+ * These execution properties can
+ * be set via the {@link TeiidStatement#setExecutionProperty(String, String)}
* method. They affect the subsequent execution of all commands on that Statement
- * instance.
+ * instance.
+ *
+ * They can also be set using a SET statement via JDBC and take effect for the
+ * duration of the session.
*/
public interface ExecutionProperties {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -220,12 +220,6 @@
return getObjectDirect(column);
}
- /**
- * Get fetch size that will be used if this result set is backed
- * by a cursor. This may be the hint fetch size provided by
- * {@link com.metamatrix.jdbc.ResultsImpl#getFetchSize} or it may
- * have been reset by the server.
- */
public int getFetchSize() throws SQLException {
return this.fetchSize;
}
Modified: trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java
===================================================================
--- trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -44,8 +44,7 @@
/**
- * An {@link ObjectInput} which is interoperable with {@link ObjectEncoder}
- * and {@link ObjectEncoderOutputStream}.
+ * An {@link ObjectInput} which is interoperable {@link ObjectEncoderOutputStream}.
*
* @author The Netty Project (netty-dev(a)lists.jboss.org)
* @author Trustin Lee (tlee(a)redhat.com)
Modified: trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -33,9 +33,6 @@
public class TestByteLobChunk extends TestCase {
- /*
- * Test method for 'com.metamatrix.common.lob.ByteLobChunk.getBytes()'
- */
public void testGetBytes() {
String testString = "This is test string for testing ByteLobChunk"; //$NON-NLS-1$
LobChunk chunk = new LobChunk(testString.getBytes(), false);
Modified: trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -1,5 +1,7 @@
package org.teiid.client.util;
+import static org.junit.Assert.*;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
@@ -9,17 +11,15 @@
import java.sql.SQLException;
import java.util.ArrayList;
-import junit.framework.TestCase;
-
import org.junit.Test;
-import org.teiid.client.util.ExceptionHolder;
+import org.teiid.core.TeiidException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.ReflectionHelper;
import org.teiid.core.util.UnitTestUtil;
-public class TestExceptionHolder extends TestCase {
+public class TestExceptionHolder {
//## JDBC4.0-begin ##
@SuppressWarnings("all")
@@ -95,7 +95,27 @@
Throwable e = holder.getException();
assertTrue(e instanceof TeiidRuntimeException);
assertEquals("Unknown Exception", e.getMessage()); //$NON-NLS-1$
- }
+ }
+
+ private static class NotSerializable {
+
+ }
+
+ @Test public void testDeserializationNotSerializable() throws Exception {
+ Exception ex = new TeiidException() {
+ NotSerializable ns = new NotSerializable();
+ };
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(new ExceptionHolder(ex));
+ oos.flush();
+
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
+ ExceptionHolder holder = (ExceptionHolder)ois.readObject();
+ Throwable e = holder.getException();
+ assertTrue(e instanceof TeiidException);
+ }
//## JDBC4.0-end ##
/*## JDBC3.0-JDK1.5-begin ##
Modified: trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -225,10 +225,6 @@
return MessageFormat.format(text, parameters);
}
- /**
- * @see com.metamatrix.core.PluginUtil#getStringOrKey(java.lang.String)
- * @since 4.1
- */
public String getStringOrKey(final String key) {
ArgCheck.isNotNull(key);
Modified: trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -34,7 +34,6 @@
//
/**
* The plug-in identifier of this plugin
- * (value <code>"com.metamatrix.core"</code>).
*/
public static final String PLUGIN_ID = CorePlugin.class.getPackage().getName();
Modified: trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -225,16 +225,10 @@
return ExceptionUtil.getLinkedMessages(this);
}
- /*
- * @see com.metamatrix.core.util.MetaMatrixNestedException#superPrintStackTrace(java.io.PrintStream)
- */
public void superPrintStackTrace(PrintStream output) {
super.printStackTrace(output);
}
- /*
- * @see com.metamatrix.core.util.MetaMatrixNestedException#superPrintStackTrace(java.io.PrintWriter)
- */
public void superPrintStackTrace(PrintWriter output) {
super.printStackTrace(output);
}
Modified: trunk/common-core/src/main/java/org/teiid/core/util/Assertion.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/Assertion.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/main/java/org/teiid/core/util/Assertion.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -45,7 +45,6 @@
* class should no longer be needed and all usage of assertions should be replaced with
* use of the built-in JDK assertion facility.
* </p>
- * @see com.metamatrix.common.util.ArgCheck
*/
public final class Assertion {
//============================================================================================================================
Modified: trunk/common-core/src/test/java/org/teiid/core/id/TestParsingObjectIDs.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/id/TestParsingObjectIDs.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/test/java/org/teiid/core/id/TestParsingObjectIDs.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -128,7 +128,7 @@
/**
* Ensure that the variant matches the expected variant.
* @param uuid the ObjectID
- * @param expectedVariant one of the {@link com.metamatrix.common.id.UUID.Variant UUID.Variant} constants.
+ * @param expectedVariant .
*/
public static void helpCheckVariant( UUID uuid, int expectedVariant ) {
//System.out.println("variant == UUID.Variant.STANDARD ? " + (UUID.getVariant(uuid)==UUID.Variant.STANDARD) );
Modified: trunk/common-core/src/test/java/org/teiid/core/id/TestUUIDFactory.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/id/TestUUIDFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/test/java/org/teiid/core/id/TestUUIDFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -116,7 +116,7 @@
/**
* Ensure that the variant matches the expected variant.
* @param uuid the ObjectID
- * @param expectedVariant one of the {@link com.metamatrix.common.id.UUID.Variant UUID.Variant} constants.
+ * @param expectedVariant
*/
public static void helpCheckVariant( ObjectID uuid, int expectedVariant ) {
if ( UUID.getVariant(uuid) != expectedVariant ) {
@@ -127,7 +127,7 @@
/**
* Ensure that the version matches the expected version.
* @param uuid the ObjectID
- * @param expectedVersion one of the {@link com.metamatrix.common.id.UUID.Version UUID.Version} constants.
+ * @param expectedVersion
*/
public static void helpCheckVersion( ObjectID uuid, int expectedVersion ) {
if ( UUID.getVersion(uuid) != expectedVersion ) {
Modified: trunk/common-core/src/test/java/org/teiid/core/util/TestPropertiesUtils.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/TestPropertiesUtils.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/common-core/src/test/java/org/teiid/core/util/TestPropertiesUtils.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -71,7 +71,7 @@
/**
- * Tests {@link com.metamatrix.common.utils.PropertiesUtils#print(String, Properties, String header)}
+ * Tests {@link org.teiid.core.util.utils.PropertiesUtils#print(String, Properties, String header)}
* and {@link org.teiid.core.util.utils.PropertiesUtils#load(String)}
* and {@link org.teiid.core.util.utils.PropertiesUtils#loadHeader(String)}
*/
Modified: trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -146,7 +146,6 @@
/**
* Closes LDAP context, effectively closing the connection to LDAP.
* (non-Javadoc)
- * @see com.metamatrix.connector.pool.PoolAwareConnection#closeSource()
*/
@Override
public void close() {
@@ -171,7 +170,6 @@
*
* One possible extension is to implement a UnsolicitedNotificationListener.
* (non-Javadoc)
- * @see com.metamatrix.connector.pool.PoolAwareConnection#isAlive()
*/
public boolean isAlive() {
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "LDAP Connection is alive."); //$NON-NLS-1$
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -55,17 +55,11 @@
return this.exception;
}
- /*
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.ICompareCriteria)
- */
public void visit(Comparison obj) {
Expression expr = obj.getRightExpression();
addTickerFromExpression(expr);
}
- /*
- * @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.IInCriteria)
- */
public void visit(In obj) {
List exprs = obj.getRightExpressions();
Iterator iter = exprs.iterator();
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -81,9 +81,6 @@
this.query = query;
}
- /*
- * @see com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
- */
@Override
public void execute() throws TranslatorException {
// Log our command
@@ -277,17 +274,11 @@
return output;
}
- /*
- * @see com.metamatrix.data.Execution#close()
- */
@Override
public void close() {
// nothing to do
}
- /*
- * @see com.metamatrix.data.Execution#cancel()
- */
@Override
public void cancel() throws TranslatorException {
Modified: trunk/connectors/sandbox/translator-yahoo/src/test/java/org/teiid/translator/yahoo/TestYahooTranslation.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/test/java/org/teiid/translator/yahoo/TestYahooTranslation.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/sandbox/translator-yahoo/src/test/java/org/teiid/translator/yahoo/TestYahooTranslation.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -22,13 +22,13 @@
package org.teiid.translator.yahoo;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.language.Command;
import org.teiid.language.Select;
import org.teiid.translator.yahoo.YahooExecution;
import junit.framework.TestCase;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
public class TestYahooTranslation extends TestCase {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/EscapeSyntaxModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/EscapeSyntaxModifier.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/EscapeSyntaxModifier.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -35,10 +35,6 @@
*/
public class EscapeSyntaxModifier extends FunctionModifier {
- /**
- * @see org.teiid.connector.jdbc.translator.BasicFunctionModifier#translate(org.teiid.language.Function)
- * @since 5.0
- */
public List<?> translate(Function function) {
List<Object> objs = new ArrayList<Object>();
objs.add("{fn "); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -121,9 +121,6 @@
return translatedCommand;
}
- /*
- * @see com.metamatrix.data.Execution#close()
- */
public synchronized void close() {
try {
if (statement != null) {
@@ -134,9 +131,6 @@
}
}
- /*
- * @see com.metamatrix.data.Execution#cancel()
- */
public synchronized void cancel() throws TranslatorException {
// if both the DBMS and driver support aborting an SQL
try {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -56,6 +56,7 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.SetQuery;
import org.teiid.language.Argument.Direction;
+import org.teiid.language.SetQuery.Operation;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
@@ -471,7 +472,7 @@
* Gets the database calendar. This will be set to the time zone
* specified by the property {@link JDBCPropertyNames#DATABASE_TIME_ZONE}, or
* the local time zone if none is specified.
- * @return
+ * @return the database calendar
*/
public Calendar getDatabaseCalendar() {
return CALENDAR.get();
@@ -482,7 +483,7 @@
* if to rely on the default translation. Override with care.
* @param command
* @param context
- * @return
+ * @return list of translated parts
*/
public List<?> translate(LanguageObject obj, ExecutionContext context) {
List<?> parts = null;
@@ -513,7 +514,7 @@
* if to rely on the default translation.
* @param command
* @param context
- * @return
+ * @return a list of translated parts
*/
public List<?> translateCommand(Command command, ExecutionContext context) {
return null;
@@ -524,7 +525,7 @@
* if to rely on the default translation.
* @param limit
* @param context
- * @return
+ * @return a list of translated parts
*/
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return null;
@@ -657,7 +658,7 @@
/**
* Set to true to indicate that every branch of a set query
* should have parenthesis, i.e. (query) union (query)
- * @return
+ * @return true if parenthesis should be used for each set branch
*/
public boolean useParensForSetQueries() {
return false;
@@ -666,26 +667,26 @@
/**
* Return false to indicate that time support should be emulated
* with timestamps.
- * @return
+ * @return true if database has a time type
*/
public boolean hasTimeType() {
return true;
}
/**
- * Returns the name for a given {@link SetQuery.Operation}
+ * Returns the name for a given {@link Operation}
* @param operation
- * @return
+ * @return the name for the set operation
*/
public String getSetOperationString(SetQuery.Operation operation) {
return operation.toString();
}
/**
- * Returns the source comment for
+ * Returns the source comment for the given command
* @param context
* @param command
- * @return
+ * @return the comment
*/
public String getSourceComment(ExecutionContext context, Command command) {
if (addSourceComment() && context != null) {
@@ -698,15 +699,15 @@
* Override to return a name other than the default [group.]element
* @param group
* @param element
- * @return
+ * @return thre replacement name
*/
public String replaceElementName(String group, String element) {
return null;
}
/**
- * Return the precision of timestamp literals. Defaults to 9
- * @return
+ * Return the precision of timestamp literals. Defaults to 9.
+ * @return digits of timestamp nano precision.
*/
public int getTimestampNanoPrecision() {
return 9;
@@ -814,7 +815,7 @@
* @param results
* @param columnIndex
* @param expectedType
- * @return
+ * @return the value
* @throws SQLException
*/
public Object retrieveValue(ResultSet results, int columnIndex, Class<?> expectedType) throws SQLException {
@@ -908,7 +909,7 @@
* @param results
* @param parameterIndex
* @param expectedType
- * @return
+ * @return the value
* @throws SQLException
*/
public Object retrieveValue(CallableStatement results, int parameterIndex, Class expectedType) throws SQLException{
@@ -1041,7 +1042,7 @@
* Create the {@link SQLConversionVisitor} that will perform translation. Typical custom
* JDBC connectors will not need to create custom conversion visitors, rather implementors
* should override existing {@link JDBCExecutionFactory} methods.
- * @return
+ * @return the {@link SQLConversionVisitor}
*/
public SQLConversionVisitor getSQLConversionVisitor() {
return new SQLConversionVisitor(this);
@@ -1050,22 +1051,22 @@
/**
* Set to true to indicate that every branch of a join
* should have parenthesis.
- * @return
+ * @return true if every branch of a join should use parenthesis
*/
public boolean useParensForJoins() {
return false;
}
/**
- * get the default null ordering
- * @return
+ * Returns the default null ordering
+ * @return the {@link NullOrder}
*/
public NullOrder getDefaultNullOrder() {
return NullOrder.LOW;
}
/**
- *
+ * Returns whether the database supports explicit join ordering.
* @return true if nulls high|low can be specified
*/
public boolean supportsExplicitNullOrdering() {
@@ -1073,7 +1074,7 @@
}
/**
- *
+ * Returns whether the limit clause is applied to the select clause.
* @return true if the limit clause is part of the select
*/
public boolean useSelectLimit() {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -72,10 +72,6 @@
}
}
- /**
- * @see com.metamatrix.data.api.BatchedUpdatesExecution#execute(org.teiid.language.Command[])
- * @since 4.2
- */
public int[] execute(BatchedUpdates batchedCommand) throws TranslatorException {
boolean succeeded = false;
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -105,29 +105,6 @@
* Returns a version of <code>function</code> suitable for executing at the
* data source.
* <p>
- * First, a default function name or the value specified during construction
- * of <code>MODFunctionModifier</code> is set on <code>function</code>.
- * <p>
- * If <code>function</code> represents <code>LOCATE(searchStr, sourceStr, startIndex)</code>
- * and <code>startIndex</code> is a literal value, it is translated for
- * consistency between the built-in system function
- * <code>LOCATE(searchStr, sourceStr, startIndex)</code> and the sources
- * implementation. This is done by calling {@link #getStartIndexExpression(Literal)}
- * and passing it the literal <code>startIndex</code> value.
- * <p>
- * If <code>function</code> represents <code>LOCATE(searchStr, sourceStr, startIndex)</code>
- * and <code>startIndex</code> is not a literal value, it is translated for
- * consistency between the built-in system function
- * <code>LOCATE(searchStr, sourceStr, startIndex)</code> and the sources
- * implementation. This is done by calling {@link #getStartIndexExpression(Expression)}
- * and passing it the non-literal <code>startIndex</code> value.
- * <p>
- * Finally, <code>function</code>'s parameters may be rearranged depending
- * on the value specified by {@link ParameterOrder} during construction of
- * <code>MODFunctionModifier</code>.
- * <p>
- * The translated <code>function</code> is then returned.
- * <p>
* For example:
* <ul>
* <code>locate('a', 'abcdefg') ---> LOCATE('a', 'abcdefg')</code><br />
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -105,7 +105,7 @@
/**
* Return List of values to set on a prepared statement, if
- * necessary (see {@link #getStatementType})
+ * necessary.
* @return List of values to be set on a prepared statement
*/
public List getPreparedValues() {
@@ -113,21 +113,16 @@
}
/**
- * Get String SQL of translated command; but use
- * {@link #nextLargeSetQuerySQL} if this command is
- * a {@link #isLargeSetQuery large set query}
- * @return SQL of translated command, or null if the
- * command is a {@link #isLargeSetQuery large set query}
+ * Get String SQL of translated command.
+ * @return SQL of translated command
*/
public String getSql() {
return sql;
}
/**
- * Return the statement type, one of {@link #STMT_TYPE_STATEMENT},
- * {@link #STMT_TYPE_PREPARED_STATEMENT}, or
- * {@link #STMT_TYPE_CALLABLE_STATEMENT}
- * @return statement type of translated command
+ * Returns whether the statement is prepared.
+ * @return true if the statement is prepared
*/
public boolean isPrepared() {
return prepared;
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -432,8 +432,6 @@
/**
* This is true only after Postgre version 7.1
* However, since version 7 was released in 2000 we'll assume a post 7 instance.
- *
- * @see org.teiid.translator.jdbc.JDBCCapabilities#supportsInlineViews()
*/
public boolean supportsInlineViews() {
return true;
@@ -448,17 +446,11 @@
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
@Override
public boolean supportsExcept() {
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
@Override
public boolean supportsIntersect() {
return true;
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -26,12 +26,12 @@
import junit.framework.Assert;
import org.mockito.Mockito;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.language.Command;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
-import com.metamatrix.cdk.api.TranslationUtility;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
public class FakeMetadataFactory {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -30,6 +30,8 @@
import junit.framework.Assert;
import org.mockito.Mockito;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.language.Command;
import org.teiid.query.function.metadata.FunctionMetadataReader;
@@ -37,8 +39,6 @@
import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
-import com.metamatrix.cdk.api.TranslationUtility;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
public class TranslationHelper {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -25,13 +25,13 @@
import junit.framework.TestCase;
import org.mockito.Mockito;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.language.Command;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
/**
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,6 +27,8 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Command;
import org.teiid.translator.TranslatorException;
@@ -34,8 +36,6 @@
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
-import com.metamatrix.cdk.api.TranslationUtility;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
/**
*/
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -29,6 +29,7 @@
import org.junit.Before;
import org.junit.Test;
import org.teiid.cdk.CommandBuilder;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.dqp.internal.datamgr.impl.ExecutionContextImpl;
@@ -48,7 +49,6 @@
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
-import com.metamatrix.cdk.api.TranslationUtility;
public class TestOracleTranslator {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -26,6 +26,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.types.DataTypeManager;
import org.teiid.language.Command;
import org.teiid.metadata.Column;
@@ -39,7 +40,6 @@
import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
*/
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -86,8 +86,6 @@
/**
* Constructor.
- * @param logger the connector logger
- * @param rm the RuntimeMetadata
*/
public IQueryToLdapSearchParser(LDAPExecutionFactory factory) {
this.executionFactory = factory;
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSearchDetails.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSearchDetails.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSearchDetails.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -148,7 +148,6 @@
/**
* Print Method for Logging - (Detail level logging)
- * @param logger the connector logger.
*/
public void printDetailsToLog() throws NamingException {
// Log Search Scope
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -120,7 +120,6 @@
* Constructor
* @param executionMode the execution mode.
* @param ctx the execution context.
- * @param rm the runtimeMetadata
* @param logger the ConnectorLogger
* @param ldapCtx the LDAP Context
*/
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -98,9 +98,6 @@
return null;
}
- /*
- * @see com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
- */
@Override
public void execute() throws TranslatorException {
@@ -143,17 +140,11 @@
return Arrays.asList(new Object[count]);
}
- /*
- * @see com.metamatrix.data.Execution#close()
- */
@Override
public void close() {
// nothing to do
}
- /*
- * @see com.metamatrix.data.Execution#cancel()
- */
@Override
public void cancel() throws TranslatorException {
Modified: trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoobackAsynch.java
===================================================================
--- trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoobackAsynch.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoobackAsynch.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -26,10 +26,10 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.ConnectorHost;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.translator.loopback.LoopbackExecutionFactory;
-import com.metamatrix.cdk.api.ConnectorHost;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
/**
Modified: trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
===================================================================
--- trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -28,13 +28,13 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.ConnectorHost;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.loopback.LoopbackExecution;
import org.teiid.translator.loopback.LoopbackExecutionFactory;
-import com.metamatrix.cdk.api.ConnectorHost;
-import com.metamatrix.cdk.api.TranslationUtility;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
public class TestLoopbackExecution extends TestCase {
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -23,14 +23,13 @@
package org.teiid.translator.salesforce;
import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.teiid.core.BundleUtil;
+
public class Messages {
- private static final String BUNDLE_NAME = "com.metamatrix.connector.salesforce.i18n"; //$NON-NLS-1$
+ private static final BundleUtil RESOURCE_BUNDLE = BundleUtil.getBundleUtil(Messages.class);
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
Modified: trunk/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
===================================================================
--- trunk/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,6 +27,7 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.types.DataTypeManager;
import org.teiid.language.Select;
import org.teiid.metadata.Column;
@@ -41,7 +42,6 @@
import org.teiid.translator.salesforce.execution.visitors.JoinQueryVisitor;
import org.teiid.translator.salesforce.execution.visitors.SelectVisitor;
-import com.metamatrix.cdk.api.TranslationUtility;
public class TestVisitors {
Modified: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -29,6 +29,8 @@
import javax.resource.cci.ConnectionFactory;
import javax.xml.transform.Source;
import javax.xml.ws.Service.Mode;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.SOAPBinding;
import org.teiid.core.BundleUtil;
import org.teiid.language.Call;
@@ -50,9 +52,26 @@
@Translator(name="ws")
public class WSExecutionFactory extends ExecutionFactory<ConnectionFactory, WSConnection> {
+ public enum Binding {
+ HTTP(HTTPBinding.HTTP_BINDING),
+ SOAP11(SOAPBinding.SOAP11HTTP_BINDING),
+ SOAP12(SOAPBinding.SOAP12HTTP_BINDING);
+
+ private String bindingId;
+
+ private Binding(String bindingId) {
+ this.bindingId = bindingId;
+ }
+
+ public String getBindingId() {
+ return bindingId;
+ }
+ }
+
public static BundleUtil UTIL = BundleUtil.getBundleUtil(WSExecutionFactory.class);
private Mode defaultServiceMode = Mode.PAYLOAD;
+ private Binding defaultBinding = Binding.SOAP12;
private String xmlParamName;
@TranslatorProperty(description="Contols request/response message wrapping - set to MESSAGE for full control over SOAP messages.", display="Default Service Mode")
@@ -63,7 +82,16 @@
public void setDefaultServiceMode(Mode mode) {
this.defaultServiceMode = mode;
}
+
+ @TranslatorProperty(description="Contols what SOAP or HTTP type of invocation will be used if none is specified.", display="Default Binding")
+ public Binding getDefaultBinding() {
+ return defaultBinding;
+ }
+ public void setDefaultBinding(Binding defaultInvocationType) {
+ this.defaultBinding = defaultInvocationType;
+ }
+
public String getXmlParamName() {
return xmlParamName;
}
@@ -92,18 +120,21 @@
WSConnection conn) throws TranslatorException {
Procedure p = metadataFactory.addProcedure("invoke"); //$NON-NLS-1$
- //can be one of HTTP, SOAP11, SOAP12
- ProcedureParameter param = metadataFactory.addProcedureParameter("style", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ ProcedureParameter param = metadataFactory.addProcedureParameter("binding", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setAnnotation("The invocation binding (HTTP, SOAP11, SOAP12). May be set or allowed to default to null to use the default binding.");
param.setNullType(NullType.Nullable);
param = metadataFactory.addProcedureParameter("action", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setAnnotation("With a SOAP invocation, action sets the SOAPAction. With HTTP it sets the HTTP Method (GET, POST, etc.).");
param.setNullType(NullType.Nullable);
//can be one of string, xml, clob
param = metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
+ param.setAnnotation("The String, XML, or CLOB value containing an XML document or fragment that represents the request (valid with SOAP or HTTP/POST invocations). If the ExecutionFactory is configured in with a DefaultServiceMode or MESSAGE then SOAP request must contain the entire SOAP message.");
param.setNullType(NullType.Nullable);
param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setAnnotation("The relative or abolute endpoint to use. May be set or allowed to default to null to use the default endpoint address.");
param.setNullType(NullType.Nullable);
metadataFactory.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.XML, Type.ReturnValue, p); //$NON-NLS-1$
Modified: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -40,8 +40,6 @@
import javax.xml.ws.Dispatch;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
import org.teiid.core.types.ClobType;
import org.teiid.language.Argument;
@@ -56,28 +54,13 @@
import org.teiid.translator.TranslatorException;
import org.teiid.translator.WSConnection;
import org.teiid.translator.WSConnection.Util;
+import org.teiid.translator.ws.WSExecutionFactory.Binding;
/**
* A soap call executor - handles all styles doc/literal, rpc/encoded etc.
*/
public class WSProcedureExecution implements ProcedureExecution {
- public enum InvocationType {
- HTTP(HTTPBinding.HTTP_BINDING),
- SOAP11(SOAPBinding.SOAP11HTTP_BINDING),
- SOAP12(SOAPBinding.SOAP12HTTP_BINDING);
-
- private String bindingId;
-
- private InvocationType(String bindingId) {
- this.bindingId = bindingId;
- }
-
- public String getBindingId() {
- return bindingId;
- }
- };
-
RuntimeMetadata metadata;
ExecutionContext context;
private Call procedure;
@@ -131,19 +114,19 @@
String endpoint = (String)arguments.get(3).getArgumentValue().getValue();
if (style == null) {
- style = InvocationType.SOAP12.getBindingId();
+ style = executionFactory.getDefaultBinding().getBindingId();
} else {
try {
- InvocationType type = InvocationType.valueOf(style.toUpperCase());
+ Binding type = Binding.valueOf(style.toUpperCase());
style = type.getBindingId();
} catch (IllegalArgumentException e) {
- throw new TranslatorException(WSExecutionFactory.UTIL.getString("invalid_invocation", Arrays.toString(InvocationType.values()))); //$NON-NLS-1$
+ throw new TranslatorException(WSExecutionFactory.UTIL.getString("invalid_invocation", Arrays.toString(Binding.values()))); //$NON-NLS-1$
}
}
Dispatch<Source> dispatch = conn.createDispatch(style, endpoint, Source.class, executionFactory.getDefaultServiceMode());
- if (InvocationType.HTTP.getBindingId().equals(style)) {
+ if (Binding.HTTP.getBindingId().equals(style)) {
if (action == null) {
action = "POST"; //$NON-NLS-1$
}
@@ -184,6 +167,8 @@
}
} catch (SQLException e) {
throw new TranslatorException(e);
+ } catch (WebServiceException e) {
+ throw new TranslatorException(e);
} finally {
Util.closeSource(source);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -45,9 +45,6 @@
this.chunkSize = chunkSize;
}
- /**
- * @see com.metamatrix.common.lob.ByteLobChunkProducer#getNextChunk(int)
- */
public LobChunk getNextChunk() throws IOException{
if (this.closed) {
@@ -75,9 +72,6 @@
return new LobChunk(cbuf, isLast);
}
- /**
- * @see com.metamatrix.common.lob.ByteLobChunkProducer#close()
- */
public void close() throws IOException {
this.closed = true;
this.stream.close();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -415,9 +415,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.dqp.internal.process.DataTierManager#clearCodeTables()
- */
public void clearCodeTables() {
this.codeTableCache.clearAll();
}
Modified: trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -141,9 +141,6 @@
// I N T E R F A C E M E T H O D S
//==================================================================================
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementID(java.lang.String)
- */
public Object getElementID(final String elementName) throws TeiidComponentException, QueryMetadataException {
int columnIndex = elementName.lastIndexOf(TransformationMetadata.DELIMITER_STRING);
if (columnIndex == -1) {
@@ -159,16 +156,10 @@
throw new QueryMetadataException(elementName+TransformationMetadata.NOT_EXISTS_MESSAGE);
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getGroupID(java.lang.String)
- */
public Object getGroupID(final String groupName) throws TeiidComponentException, QueryMetadataException {
return getMetadataStore().findGroup(groupName.toLowerCase());
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getGroupsForPartialName(java.lang.String)
- */
public Collection getGroupsForPartialName(final String partialGroupName)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isNotEmpty(partialGroupName);
@@ -196,9 +187,6 @@
return filteredResult;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getModelID(java.lang.Object)
- */
public Object getModelID(final Object groupOrElementID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(AbstractMetadataRecord.class, groupOrElementID);
AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) groupOrElementID;
@@ -216,18 +204,12 @@
throw createInvalidRecordTypeException(groupOrElementID);
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getFullName(java.lang.Object)
- */
public String getFullName(final Object metadataID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) metadataID;
return metadataRecord.getFullName();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getFullElementName(java.lang.String, java.lang.String)
- */
public String getFullElementName(final String fullGroupName, final String shortElementName)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isNotEmpty(fullGroupName);
@@ -236,9 +218,6 @@
return fullGroupName + DELIMITER_CHAR + shortElementName;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getShortElementName(java.lang.String)
- */
public String getShortElementName(final String fullElementName) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isNotEmpty(fullElementName);
int index = fullElementName.lastIndexOf(DELIMITER_CHAR);
@@ -270,17 +249,11 @@
return null;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInGroupID(java.lang.Object)
- */
public List getElementIDsInGroupID(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table)groupID).getColumns();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getGroupIDForElementID(java.lang.Object)
- */
public Object getGroupIDForElementID(final Object elementID) throws TeiidComponentException, QueryMetadataException {
if(elementID instanceof Column) {
Column columnRecord = (Column) elementID;
@@ -293,9 +266,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getStoredProcedureInfoForProcedure(java.lang.String)
- */
public StoredProcedureInfo getStoredProcedureInfoForProcedure(final String fullyQualifiedProcedureName)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isNotEmpty(fullyQualifiedProcedureName);
@@ -393,9 +363,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementType(java.lang.Object)
- */
public String getElementType(final Object elementID) throws TeiidComponentException, QueryMetadataException {
if(elementID instanceof Column) {
return ((Column) elementID).getRuntimeType();
@@ -406,9 +373,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getDefaultValue(java.lang.String)
- */
public Object getDefaultValue(final Object elementID) throws TeiidComponentException, QueryMetadataException {
if(elementID instanceof Column) {
return ((Column) elementID).getDefaultValue();
@@ -439,9 +403,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#isVirtualGroup(java.lang.Object)
- */
public boolean isVirtualGroup(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table) groupID).isVirtual();
@@ -467,9 +428,6 @@
return !modelRecord.isPhysical();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getVirtualPlan(java.lang.Object)
- */
public QueryNode getVirtualPlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -491,9 +449,6 @@
return queryNode;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getInsertPlan(java.lang.Object)
- */
public String getInsertPlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
@@ -503,9 +458,6 @@
return ((Table)groupID).getInsertPlan();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getUpdatePlan(java.lang.Object)
- */
public String getUpdatePlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
@@ -515,9 +467,6 @@
return ((Table)groupID).getUpdatePlan();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getDeletePlan(java.lang.Object)
- */
public String getDeletePlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
@@ -527,9 +476,6 @@
return ((Table)groupID).getDeletePlan();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#modelSupports(java.lang.Object, int)
- */
public boolean modelSupports(final Object modelID, final int modelConstant)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Schema.class, modelID);
@@ -540,9 +486,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#groupSupports(java.lang.Object, int)
- */
public boolean groupSupports(final Object groupID, final int groupConstant)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -556,9 +499,6 @@
}
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#elementSupports(java.lang.Object, int)
- */
public boolean elementSupports(final Object elementID, final int elementConstant)
throws TeiidComponentException, QueryMetadataException {
@@ -631,25 +571,16 @@
return new IllegalArgumentException(DQPPlugin.Util.getString("TransformationMetadata.Invalid_type", elementID.getClass().getName())); //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMaxSetSize(java.lang.Object)
- */
public int getMaxSetSize(final Object modelID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Schema.class, modelID);
return 0;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getIndexesInGroup(java.lang.Object)
- */
public Collection getIndexesInGroup(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table)groupID).getIndexes();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getUniqueKeysInGroup(java.lang.Object)
- */
public Collection getUniqueKeysInGroup(final Object groupID)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -666,18 +597,12 @@
return result;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getForeignKeysInGroup(java.lang.Object)
- */
public Collection getForeignKeysInGroup(final Object groupID)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table)groupID).getForeignKeys();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getPrimaryKeyIDForForeignKeyID(java.lang.Object)
- */
public Object getPrimaryKeyIDForForeignKeyID(final Object foreignKeyID)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(ForeignKey.class, foreignKeyID);
@@ -685,43 +610,28 @@
return fkRecord.getPrimaryKey();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getAccessPatternsInGroup(java.lang.Object)
- */
public Collection getAccessPatternsInGroup(final Object groupID)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table)groupID).getAccessPatterns();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInIndex(java.lang.Object)
- */
public List getElementIDsInIndex(final Object index) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(ColumnSet.class, index);
return ((ColumnSet)index).getColumns();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInKey(java.lang.Object)
- */
public List getElementIDsInKey(final Object key) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(ColumnSet.class, key);
return ((ColumnSet)key).getColumns();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInAccessPattern(java.lang.Object)
- */
public List getElementIDsInAccessPattern(final Object accessPattern)
throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(ColumnSet.class, accessPattern);
return ((ColumnSet)accessPattern).getColumns();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#isXMLGroup(java.lang.Object)
- */
public boolean isXMLGroup(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -768,9 +678,6 @@
return null;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMappingNode(java.lang.Object)
- */
public MappingNode getMappingNode(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -828,17 +735,11 @@
return Collections.EMPTY_SET;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getCardinality(java.lang.Object)
- */
public int getCardinality(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
return ((Table) groupID).getCardinality();
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getXMLSchemas(java.lang.Object)
- */
public List<SQLXMLImpl> getXMLSchemas(final Object groupID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(Table.class, groupID);
@@ -967,9 +868,6 @@
}
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getExtensionProperties(java.lang.Object)
- */
public Properties getExtensionProperties(final Object metadataID) throws TeiidComponentException, QueryMetadataException {
ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) metadataID;
Modified: trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -35,7 +35,7 @@
public class QueryPlugin { // extends Plugin {
/**
- * The plug-in identifier of this plugin (value <code>"com.metamatrix.common"</code>).
+ * The plug-in identifier of this plugin
*/
public static final String PLUGIN_ID = QueryPlugin.class.getPackage().getName();
Modified: trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -35,7 +35,6 @@
/**
* The plug-in identifier of this plugin
- * (value <code>"com.metamatrix.common"</code>).
*/
public static final String PLUGIN_ID = QueryExecPlugin.class.getPackage().getName();
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -36,7 +36,7 @@
/**
* This method requests that the source return all
- * {@link com.metamatrix.query.function.FunctionMethod}s
+ * {@link FunctionMethod}s
* the source knows about. This can occur in several situations -
* on initial registration with the FunctionLibraryManager, on a
* general reload, etc. This may be called multiple times and should
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/BasicQueryMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/BasicQueryMetadata.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/BasicQueryMetadata.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -152,16 +152,10 @@
return null;
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMaximumValue(java.lang.Object)
- */
public Object getMaximumValue(Object elementID) throws TeiidComponentException, QueryMetadataException {
return null;
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMinimumValue(java.lang.Object)
- */
public Object getMinimumValue(Object elementID) throws TeiidComponentException, QueryMetadataException {
return null;
}
@@ -420,30 +414,18 @@
return QueryMetadataInterface.UNKNOWN_CARDINALITY;
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getXMLSchemas(java.lang.Object)
- */
public List getXMLSchemas(Object groupID) throws TeiidComponentException, QueryMetadataException {
return null;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getNameInSource(java.lang.Object)
- */
public String getNameInSource(Object metadataID) throws TeiidComponentException, QueryMetadataException {
return null;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementLength(java.lang.Object)
- */
public int getElementLength(Object elementID) throws TeiidComponentException, QueryMetadataException {
return 0;
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getExtensionProperties(java.lang.Object)
- */
public Properties getExtensionProperties(Object metadataID)
throws TeiidComponentException, QueryMetadataException {
return null;
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -195,9 +195,6 @@
return this.actualMetadata.getDefaultValue(elementID);
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMaximumValue(java.lang.Object)
- */
public Object getMaximumValue(Object elementID) throws TeiidComponentException, QueryMetadataException {
if (elementID instanceof TempMetadataID) {
TempMetadataID id = (TempMetadataID)elementID;
@@ -209,9 +206,6 @@
return this.actualMetadata.getMaximumValue(elementID);
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMinimumValue(java.lang.Object)
- */
public Object getMinimumValue(Object elementID) throws TeiidComponentException, QueryMetadataException {
if (elementID instanceof TempMetadataID) {
TempMetadataID id = (TempMetadataID)elementID;
@@ -488,9 +482,6 @@
return this.actualMetadata.getCardinality(groupID);
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getXMLSchemas(java.lang.Object)
- */
public List getXMLSchemas(Object groupID) throws TeiidComponentException, QueryMetadataException {
if(groupID instanceof TempMetadataID) {
return Collections.EMPTY_LIST;
@@ -498,9 +489,6 @@
return this.actualMetadata.getXMLSchemas(groupID);
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getExtensionProperties(java.lang.Object)
- */
public Properties getExtensionProperties(Object metadataID)
throws TeiidComponentException, QueryMetadataException {
@@ -510,9 +498,6 @@
return actualMetadata.getExtensionProperties(metadataID);
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementLength(java.lang.Object)
- */
public int getElementLength(Object elementID) throws TeiidComponentException, QueryMetadataException {
if (elementID instanceof TempMetadataID) {
TempMetadataID id = (TempMetadataID)elementID;
@@ -592,9 +577,6 @@
return actualMetadata.getNativeType(elementID);
}
- /*
- * @see com.metamatrix.query.metadata.QueryMetadataInterface#isProcedureInputElement(java.lang.Object)
- */
public boolean isProcedure(Object elementID) throws TeiidComponentException, QueryMetadataException {
if(elementID instanceof TempMetadataID) {
Object oid = ((TempMetadataID) elementID).getOriginalMetadataID();
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/DefaultCapabilitiesFinder.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/DefaultCapabilitiesFinder.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/DefaultCapabilitiesFinder.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -40,9 +40,6 @@
this.capabilities = capabilities;
}
- /* (non-Javadoc)
- * @see com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder#findCapabilities(java.lang.Object)
- */
public SourceCapabilities findCapabilities(String modelName) throws TeiidComponentException {
return capabilities;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -124,9 +124,6 @@
private PlanHints hints = new PlanHints();
private Option option;
- /**
- * @see org.teiid.query.optimizer.CommandPlanner#optimize(com.metamatrix.query.optimizer.CommandTreeNode, java.util.Map, org.teiid.query.metadata.QueryMetadataInterface, boolean)
- */
public ProcessorPlan optimize(
Command command,
IDGenerator idGenerator,
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -54,9 +54,7 @@
public final class RuleAccessPatternValidation implements OptimizerRule {
/**
- * Verifies
* @throws QueryPlannerException if an access pattern has not been satisfied
- * @see com.metamatrix.query.optimizer.OptimizerRule#execute(PlanNode, QueryMetadataInterface, RuleStack)
*/
public PlanNode execute(
PlanNode plan,
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -55,7 +55,6 @@
* Verifies that a model with "supports where all" is being passed an atomic
* query with a criteria.
* @throws QueryPlannerException if property is not satisfied
- * @see com.metamatrix.query.optimizer.OptimizerRule#execute(PlanNode, QueryMetadataInterface, RuleStack)
*/
public PlanNode execute(
PlanNode plan,
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -57,7 +57,6 @@
* {@link ProcessorEnvironment#STRING_RESULT} or
* {@link ProcessorEnvironment#JDOM_DOCUMENT_RESULT} or
* This is to be used in conjunction with
- * {@link com.metamatrix.query.optimizer.CommandTreeNode CommandTreeNode}
* property methods.
*/
public static final Integer XML_FORM_RESULTS_PROPERTY = new Integer(0);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -154,9 +154,6 @@
return transactionalReads;
}
- /**
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
PlanNode props = new PlanNode(this.getClass().getSimpleName());
props.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(getOutputElements()));
Modified: trunk/engine/src/main/java/org/teiid/query/processor/batch/BatchedUpdatePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/batch/BatchedUpdatePlan.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/batch/BatchedUpdatePlan.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -201,10 +201,6 @@
commandIndex = 0;
}
- /**
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- * @since 4.2
- */
public PlanNode getDescriptionProperties() {
PlanNode props = super.getDescriptionProperties();
for (int i = 0; i < getPlanCount(); i++) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -90,9 +90,6 @@
return props;
}
- /**
- * @see org.teiid.query.processor.proc.RepeatedInstruction#testCondition(com.metamatrix.query.processor.proc.ProcedureEnvironment)
- */
public boolean testCondition(ProcedurePlan procEnv) throws TeiidComponentException, TeiidProcessingException {
if(!procEnv.resultSetExists(rsName)) {
procEnv.executePlan(plan, rsName);
@@ -108,9 +105,6 @@
return loopProgram;
}
- /**
- * @see org.teiid.query.processor.proc.RepeatedInstruction#postInstruction(com.metamatrix.query.processor.proc.ProcedureEnvironment)
- */
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
procEnv.removeResults(rsName);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -447,7 +447,6 @@
/**
* @throws TeiidComponentException
- * @see com.metamatrix.query.processor.program.ProgramEnvironment#pop()
*/
public void pop() throws TeiidComponentException {
Program program = this.programs.pop();
@@ -468,9 +467,6 @@
this.tempContext.removeLast();
}
- /**
- * @see com.metamatrix.query.processor.program.ProgramEnvironment#push(org.teiid.query.processor.program.Program)
- */
public void push(Program program) {
program.resetProgramCounter();
this.programs.push(program);
@@ -486,9 +482,6 @@
this.tempContext.add(new HashSet());
}
- /**
- * @see com.metamatrix.query.processor.program.ProgramEnvironment#incrementProgramCounter()
- */
public void incrementProgramCounter() throws TeiidComponentException {
Program program = peek();
ProgramInstruction instr = program.getCurrentInstruction();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -76,7 +76,6 @@
/**
* @throws TeiidProcessingException
- * @see org.teiid.query.processor.proc.RepeatedInstruction#testCondition(com.metamatrix.query.processor.proc.ProcedureEnvironment)
*/
public boolean testCondition(ProcedurePlan procEnv) throws TeiidComponentException, TeiidProcessingException {
return procEnv.evaluateCriteria(condition);
@@ -89,9 +88,6 @@
return whileProgram;
}
- /**
- * @see org.teiid.query.processor.proc.RepeatedInstruction#postInstruction(com.metamatrix.query.processor.proc.ProcedureEnvironment)
- */
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/program/ProgramInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/program/ProgramInstruction.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/program/ProgramInstruction.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -48,8 +48,7 @@
/**
* Allow this instruction to do whatever processing it needs, and to
- * in turn manipulate the running program, (via the ProcessorEnvironment
- * {@link ProgramEnvironment#getProgramStack getProgramStack} method.) A typical instruction should simply {@link
+ * in turn manipulate the running program. A typical instruction should simply {@link
* Program#incrementProgramCounter increment} the program counter of the current program, but specialized
* instructions may add sub programs to the stack or not increment the counter (so that they are executed again.)
*/
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -215,9 +215,6 @@
target.command = source.command;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
PlanNode props = super.getDescriptionProperties();
props.addProperty(PROP_SQL, this.command.toString());
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -441,9 +441,6 @@
return clonedNode;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
// Default implementation - should be overridden
PlanNode props = super.getDescriptionProperties();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -254,9 +254,6 @@
target.selectSymbols = this.selectSymbols;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
PlanNode props = super.getDescriptionProperties();
AnalysisRecord.addLanaguageObjects(props, PROP_SELECT_COLS, this.selectSymbols);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -131,9 +131,6 @@
return plan;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
return this.root.getDescriptionProperties();
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -150,9 +150,6 @@
target.projectionIndexes = source.projectionIndexes;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
PlanNode props = super.getDescriptionProperties();
AnalysisRecord.addLanaguageObjects(props, PROP_CRITERIA, Arrays.asList(this.criteria));
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/Condition.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/Condition.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/Condition.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -28,7 +28,6 @@
/**
* This is a condition which can be evaluated, and which supplies a
* Program instance which should act as the resulting sub Program to be run
- * (placed on the top of the {@link ProcessorEnvironment#getProgramStack program stack})
* if the condition evaluates to true.
*/
public abstract class Condition {
@@ -41,9 +40,7 @@
/**
* If this Condition {@link #evaluate evaluates} to true, this Program should
- * be retrieved and placed at the top of the
- * {@link ProcessorEnvironment#getProgramStack program stack}, to be run
- * immediately.
+ * be retrieved to be run immediately.
* @return Program sub Program to be run if this Condition evaluates to true
*/
public Program getThenProgram() {
@@ -63,7 +60,7 @@
* @param elementMap Map of elements to their index in the currentRowData
* @param currentRowData List of Objects representing the current row of
* the result set(s)
- * @param env ProcessorEnvironment of the XMLPlan, maintains state of the running
+ * @param env XMLProcessorEnvironment of the XMLPlan, maintains state of the running
* XML Processor Plan
*/
public abstract boolean evaluate(XMLProcessorEnvironment env, XMLContext ontext)
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/ProcessorInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/ProcessorInstruction.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/ProcessorInstruction.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -38,8 +38,7 @@
/**
* Allow this ProcessorInstruction to do whatever processing it needs, and to
- * in turn manipulate the running program, (via the ProcessorEnvironment
- * {@link ProcessorEnvironment#getProgramStack getProgramStack} method.)
+ * in turn manipulate the running program.
* A typical instruction should simply {@link Program#incrementProgramCounter increment}
* the program counter of the current program, but specialized instructions may add
* sub programs to the stack or not increment the counter (so that they are
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -458,9 +458,6 @@
return xmlPlan;
}
- /*
- * @see com.metamatrix.query.processor.Describable#getDescriptionProperties()
- */
public PlanNode getDescriptionProperties() {
PlanNode node = this.originalProgram.getDescriptionProperties();
node.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(getOutputElements()));
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -96,9 +96,6 @@
}
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getCurrentProgram()
- */
public Program getCurrentProgram() {
// jh case 5266
if ( this.programStack.size() > 0 ) {
@@ -124,9 +121,6 @@
return (programState.recursionCount > ProgramState.NOT_RECURSIVE);
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#incrementCurrentProgramCounter()
- */
public void incrementCurrentProgramCounter() {
ProgramState programState = this.programStack.getFirst();
programState.programCounter++;
@@ -142,9 +136,6 @@
}
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#pushProgram(Program)
- */
public void pushProgram(Program program) {
pushProgram(program, false);
}
@@ -168,9 +159,6 @@
this.programStack.addFirst(programState);
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getCurrentInstruction()
- */
public ProcessorInstruction getCurrentInstruction() {
ProgramState programState = this.programStack.getFirst();
@@ -189,9 +177,6 @@
return programState.program.getInstructionAt(programState.programCounter);
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getProgramRecursionCount(Program)
- */
public int getProgramRecursionCount(Program program){
ProgramState programState = getProgramState(program);
@@ -229,52 +214,30 @@
return new RelationalPlanExecutor(clone, this.commandContext, this.dataMgr, this.bufferMgr);
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getDocumentInProgress()
- */
public DocumentInProgress getDocumentInProgress() {
return this.documentInProgress;
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#setDocumentInProgress(DocumentInProgress)
- */
public void setDocumentInProgress(DocumentInProgress documentInProgress) {
this.documentInProgress = documentInProgress;
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getXMLFormat
- */
public String getXMLFormat() {
return this.xmlFormat;
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#setXMLFormat
- */
public void setXMLFormat(String xmlFormat) {
this.xmlFormat = xmlFormat;
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getDataManager()
- */
public ProcessorDataManager getDataManager() {
return this.dataMgr;
}
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#getProcessorContext()
- */
public CommandContext getProcessorContext() {
return this.commandContext;
}
-
- /**
- * @see com.metamatrix.query.processor.xml.ProcessorEnvironment#clone()
- */
public Object clone() {
XMLProcessorEnvironment clone = new XMLProcessorEnvironment();
copyIntoClone(clone);
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/BatchedUpdateResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/BatchedUpdateResolver.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/BatchedUpdateResolver.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -42,9 +42,6 @@
*/
public class BatchedUpdateResolver implements CommandResolver {
- /**
- * @see com.metamatrix.query.resolver.command.AbstractCommandResolver#resolveCommand(org.teiid.query.sql.lang.Command, boolean, org.teiid.query.analysis.AnalysisRecord, boolean)
- */
public void resolveCommand(Command command, TempMetadataAdapter metadata, AnalysisRecord analysis, boolean resolveNullLiterals)
throws QueryMetadataException, QueryResolverException, TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/ExistsCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/ExistsCriteria.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/ExistsCriteria.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -65,9 +65,6 @@
return null;
}
- /**
- * @see com.metamatrix.query.sql.lang.SubqueryCriteria#getCommand()
- */
public Command getCommand() {
return this.command;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryCompareCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryCompareCriteria.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryCompareCriteria.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -122,9 +122,6 @@
this.predicateQuantifier = predicateQuantifier;
}
- /**
- * @see com.metamatrix.query.sql.lang.SubqueryCriteria#getCommand()
- */
public Command getCommand() {
return this.command;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/CommandStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/CommandStatement.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/CommandStatement.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -62,10 +62,6 @@
return command;
}
- /**
- * Sets the command.
- * @see com.metamatrix.query.sql.lang.SubqueryLanguageObject#setCommand()
- */
public void setCommand(Command command){
this.command = command;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -72,7 +72,6 @@
/**
* Sets the command.
- * @see com.metamatrix.query.sql.lang.SubqueryLanguageObject#setCommand()
*/
public void setCommand(Command command){
this.query = command;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/ScalarSubquery.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/ScalarSubquery.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/ScalarSubquery.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -95,9 +95,6 @@
this.type = type;
}
- /**
- * @see com.metamatrix.query.sql.lang.SubqueryLanguageObject#getCommand()
- */
public Command getCommand() {
return this.command;
}
@@ -105,7 +102,6 @@
/**
* Sets the command. Also modifies the hash code of this object, so
* caution should be used in using this method.
- * @see com.metamatrix.query.sql.lang.SubqueryLanguageObject#setCommand()
*/
public void setCommand(Command command){
this.command = command;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/CommandCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/CommandCollectorVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/CommandCollectorVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -70,16 +70,10 @@
this.commands.add(obj.getCommand());
}
- /**
- * @see org.teiid.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.lang.ScalarSubquery)
- */
public void visit(ScalarSubquery obj) {
this.commands.add(obj.getCommand());
}
- /**
- * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.SubqueryCompareCriteria)
- */
public void visit(SubqueryCompareCriteria obj) {
this.commands.add(obj.getCommand());
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/ValueIteratorProviderCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/ValueIteratorProviderCollectorVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/ValueIteratorProviderCollectorVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -40,8 +40,7 @@
/**
* <p>This visitor class will traverse a language object tree and collect all language
- * objects that implement {@link com.metamatrix.sql.util.ValueIteratorProvider. These
- * all currently also implement {@link com.metamatrix.sql.lang.SubqueryContainer}.
+ * objects that implement {@link SubqueryContainer}.
* By default it uses a java.util.ArrayList to collect the objects in the order
* they're found.</p>
*
@@ -73,7 +72,7 @@
/**
* Get the value iterator providers collected by the visitor. This should best be called
* after the visitor has been run on the language object tree.
- * @return Collection of {@link com.metamatrix.sql.util.ValueIteratorProvider}
+ * @return Collection of {@link SubqueryContainer}
* (by default, this is a java.util.ArrayList)
*/
public List<SubqueryContainer> getValueIteratorProviders() {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -1257,6 +1257,9 @@
if (item.getPrefix().equals("xml") || item.getPrefix().equals("xmlns")) { //$NON-NLS-1$ //$NON-NLS-2$
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.xml_namespaces_reserved"), obj); //$NON-NLS-1$
}
+ if (item.getUri().length() == 0) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.xml_namespaces_null_uri"), obj); //$NON-NLS-1$
+ }
continue;
}
if (hasDefault) {
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-10 21:59:07 UTC (rev 2217)
@@ -895,6 +895,7 @@
ValidationVisitor.text_table_newline=Text table DELIMITER, QUOTE, and ESCAPE characters cannot be the new line character.
ValidationVisitor.xml_namespaces=At most only one NO DEFAULT or DEFAULT namespace may be specified.
ValidationVisitor.xml_namespaces_reserved=The namespaces xmlns and xml are reserved.
+ValidationVisitor.xml_namespaces_null_uri=The null uri, or empty string, is not allowed as the uri value.
ValidationVisitor.xml_attributes_reserved=The namespace xmlns is reserved.
ValidationVisitor.xml_invalid_qname=The qname "{0}" is invalid.
ValidationVisitor.context_item_type=XMLTABLE or XMLQUERY PASSING context item must be an XML value.
Modified: trunk/engine/src/test/java/org/teiid/dqp/service/FakeBufferService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/FakeBufferService.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/FakeBufferService.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -29,25 +29,16 @@
import org.teiid.dqp.internal.cache.DQPContextCache;
import org.teiid.dqp.service.BufferService;
-
-/**
- */
public class FakeBufferService implements BufferService {
private BufferManager bufferMgr;
- /**
- *
- */
public FakeBufferService() {
super();
bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
}
- /*
- * @see com.metamatrix.dqp.service.BufferService#getBufferManager()
- */
public BufferManager getBufferManager() {
return bufferMgr;
}
Modified: trunk/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -21,6 +21,7 @@
import org.teiid.core.index.IEntryResult;
import org.teiid.core.index.IQueryResult;
import org.teiid.core.util.LRUCache;
+import org.teiid.metadata.index.RuntimeMetadataPlugin;
/**
@@ -218,7 +219,7 @@
raf= vraf.getSafeRandomAccessFile();
String sig= raf.readUTF();
if (!sig.equals(IIndexConstants.SIGNATURE))
- throw new IOException(Util.bind("exception.wrongFormat")); //$NON-NLS-1$
+ throw new IOException(RuntimeMetadataPlugin.Util.getString("exception.wrongFormat")); //$NON-NLS-1$
int summaryBlockNum= raf.readInt();
raf.seek(summaryBlockNum * (long) IIndexConstants.BLOCK_SIZE);
summary= new IndexSummary();
Modified: trunk/metadata/src/main/java/org/teiid/internal/core/index/Util.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/internal/core/index/Util.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/metadata/src/main/java/org/teiid/internal/core/index/Util.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -11,43 +11,12 @@
*******************************************************************************/
package org.teiid.internal.core.index;
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
public class Util {
private Util() {
}
- /* Bundle containing messages */
- protected static ResourceBundle bundle;
- private final static String bundleName = "com.metamatrix.core.index.i18n"; //$NON-NLS-1$
-
- /**
- * Lookup the message with the given ID in this catalog
- */
- public static String bind(String id) {
- return bind(id, (String[]) null);
- }
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string values.
- */
- public static String bind(String id, String[] arguments) {
- if (id == null)
- return "No message available"; //$NON-NLS-1$
- String message = null;
- try {
- message = bundle.getString(id);
- } catch (MissingResourceException e) {
- // If we got an exception looking for the message, fail gracefully by just returning
- // the id we were looking for. In most cases this is semi-informative so is not too bad.
- return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(message, (Object[])arguments);
- }
-
/**
* Compares two strings lexicographically.
* The comparison is based on the Unicode value of each character in
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -63,25 +63,22 @@
/**
* The version number that is associated with the change made to change the list
- * delimiter from {@link com.metamatrix.modeler.core.index.IndexConstants.LIST_DELIMITER_OLD}
- * to {@link com.metamatrix.modeler.core.index.IndexConstants.LIST_DELIMITER} and also the
- * property delimiter was changed from {@link com.metamatrix.modeler.core.index.IndexConstants.PROP_DELIMITER_OLD}
- * to {@link com.metamatrix.modeler.core.index.IndexConstants.PROP_DELIMITER}. Added 07/22/2004.
- * @release 4.1.1
+ * delimiter. Added 07/22/2004.
+ * @since 4.1.1
*/
public static final int DELIMITER_INDEX_VERSION = 1;
/**
* The version number that is associated with the change made to add materialization
* property on tables. Added 08/18/2004.
- * @release 4.2
+ * @since 4.2
*/
public static final int TABLE_MATERIALIZATION_INDEX_VERSION = 2;
/**
* The version number that is associated with the change made to add native type
* property on columns. Added 08/24/2004.
- * @release 4.2
+ * @since 4.2
*/
public static final int COLUMN_NATIVE_TYPE_INDEX_VERSION = 3;
@@ -90,7 +87,7 @@
* flag on columns. The flag is used to indicate if an element for a virtual table
* represents an input parameter. This change was made to support the Procedural-Relational
* Mapping project. Added 09/29/2004.
- * @release 4.2
+ * @since 4.2
*/
public static final int COLUMN_INPUT_PARAMETER_FLAG_INDEX_VERSION = 4;
@@ -98,7 +95,7 @@
* The version number that is associated with the change made to remove property value
* pairs from the annotation records any properties on annotations would now be indexed
* as part of the properties index. Added 12/14/2004.
- * @release 4.2
+ * @since 4.2
*/
public static final int ANNOTATION_TAGS_INDEX_VERSION = 5;
@@ -106,28 +103,28 @@
* The version number that is associated with the change made to add uuid for the
* transformation mapping root on the transformation records, uuids would now be indexed
* as part of the transformation index. Added 1/13/2005.
- * @release 4.2
+ * @since 4.2
*/
public static final int TRANSFORMATION_UUID_INDEX_VERSION = 6;
/**
* The version number that is associated with the change made to add count of null and
* distinct values for columns on the column records 7/8/2005.
- * @release 4.2
+ * @since 4.2
*/
public static final int COLUMN_NULL_DISTINCT_INDEX_VERSION = 7;
/**
* The version number that is associated with the change made to add
* primitive type ID on datatype records 02/28/2006.
- * @release 5.0
+ * @since 5.0
*/
public static final int PRIMITIVE_TYPE_ID_INDEX_VERSION = 8;
/**
* The version number that is associated with the change made to add
* an update count to physical stored and XQuery procedures 04/29/2008.
- * @release 5.0
+ * @since 5.0
*/
public static final int PROCEDURE_UPDATE_COUNT_VERSION = 9;
@@ -139,9 +136,8 @@
private int version = NONVERSIONED_RECORD_INDEX_VERSION;
/**
- * Return a collection of {@link com.metamatrix.modeler.core.metadata.runtime.MetadataRecord}
+ * Return a collection of {@link AbstractMetadataRecord}
* instances for the result obtained from executing <code>queryEntriesMatching</code>
- * method on the {@link com.metamatrix.internal.core.index.impl.Index}
* @param queryResult
* @param container Container reference to be set on the record
*/
@@ -157,7 +153,7 @@
}
/**
- * Return the {@link com.metamatrix.modeler.core.metadata.runtime.MetadataRecord}
+ * Return the {@link AbstractMetadataRecord}
* instances for specified IEntryResult.
* @param entryResult
*/
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/RuntimeMetadataPlugin.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/RuntimeMetadataPlugin.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/RuntimeMetadataPlugin.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -36,7 +36,6 @@
/**
* The plug-in identifier of this plugin
- * (value <code>"com.metamatrix.metadata.runtime"</code>).
*/
public static final String PLUGIN_ID = "org.teiid.metadata"; //$NON-NLS-1$
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/TransformationRecordImpl.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/TransformationRecordImpl.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/TransformationRecordImpl.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -46,37 +46,22 @@
private List schemaPaths;
private String resourcePath;
- /**
- * @see com.metamatrix.modeler.core.metadata.runtime.TransformationRecord#getTransformation()
- */
public String getTransformation() {
return transformation;
}
- /*
- * @see com.metamatrix.modeler.core.metadata.runtime.TransformationRecord#getBindings()
- */
public List getBindings() {
return this.bindings;
}
- /*
- * @see com.metamatrix.modeler.core.metadata.runtime.TransformationRecord#getSchemaPaths()
- */
public List getSchemaPaths() {
return schemaPaths;
}
- /*
- * @see com.metamatrix.modeler.core.metadata.runtime.TransformationRecord#getTransformationType()
- */
public String getTransformationType() {
return transformationType;
}
- /**
- * @see com.metamatrix.modeler.core.metadata.runtime.TransformationRecord#getType()
- */
public String getType() {
return this.transformationType;
}
Copied: trunk/metadata/src/test/java/org/teiid/cdk/api (from rev 2211, trunk/metadata/src/test/java/com/metamatrix/cdk/api)
Modified: trunk/metadata/src/test/java/org/teiid/cdk/api/ConnectorHost.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/metadata/src/test/java/org/teiid/cdk/api/ConnectorHost.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package com.metamatrix.cdk.api;
+package org.teiid.cdk.api;
import java.util.ArrayList;
import java.util.Arrays;
Modified: trunk/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/cdk/api/TranslationUtility.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package com.metamatrix.cdk.api;
+package org.teiid.cdk.api;
import java.io.IOException;
import java.net.URL;
Copied: trunk/metadata/src/test/java/org/teiid/cdk/unittest (from rev 2211, trunk/metadata/src/test/java/com/metamatrix/cdk/unittest)
Modified: trunk/metadata/src/test/java/org/teiid/cdk/unittest/FakeTranslationFactory.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/metadata/src/test/java/org/teiid/cdk/unittest/FakeTranslationFactory.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,11 +20,11 @@
* 02110-1301 USA.
*/
-package com.metamatrix.cdk.unittest;
+package org.teiid.cdk.unittest;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.query.unittest.FakeMetadataFactory;
-import com.metamatrix.cdk.api.TranslationUtility;
public class FakeTranslationFactory {
Copied: trunk/metadata/src/test/java/org/teiid/core/util (from rev 2211, trunk/metadata/src/test/java/com/metamatrix/core/util)
Modified: trunk/metadata/src/test/java/org/teiid/core/util/TestCharOperation.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/core/util/TestCharOperation.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/metadata/src/test/java/org/teiid/core/util/TestCharOperation.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package com.metamatrix.core.util;
+package org.teiid.core.util;
import org.teiid.internal.core.index.CharOperation;
Copied: trunk/metadata/src/test/java/org/teiid/internal/core/index (from rev 2211, trunk/metadata/src/test/java/com/metamatrix/internal/core/index)
Modified: trunk/metadata/src/test/java/org/teiid/internal/core/index/TestGammaCompressedIndexBlock.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/internal/core/index/TestGammaCompressedIndexBlock.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/metadata/src/test/java/org/teiid/internal/core/index/TestGammaCompressedIndexBlock.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package com.metamatrix.internal.core.index;
+package org.teiid.internal.core.index;
import junit.framework.TestCase;
Copied: trunk/runtime/src/test/java/org/teiid/dqp/service/buffer (from rev 2211, trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer)
Modified: trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package com.metamatrix.dqp.service.buffer;
+package org.teiid.dqp.service.buffer;
import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.common.buffer.impl.FileStorageManager;
Copied: trunk/test-integration/common/src/test/java/org/teiid/cdk/api (from rev 2211, trunk/test-integration/common/src/test/java/com/metamatrix/cdk/api)
Modified: trunk/test-integration/common/src/test/java/org/teiid/cdk/api/TestTranslationUtility.java
===================================================================
--- trunk/test-integration/common/src/test/java/com/metamatrix/cdk/api/TestTranslationUtility.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/test-integration/common/src/test/java/org/teiid/cdk/api/TestTranslationUtility.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -20,10 +20,11 @@
* 02110-1301 USA.
*/
-package com.metamatrix.cdk.api;
+package org.teiid.cdk.api;
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Command;
import org.teiid.language.NamedTable;
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/language/TestLanguageUtil.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/language/TestLanguageUtil.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/language/TestLanguageUtil.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Set;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.language.Condition;
import org.teiid.language.LanguageFactory;
import org.teiid.language.LanguageUtil;
@@ -35,8 +37,6 @@
import junit.framework.TestCase;
-import com.metamatrix.cdk.api.TranslationUtility;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
/**
*/
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestElement.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestElement.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestElement.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,6 +27,7 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.ColumnReference;
import org.teiid.language.DerivedColumn;
@@ -35,7 +36,6 @@
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
*/
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestGroup.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestGroup.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestGroup.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,12 +27,12 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.NamedTable;
import org.teiid.language.Select;
import org.teiid.metadata.Table;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
*/
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataObject.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataObject.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataObject.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -26,6 +26,7 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Call;
import org.teiid.language.ColumnReference;
@@ -37,7 +38,6 @@
import org.teiid.metadata.ProcedureParameter;
import org.teiid.metadata.Table;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
*/
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestParams.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestParams.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestParams.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,6 +27,7 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Argument;
import org.teiid.language.Call;
@@ -34,7 +35,6 @@
import org.teiid.metadata.ProcedureParameter;
import org.teiid.metadata.BaseColumn.NullType;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestProcedure.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestProcedure.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/TestProcedure.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -27,13 +27,13 @@
import junit.framework.TestCase;
+import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Call;
import org.teiid.metadata.Column;
import org.teiid.metadata.Procedure;
import org.teiid.metadata.ProcedureParameter;
-import com.metamatrix.cdk.api.TranslationUtility;
/**
*/
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2010-06-10 17:04:23 UTC (rev 2216)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2010-06-10 21:59:07 UTC (rev 2217)
@@ -31,6 +31,7 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
import org.teiid.dqp.internal.datamgr.language.TestAggregateImpl;
import org.teiid.dqp.internal.datamgr.language.TestCompareCriteriaImpl;
import org.teiid.dqp.internal.datamgr.language.TestDeleteImpl;
@@ -72,7 +73,6 @@
import org.teiid.query.sql.lang.CompareCriteria;
import org.teiid.query.sql.lang.JoinType;
-import com.metamatrix.cdk.unittest.FakeTranslationFactory;
public class TestSQLStringVisitor {
14 years, 6 months
teiid SVN: r2216 - in trunk/test-integration/db/src/main: resources and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-06-10 13:04:23 -0400 (Thu, 10 Jun 2010)
New Revision: 2216
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java
trunk/test-integration/db/src/main/resources/default-config.properties
Log:
TEIID-889 - cleanup
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2010-06-10 16:52:36 UTC (rev 2215)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2010-06-10 17:04:23 UTC (rev 2216)
@@ -90,7 +90,7 @@
}
// the DO_NO_USE_DEFAULT will be passed in when the test are run from maven and no property is passed in for UseDataSources
- private static final String DO_NOT_USE_DEFAULT="${usedatasources}";
+ private static final String DO_NOT_USE_DEFAULT="${" + ConfigPropertyNames.USE_DATASOURCES_PROP + "}";
private Properties configprops;
Modified: trunk/test-integration/db/src/main/resources/default-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/default-config.properties 2010-06-10 16:52:36 UTC (rev 2215)
+++ trunk/test-integration/db/src/main/resources/default-config.properties 2010-06-10 17:04:23 UTC (rev 2216)
@@ -17,14 +17,10 @@
driver=org.teiid.jdbc.TeiidDriver
URL=jdbc:metamatrix:Transaction@mm://127.0.0.1:31000
-#;user=admin;password=admin
-
-
User=admin
Password=teiid
DatabaseName=Transaction
ServerName=localhost
-#ServerName=target/classes/transactions/transaction.properties
PortNumber=31000
application-name=txn-test
14 years, 6 months
teiid SVN: r2215 - trunk/test-integration/db/src/main/resources/transactions.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-06-10 12:52:36 -0400 (Thu, 10 Jun 2010)
New Revision: 2215
Added:
trunk/test-integration/db/src/main/resources/transactions/Transaction_derby_mysql.vdb
trunk/test-integration/db/src/main/resources/transactions/Transaction_oracle_mysql.vdb
Removed:
trunk/test-integration/db/src/main/resources/transactions/Transaction.vdb
Log:
TEIID-889 - updated the transaction vdb and added a new vdb. Now the vdb's indicate which db types they are configured with (i.e., derby and mysql, oracle and mysql)
Deleted: trunk/test-integration/db/src/main/resources/transactions/Transaction.vdb
===================================================================
(Binary files differ)
Added: trunk/test-integration/db/src/main/resources/transactions/Transaction_derby_mysql.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/test-integration/db/src/main/resources/transactions/Transaction_derby_mysql.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-integration/db/src/main/resources/transactions/Transaction_oracle_mysql.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/test-integration/db/src/main/resources/transactions/Transaction_oracle_mysql.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 6 months
teiid SVN: r2214 - in trunk/test-integration/db: src/assembly and 13 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-06-10 12:23:19 -0400 (Thu, 10 Jun 2010)
New Revision: 2214
Added:
trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh
Modified:
trunk/test-integration/db/howto
trunk/test-integration/db/pom.xml
trunk/test-integration/db/src/assembly/binaries.xml
trunk/test-integration/db/src/main/java/org/teiid/test/client/QueryScenario.java
trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryReader.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSource.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java
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/transaction/StandaloneGlobalTransaction.java
trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java
trunk/test-integration/db/src/main/resources/default-config.properties
trunk/test-integration/db/src/main/resources/xa-config.properties
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
trunk/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.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/CommonTransactionTests.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.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
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/StandaloneGlobalTransactionTests.java
Log:
TEIID-889 - the testcases didn't work because the framework and tests have not updated due to the removal of the embedded option, as well as, the changes to the VDB, connector related files, etc. Therefore, the following changes are made to handle these changes and work with an existing running server.
Modified: trunk/test-integration/db/howto
===================================================================
--- trunk/test-integration/db/howto 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/howto 2010-06-10 16:23:19 UTC (rev 2214)
@@ -10,9 +10,9 @@
==========================================
- Unit test should be created under db/src/test/java
-- See LocalTransactionDriverFalseOffTest.java as an example
+- See LocalTransactionTest.java as an example
-- Test should extend org.teiid.transaction.test.BaseAbstractTransactionTestCase
+- Test should extend org.teiid.test.testcases.BaseAbstractTransactionTestCase
- NOTE: the following is used in a post test phase of validating the data in the datasource
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/pom.xml 2010-06-10 16:23:19 UTC (rev 2214)
@@ -35,6 +35,11 @@
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ </dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -43,6 +48,11 @@
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
@@ -137,54 +147,77 @@
<version>1.0</version>
</dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresql.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.connector.version}</version>
+ </dependency>
+
</dependencies>
- <build>
- <plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/binaries.xml</descriptor>
- </descriptors>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
+ <build>
+ <plugins>
+ <!-- Specify the compiler options and settings -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
- <profiles>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/binaries.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+
<profile>
<id>runalltests</id>
<build>
@@ -252,7 +285,11 @@
<profile>
<id>runsingletest</id>
-
+ <activation>
+ <property>
+ <name>classname</name>
+ </property>
+ </activation>
<build>
<plugins>
@@ -263,7 +300,7 @@
<additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
- </additionalClasspathElements>
+ </additionalClasspathElements>
<systemProperties>
<property>
<name>usedatasources</name>
Modified: trunk/test-integration/db/src/assembly/binaries.xml
===================================================================
--- trunk/test-integration/db/src/assembly/binaries.xml 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/assembly/binaries.xml 2010-06-10 16:23:19 UTC (rev 2214)
@@ -80,10 +80,12 @@
<fileSet>
-
+ <directory>src/main/resources/ctc_tests</directory>
+ <outputDirectory>.</outputDirectory>
<includes>
<include>runclienttest.sh</include>
</includes>
+
<fileMode>755</fileMode>
</fileSet>
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/QueryScenario.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/QueryScenario.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/QueryScenario.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -93,50 +93,50 @@
validateResultsMode(this.props);
// TODO: deployprops.loc not needed in remote testing
- try {
- setupVDBs(this.getProperties());
- } catch (IOException e) {
- throw new TransactionRuntimeException(e.getMessage());
- }
+// try {
+// setupVDBs(this.getProperties());
+// } catch (IOException e) {
+// throw new TransactionRuntimeException(e.getMessage());
+// }
}
- protected void setupVDBs(Properties props) throws IOException {
+ // protected void setupVDBs(Properties props) throws IOException {
// NOTE: this is probably a hack, because the only way I could get all
// the vdb's available when running multiple scenarions
// was to update the deploy.properties by setting the vdb.definition
// property containing the location of
// all the vdbs
-
- // if disabled, no configuration of the vdb is needed
- if (ConfigPropertyLoader.getInstance().isDataStoreDisabled()) {
- return;
- }
-
- String deployPropLoc = props.getProperty("deployprops.loc");
- Properties deployProperties = PropertiesUtils.load(deployPropLoc);
+//
+// // if disabled, no configuration of the vdb is needed
+// if (ConfigPropertyLoader.getInstance().isDataStoreDisabled()) {
+// return;
+// }
+//
+// String deployPropLoc = props.getProperty("deployprops.loc");
+// Properties deployProperties = PropertiesUtils.load(deployPropLoc);
+//
+// // set the vdb.definition property that contains all the vdbs
+// String vdb_loc = props.getProperty("vdb.loc");
+// File vdbfiles[] = FileUtils.findAllFilesInDirectoryHavingExtension(vdb_loc, ".vdb");
+// if (vdbfiles == null || vdbfiles.length == 0) {
+// throw new TransactionRuntimeException((new StringBuilder()).append(
+// "No vdbs found in directory ").append(vdb_loc).toString());
+// }
+// StringBuffer vdbdef = new StringBuffer();
+//
+// for (int i = 0; i < vdbfiles.length; i++) {
+// vdbdef.append(vdbfiles[i].getAbsolutePath() + ";");
+// }
+// TestLogger.log("===== Connect to VDBs: " + vdbdef.toString());
+//
+// deployProperties.setProperty("vdb.definition", vdbdef.toString());
+// PropertiesUtils.print(deployPropLoc, deployProperties,"Updated for vdb.definition");
- // set the vdb.definition property that contains all the vdbs
- String vdb_loc = props.getProperty("vdb.loc");
- File vdbfiles[] = FileUtils.findAllFilesInDirectoryHavingExtension(vdb_loc, ".vdb");
- if (vdbfiles == null || vdbfiles.length == 0) {
- throw new TransactionRuntimeException((new StringBuilder()).append(
- "No vdbs found in directory ").append(vdb_loc).toString());
- }
- StringBuffer vdbdef = new StringBuffer();
+ // }
- for (int i = 0; i < vdbfiles.length; i++) {
- vdbdef.append(vdbfiles[i].getAbsolutePath() + ";");
- }
- TestLogger.log("===== Connect to VDBs: " + vdbdef.toString());
-
- deployProperties.setProperty("vdb.definition", vdbdef.toString());
- PropertiesUtils.print(deployPropLoc, deployProperties,"Updated for vdb.definition");
- }
-
-
protected void validateResultsMode(Properties props) {
// Determine from property what to do with query results
String resultModeStr = props.getProperty(
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -37,6 +37,7 @@
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.connection.DataSourceConnection;
import org.teiid.test.framework.connection.DriverConnection;
+import org.teiid.test.framework.datasource.DataSourceMgr;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -164,62 +165,67 @@
TestClientTransaction userTxn = new TestClientTransaction(queryset);
Iterator<String> qsetIt = queryset.getQuerySetIDs().iterator();
+ TestResultsSummary summary = new TestResultsSummary(queryset.getResultsMode());
- TestResultsSummary summary = new TestResultsSummary(queryset.getResultsMode());
-
- // iterate over the query set ID's, which there
- // should be 1 for each file to be processed
- while (qsetIt.hasNext()) {
- querySetID = qsetIt.next();
-
- TestLogger.logInfo("Start Test Query ID [" + querySetID + "]");
-
- queryTests = queryset.getQueries(querySetID);
-
- // the iterator to process the query tests
- Iterator<QueryTest> queryTestIt = null;
- queryTestIt = queryTests.iterator();
-
- ExpectedResults expectedResults = queryset.getExpectedResults(querySetID);
-
-
-
-
- long beginTS = System.currentTimeMillis();
- long endTS = 0;
-
- while (queryTestIt.hasNext()) {
- QueryTest q = queryTestIt.next();
+ try {
+
+ // iterate over the query set ID's, which there
+ // should be 1 for each file to be processed
+ while (qsetIt.hasNext()) {
+ querySetID = qsetIt.next();
+
+ TestLogger.logInfo("Start Test Query ID [" + querySetID + "]");
+
+ queryTests = queryset.getQueries(querySetID);
+
+ // the iterator to process the query tests
+ Iterator<QueryTest> queryTestIt = null;
+ queryTestIt = queryTests.iterator();
+
+ ExpectedResults expectedResults = queryset.getExpectedResults(querySetID);
+
+
+ long beginTS = System.currentTimeMillis();
+ long endTS = 0;
+
+ while (queryTestIt.hasNext()) {
+ QueryTest q = queryTestIt.next();
+
+ userTxn.init(summary, expectedResults, q);
- userTxn.init(summary, expectedResults, q);
-
- // run test
- try {
- tc.runTransaction(userTxn);
- } catch (Throwable t) {
- TestLogger.logInfo("Testcase run error: " + t.getLocalizedMessage());
- }
-
+ // run test
+ try {
+ tc.runTransaction(userTxn);
+ } catch (Throwable t) {
+ TestLogger.logInfo("Testcase run error: " + t.getLocalizedMessage());
+ }
+
+ }
+
+ endTS = System.currentTimeMillis();
+
+ TestLogger.logInfo("End Test Query ID [" + querySetID + "]");
+
+ summary.printResults(queryset, querySetID,beginTS, endTS);
+
}
- endTS = System.currentTimeMillis();
-
- TestLogger.logInfo("End Test Query ID [" + querySetID + "]");
-
- summary.printResults(queryset, querySetID,beginTS, endTS);
-
+
+ } finally {
+ try {
+ summary.printTotals(queryset);
+ summary.cleanup();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ // cleanup all connections created for this test.
+
+ DataSourceMgr.getInstance().shutdown();
+// userTxn.getConnectionStrategy().shutdown();
+ ConfigPropertyLoader.reset();
}
-
-
- summary.printTotals(queryset);
- summary.cleanup();
-
- // cleanup all connections created for this test.
- userTxn.getConnectionStrategy().shutdown();
- ConfigPropertyLoader.reset();
-
-
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -62,11 +62,11 @@
validateResultsMode(this.getProperties());
- try {
- setupVDBs(this.getProperties());
- } catch (IOException e) {
- throw new TransactionRuntimeException(e.getMessage());
- }
+// try {
+// setupVDBs(this.getProperties());
+// } catch (IOException e) {
+// throw new TransactionRuntimeException(e.getMessage());
+// }
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -753,7 +753,7 @@
QueryScenario set = ClassFactory.createQueryScenario("testscenario");
- _instance.setProperty(XMLQueryReader.PROP_QUERY_FILES_ROOT_DIR, new File("target/classes/").getAbsolutePath() );
+ _instance.setProperty(XMLQueryReader.PROP_QUERY_FILES_ROOT_DIR, new File("src/main/resources/").getAbsolutePath() );
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryReader.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryReader.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryReader.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -123,7 +123,7 @@
String msg = "Query file doesn't exist or cannot be read: " + queryFileName + ", ignoring and continuing";
TestLogger.log(msg);
throw new TransactionRuntimeException(msg); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
+ }
// Get query set name
// String querySet = getQuerySetName(queryFileName) ; //$NON-NLS-1$
@@ -144,7 +144,7 @@
TestLogger.log(msg);
throw new IOException(msg); //$NON-NLS-1$ //$NON-NLS-2$
}
- }
+
// return queries;
}
@@ -170,7 +170,7 @@
}
_instance.setProperty(PROP_QUERY_FILES_ROOT_DIR, new File(
- "target/classes/").getAbsolutePath());
+ "src/main/resources/").getAbsolutePath());
try {
XMLQueryReader reader = new XMLQueryReader("scenario_id", _instance.getProperties());
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -5,7 +5,6 @@
import java.util.Properties;
import org.teiid.core.util.PropertiesUtils;
-import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.datasource.DataStore;
import org.teiid.test.util.PropUtils;
@@ -44,22 +43,22 @@
private Map<String, String>modelAssignedDatabaseType = new HashMap<String, String>(5);
- private DataSourceFactory dsfactory = null;
-
private ConfigPropertyLoader() {
}
public static synchronized ConfigPropertyLoader getInstance() {
- boolean diff = differentConfigProp();
+ boolean diff = differentConfigProp();
- if (_instance != null && !diff) {
- return _instance;
- }
if (_instance != null) {
- cleanup();
- }
+ if (!diff) {
+ return _instance;
+ }
+
+ reset();
+ }
+
_instance = new ConfigPropertyLoader();
_instance.initialize();
@@ -71,7 +70,7 @@
/**
* because a config file could be different for the subsequent test, check
* to see if the file is different.
- * @return
+ * @return boolean
*/
private static boolean differentConfigProp( ) {
String filename = System.getProperty(ConfigPropertyNames.CONFIG_FILE);
@@ -86,27 +85,21 @@
return false;
}
-
- private static synchronized void cleanup() {
-
- _instance.modelAssignedDatabaseType.clear();
- _instance.props.clear();
- if (_instance.dsfactory != null) {
- _instance.dsfactory.cleanup();
- }
-
- reset();
-
- _instance = null;
- LAST_CONFIG_FILE=null;
- }
/**
* Called after each test to reset any per test settings.
*/
public static synchronized void reset() {
+ if (_instance == null) return;
+
_instance.overrides.clear();
+
+ _instance.modelAssignedDatabaseType.clear();
+ _instance.props.clear();
+
+ _instance = null;
+ LAST_CONFIG_FILE=null;
}
@@ -114,14 +107,9 @@
private void initialize() {
props = PropUtils.loadProperties(LAST_CONFIG_FILE, null);
- dsfactory = new DataSourceFactory(this);
}
- public DataSourceFactory getDataSourceFactory() {
- return this.dsfactory;
- }
-
public String getProperty(String key) {
String rtn = null;
rtn = overrides.getProperty(key);
@@ -162,7 +150,7 @@
* preconfigured and should not be touched by the {@link DataStore}
* processing.
*
- * @return
+ * @return boolean
*/
public boolean isDataStoreDisabled() {
String disable_config = this.getProperty(
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -4,29 +4,14 @@
*/
package org.teiid.test.framework.connection;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.sql.Connection;
-import java.util.Iterator;
-import java.util.List;
import java.util.Properties;
-import java.util.Set;
import javax.sql.XAConnection;
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminFactory;
-import org.teiid.adminapi.Model;
-import org.teiid.adminapi.VDB;
import org.teiid.core.util.PropertiesUtils;
-import org.teiid.jdbc.ConnectionImpl;
-import org.teiid.jdbc.JDBCURL;
import org.teiid.test.framework.ConfigPropertyLoader;
-import org.teiid.test.framework.TestLogger;
import org.teiid.test.framework.datasource.DataSource;
-import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.datasource.DataSourceMgr;
import org.teiid.test.framework.datasource.DataStore;
import org.teiid.test.framework.exception.QueryTestFailedException;
@@ -41,10 +26,9 @@
// closed and reconnected all the time
private boolean useProxy = false;
- public ConnectionStrategy(Properties props, DataSourceFactory dsf) {
+ public ConnectionStrategy(Properties props) {
this.env = PropertiesUtils.clone(props);
- // this.dsFactory = dsf;
}
/*
@@ -55,6 +39,7 @@
* Returns a connection
*
* @return Connection
+ * @throws QueryTestFailedException
*/
public abstract Connection getConnection() throws QueryTestFailedException;
@@ -73,6 +58,9 @@
}
+ /**
+ * @throws QueryTestFailedException
+ */
public Connection getAdminConnection() throws QueryTestFailedException {
return null;
}
@@ -83,6 +71,9 @@
return autoCommit;
}
+ /**
+ * @throws QueryTestFailedException
+ */
public XAConnection getXAConnection() throws QueryTestFailedException {
return null;
}
@@ -106,56 +97,59 @@
this.env.setProperty(key, value);
}
+ /**
+ * @throws QueryTestFailedException
+ */
void configure() throws QueryTestFailedException {
-
- if (this.isDataStoreDisabled()) {
- return;
- } else {
-
- // commenting out until embedded testing is made available and its required to configure
- // the vdb and bindings in this mannder
-
- if (true)
- return;
- }
-
- try {
- // the the driver strategy is going to be used to connection
- // directly to the connector binding
- // source, then no administration can be done
- Admin admin = AdminFactory.getInstance().createAdmin(
- this.env.getProperty("admin.user"),
- this.env.getProperty("admin.password").toCharArray(),
- this.env.getProperty("admin.url"));
-
- java.sql.Connection conn = getConnection();
-
- if (!(conn instanceof ConnectionImpl)) {
- TestLogger
- .log("ConnectionStrategy configuration: connection is not of type MMConnection and therefore no vdb setup will be performed");
- return;
- }
-
-
- // setupVDBConnectorBindings(admin);
-
- // admin.restart();
-
- int sleep = 5;
-
- TestLogger.log("Bouncing the system..(wait " + sleep + " seconds)"); //$NON-NLS-1$
- Thread.sleep(1000 * sleep);
- TestLogger.log("done."); //$NON-NLS-1$
-
- } catch (Throwable e) {
- e.printStackTrace();
-
- throw new TransactionRuntimeException(e.getMessage());
- } finally {
- // need to close and flush the connection after restarting
- // this.shutdown();
-
- }
+//
+// if (this.isDataStoreDisabled()) {
+// return;
+// } else {
+//
+// // commenting out until embedded testing is made available and its required to configure
+// // the vdb and bindings in this mannder
+//
+// if (true)
+// return;
+// }
+//
+// try {
+// // the the driver strategy is going to be used to connection
+// // directly to the connector binding
+// // source, then no administration can be done
+// Admin admin = AdminFactory.getInstance().createAdmin(
+// this.env.getProperty("admin.user"),
+// this.env.getProperty("admin.password").toCharArray(),
+// this.env.getProperty("admin.url"));
+//
+// java.sql.Connection conn = getConnection();
+//
+// if (!(conn instanceof ConnectionImpl)) {
+// TestLogger
+// .log("ConnectionStrategy configuration: connection is not of type MMConnection and therefore no vdb setup will be performed");
+// return;
+// }
+//
+//
+// // setupVDBConnectorBindings(admin);
+//
+// // admin.restart();
+//
+// int sleep = 5;
+//
+// TestLogger.log("Bouncing the system..(wait " + sleep + " seconds)"); //$NON-NLS-1$
+// Thread.sleep(1000 * sleep);
+// TestLogger.log("done."); //$NON-NLS-1$
+//
+// } catch (Throwable e) {
+// e.printStackTrace();
+//
+// throw new TransactionRuntimeException(e.getMessage());
+// } finally {
+// // need to close and flush the connection after restarting
+// // this.shutdown();
+//
+// }
}
// protected void setupVDBConnectorBindings(Admin api) throws
@@ -257,23 +251,23 @@
ConnectionStrategy cs = null;
if (identifier == null) {
- cs = new DriverConnection(ds.getProperties(), null);
+ cs = new DriverConnection(ds.getProperties());
} else {
- cs = new DriverConnection(ds.getProperties(), null);
+ cs = new DriverConnection(ds.getProperties());
}
- conn = cs.getConnection();
+// conn = cs.getConnection();
+//
+// conn = (Connection) Proxy.newProxyInstance(Thread.currentThread()
+// .getContextClassLoader(),
+// new Class[] { java.sql.Connection.class },
+// new CloseInterceptor(conn));
- conn = (Connection) Proxy.newProxyInstance(Thread.currentThread()
- .getContextClassLoader(),
- new Class[] { java.sql.Connection.class },
- new CloseInterceptor(conn));
+ ds.setConnection(cs.getConnection());
- ds.setConnection(conn);
+ return ds.getConnection();
- return conn;
-
}
public synchronized XAConnection createDataSourceConnection(
@@ -296,48 +290,48 @@
ConnectionStrategy cs = null;
if (identifier == null) {
- cs = new DataSourceConnection(ds.getProperties(), null);
+ cs = new DataSourceConnection(ds.getProperties());
} else {
- cs = new DataSourceConnection(ds.getProperties(), null);
+ cs = new DataSourceConnection(ds.getProperties());
}
- conn = cs.getXAConnection();
+// conn = cs.getXAConnection();
+//
+// conn = (XAConnection) Proxy.newProxyInstance(Thread.currentThread()
+// .getContextClassLoader(),
+// new Class[] { javax.sql.XAConnection.class },
+// new CloseInterceptor(conn));
- conn = (XAConnection) Proxy.newProxyInstance(Thread.currentThread()
- .getContextClassLoader(),
- new Class[] { javax.sql.XAConnection.class },
- new CloseInterceptor(conn));
+ ds.setXAConnection(cs.getXAConnection());
- ds.setXAConnection(conn);
+ return ds.getXAConnection();
- return conn;
-
}
- class CloseInterceptor implements InvocationHandler {
+// class CloseInterceptor implements InvocationHandler {
+//
+// Connection conn;
+// XAConnection xaconn;
+//
+// CloseInterceptor(Object conn) {
+// if (conn instanceof Connection) {
+// this.conn = (Connection) conn;
+// } else {
+// this.xaconn = (XAConnection) conn;
+// }
+// }
+//
+// public Object invoke(Object proxy, Method method, Object[] args)
+// throws Throwable {
+// if (method.getName().equals("close")) { //$NON-NLS-1$
+// return null;
+// }
+// try {
+// return method.invoke(this.conn, args);
+// } catch (InvocationTargetException e) {
+// throw e.getTargetException();
+// }
+// }
+// }
- Connection conn;
- XAConnection xaconn;
-
- CloseInterceptor(Object conn) {
- if (conn instanceof Connection) {
- this.conn = (Connection) conn;
- } else {
- this.xaconn = (XAConnection) conn;
- }
- }
-
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable {
- if (method.getName().equals("close")) { //$NON-NLS-1$
- return null;
- }
- try {
- return method.invoke(this.conn, args);
- } catch (InvocationTargetException e) {
- throw e.getTargetException();
- }
- }
- }
-
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -37,15 +37,15 @@
if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION)) {
// pass in null to create new strategy
- strategy = new DriverConnection(props, configLoader.getDataSourceFactory());
+ strategy = new DriverConnection(props);
TestLogger.log("Created Driver Strategy");
}
else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION)) {
- strategy = new DataSourceConnection(props, configLoader.getDataSourceFactory());
+ strategy = new DataSourceConnection(props);
TestLogger.log("Created DataSource Strategy");
}
else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.JNDI_CONNECTION)) {
- strategy = new JEEConnection(props, configLoader.getDataSourceFactory());
+ strategy = new JEEConnection(props);
TestLogger.log("Created JEE Strategy");
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -16,7 +16,6 @@
import org.teiid.jdbc.BaseDataSource;
import org.teiid.jdbc.TeiidDataSource;
import org.teiid.test.framework.TestLogger;
-import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -56,9 +55,8 @@
private XAConnection xaConnection;
- public DataSourceConnection(Properties props,
- DataSourceFactory dsf) throws QueryTestFailedException {
- super(props, dsf);
+ public DataSourceConnection(Properties props) throws QueryTestFailedException {
+ super(props);
}
public void validate() {
@@ -103,6 +101,7 @@
}
+ @Override
public Connection getConnection() throws QueryTestFailedException {
try {
return getXAConnection().getConnection();
@@ -114,6 +113,7 @@
}
}
+ @Override
public synchronized XAConnection getXAConnection()
throws QueryTestFailedException {
if (xaConnection == null) {
@@ -175,7 +175,7 @@
if (this.xaConnection != null) {
this.xaConnection.close();
}
- } catch (SQLException e) {
+ } catch (Exception e) {
// ignore..
}
this.xaConnection = null;
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -10,7 +10,6 @@
import java.util.Properties;
import org.teiid.test.framework.TestLogger;
-import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -44,9 +43,8 @@
private Connection connection;
- public DriverConnection(Properties props,
- DataSourceFactory dsf) throws QueryTestFailedException {
- super(props, dsf);
+ public DriverConnection(Properties props) throws QueryTestFailedException {
+ super(props);
validate();
}
@@ -112,7 +110,7 @@
private Connection getJDBCConnection(String driver, String url,
String user, String passwd) throws QueryTestFailedException {
- TestLogger.log("Creating Driver Connection: \"" + url + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ TestLogger.log("Creating Driver Connection: \"" + url + "\"" + " user:password - " + (user!=null?user:"NA") + ":" + (passwd!=null?passwd:"NA")); //$NON-NLS-1$ //$NON-NLS-2$
Connection conn = null;
try {
@@ -131,6 +129,7 @@
}
+ @Override
public void shutdown() {
super.shutdown();
if (this.connection != null) {
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -26,9 +26,8 @@
private String jndi_name = null;
- public JEEConnection(Properties props,
- DataSourceFactory dsf) throws QueryTestFailedException {
- super(props, dsf);
+ public JEEConnection(Properties props) throws QueryTestFailedException {
+ super(props);
}
public Connection getConnection() throws QueryTestFailedException {
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSource.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSource.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSource.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -1,5 +1,9 @@
package org.teiid.test.framework.datasource;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
@@ -27,7 +31,9 @@
// for the duration of all tests so thats there's not
// disconnect/connect being performed over and over
private Connection conn=null;
+ private Connection proxyconn = null;
private XAConnection xaconn=null;
+ private XAConnection proxyxaconn=null;
public DataSource(String name, String group, Properties properties) {
@@ -65,30 +71,42 @@
public Connection getConnection() throws QueryTestFailedException {
if (this.conn == null) return null;
-
+
try {
if (this.conn.isClosed()) {
this.conn = null;
+ this.proxyconn = null;
}
} catch (SQLException e) {
this.conn = null;
+ this.proxyconn = null;
}
- return this.conn;
+ return this.proxyconn;
}
public void setConnection(Connection c) {
this.conn = c;
+
+ this.proxyconn = (Connection) Proxy.newProxyInstance(Thread.currentThread()
+ .getContextClassLoader(),
+ new Class[] { java.sql.Connection.class },
+ new CloseInterceptor(conn));
}
public XAConnection getXAConnection() throws QueryTestFailedException {
- return this.xaconn;
+ return this.proxyxaconn;
}
public void setXAConnection(XAConnection xaconn) {
this.xaconn = xaconn;
+
+ this.proxyxaconn = (XAConnection) Proxy.newProxyInstance(Thread.currentThread()
+ .getContextClassLoader(),
+ new Class[] { XAConnection.class },
+ new CloseInterceptor(xaconn));
}
public void shutdown() {
@@ -103,19 +121,45 @@
this.conn = null;
- try {
- if (this.xaconn != null) {
- this.xaconn.close();
+ if (this.xaconn != null) {
+ try {
+ this.xaconn.close();
+ } catch (Exception e) {
+ // ignore..
}
- } catch (SQLException e) {
- // ignore..
- }
+ }
+
this.xaconn = null;
}
+
-
+ class CloseInterceptor implements InvocationHandler {
+ Connection conn;
+ XAConnection xaconn;
+
+ CloseInterceptor(Object conn) {
+ if (conn instanceof Connection) {
+ this.conn = (Connection) conn;
+ } else {
+ this.xaconn = (XAConnection) conn;
+ }
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ if (method.getName().equals("close")) { //$NON-NLS-1$
+ return null;
+ }
+ try {
+ return method.invoke(this.conn, args);
+ } catch (InvocationTargetException e) {
+ throw e.getTargetException();
+ }
+ }
+ }
+
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -91,11 +91,7 @@
// the DO_NO_USE_DEFAULT will be passed in when the test are run from maven and no property is passed in for UseDataSources
private static final String DO_NOT_USE_DEFAULT="${usedatasources}";
-
- private DataSourceMgr dsmgr = DataSourceMgr.getInstance();
-
-// private ConfigPropertyLoader configprops;
-
+
private Properties configprops;
// contains the names of the datasources when the -Dusedatasources option is used
@@ -124,7 +120,7 @@
public DataSourceFactory(ConfigPropertyLoader config) {
this.configprops = PropertiesUtils.clone(config.getProperties(), null, true);
this.requiredDataBaseTypes = config.getModelAssignedDatabaseTypes();
- config();
+
}
public Properties getConfigProperties() {
@@ -143,8 +139,10 @@
*
* @since
*/
- private void config() {
+ protected void config(DataSourceMgr dsmgr) {
TestLogger.logDebug("Configure Datasource Factory ");
+
+ dsmgr = DataSourceMgr.getInstance();
Map<String, DataSource> availDatasources = dsmgr.getDataSources();
@@ -211,8 +209,10 @@
// if use a specific db type is specified, then it must match,
// otherwise add it to the available list
- if (useDBTypes.size() > 0 && usedstypeprop.contains(ds.getDBType())) {
- availDS.put(ds.getName(), ds);
+ if (useDBTypes.size() > 0) {
+ if ( usedstypeprop.contains(ds.getDBType())) {
+ availDS.put(ds.getName(), ds);
+ }
} else {
availDS.put(ds.getName(), ds);
}
@@ -269,8 +269,7 @@
return (metDBRequiredTypes ? this.availDS.size() :0);
}
- public synchronized DataSource getDatasource(String datasourceid,
- String modelName) throws QueryTestFailedException {
+ public synchronized DataSource getDatasource(String modelName) throws QueryTestFailedException {
DataSource ds = null;
// map the datasource to the model and datasourceid
@@ -288,11 +287,7 @@
// model
// will use the same datasource
- ds = dsmgr.getDataSource(key);
- if (ds != null) {
- return ds;
- }
-
+
if (this.hasRequiredDBTypes) {
if (this.requiredDataBaseTypes.containsKey(modelName)) {
String dbtype = this.requiredDataBaseTypes.get(modelName);
@@ -316,7 +311,7 @@
}
} else if (useDS != null) {
- String dsname = useDS.get(datasourceid);
+ String dsname = useDS.get(modelName);
if (dsname != null) {
ds = availDS.get(dsname);
if (ds == null) {
@@ -372,29 +367,22 @@
}
}
-
- if (ds == null) {
- throw new QueryTestFailedException(
- "Unable to assign a datasource for model:datasourceid "
- + modelName + ":" + datasourceid);
-
+
+ if (ds != null) {
+ assignedDataSources.add(ds.getName());
}
- assignedDataSources.add(ds.getName());
-
- dsmgr.setDataSource(key, ds);
return ds;
}
public void cleanup() {
- dsmgr.clear();
assignedDataSources.clear();
- requiredDataBaseTypes.clear();
+// requiredDataBaseTypes.clear();
if (useDS != null) useDS.clear();
- if (availDS != null) availDS.clear();
+// if (availDS != null) availDS.clear();
}
@@ -407,7 +395,7 @@
DataSourceFactory factory = new DataSourceFactory(config);
try {
- if (factory.getDatasource("1", "model1") == null) {
+ if (factory.getDatasource("model1") == null) {
throw new TransactionRuntimeException("No datasource was not found");
}
@@ -430,7 +418,7 @@
try {
- DataSource dsfind = factory.getDatasource("2", "model2");
+ DataSource dsfind = factory.getDatasource( "model2");
if (dsfind == null) {
throw new TransactionRuntimeException("No datasource was not found as the 2nd datasource");
@@ -445,7 +433,7 @@
}
- dsfind = factory.getDatasource("1", "model1");
+ dsfind = factory.getDatasource( "model1");
if (dsfind == null) {
throw new TransactionRuntimeException("No datasource was not found as the 2nd datasource");
@@ -476,7 +464,7 @@
for (int i=0; i<n; i++) {
String k = String.valueOf(i);
- DataSource ds1 = factory.getDatasource(k, "model" + k);
+ DataSource ds1 = factory.getDatasource( "model" + k);
if (ds1 == null) {
throw new TransactionRuntimeException("No datasource was found for: model:" + k);
@@ -486,7 +474,7 @@
}
- DataSource reuse = factory.getDatasource(String.valueOf(n + 1), "model1");
+ DataSource reuse = factory.getDatasource( "model1");
if (reuse != null) {
} else {
@@ -508,7 +496,7 @@
factory = new DataSourceFactory(config);
- DataSource ds1 = factory.getDatasource("1","pm1");
+ DataSource ds1 = factory.getDatasource("pm1");
if (!ds1.getDBType().equalsIgnoreCase(DataSourceFactory.DataBaseTypes.ORACLE)) {
throw new TransactionRuntimeException("Required DB Type of oracle for model pm1 is :" + ds1.getDBType());
}
@@ -528,7 +516,7 @@
factory = new DataSourceFactory(config);
- DataSource ds2 = factory.getDatasource("2","pm2");
+ DataSource ds2 = factory.getDatasource("pm2");
if (!ds2.getDBType().equalsIgnoreCase(DataSourceFactory.DataBaseTypes.SQLSERVER)) {
throw new TransactionRuntimeException("Required DB Type of sqlserver for model pm2 is :" + ds2.getDBType());
}
@@ -548,12 +536,12 @@
factory = new DataSourceFactory(config);
- DataSource ds3a = factory.getDatasource("2","pm2");
+ DataSource ds3a = factory.getDatasource("pm2");
if (!ds3a.getDBType().equalsIgnoreCase(DataSourceFactory.DataBaseTypes.SQLSERVER)) {
throw new TransactionRuntimeException("Required DB Type of sqlserver for model pm12 is :" + ds3a.getDBType());
}
- DataSource ds3b = factory.getDatasource("2","pm1");
+ DataSource ds3b = factory.getDatasource("pm1");
if (!ds3b.getDBType().equalsIgnoreCase(DataSourceFactory.DataBaseTypes.ORACLE)) {
throw new TransactionRuntimeException("Required DB Type of oracle for model pm1 is :" + ds3b.getDBType());
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -38,7 +38,7 @@
* Defines the default location where the datasource files will be found.
* An override can be specified by setting the property {@link ConfigPropertyNames#OVERRIDE_DATASOURCES_LOC}.
*/
- public static final String DEFAULT_DATASOURCES_LOC="./target/classes/datasources/";
+ public static final String DEFAULT_DATASOURCES_LOC="./src/main/resources/datasources/";
/**
* When run from maven, the {@link ConfigPropertyNames#OVERRIDE_DATASOURCES_LOC} will be assigned
@@ -58,8 +58,12 @@
private Map<String, DataSource> modelToDatasourceMap = new HashMap<String, DataSource>(); // key
// =
// modelname
+
+ private DataSourceFactory dsfactory = null;
+
private DataSourceMgr() {
+
}
public static synchronized DataSourceMgr getInstance() {
@@ -76,6 +80,10 @@
}
return _instance;
}
+
+ private static synchronized void reset() {
+ _instance = null;
+ }
public Map<String, DataSource> getDataSources() {
Map<String, DataSource> ds = new HashMap<String, DataSource>(
@@ -88,31 +96,86 @@
return allDatasourcesMap.size();
}
+ @SuppressWarnings("deprecation")
public DataSource getDataSource(String modelname) {
if (modelToDatasourceMap.containsKey(modelname)) {
return modelToDatasourceMap.get(modelname);
}
- return null;
+
+ try {
+ DataSource ds = dsfactory.getDatasource( modelname);
+
+ if (ds == null) {
+ printAllDatasources();
+
+ try {
+ Thread.sleep(100000);
+ } catch (InterruptedException e) {
+ }
+ Thread.currentThread().getThreadGroup().stop();
+
+
+// throw new QueryTestFailedException(
+// "Unable to assign a datasource for model "
+// + modelname );
+
+ }
+ modelToDatasourceMap.put(modelname, ds);
+ return ds;
+ } catch (QueryTestFailedException e) {
+ throw new TransactionRuntimeException(e);
+ }
}
- void clear() {
- modelToDatasourceMap.clear();
+ private void printAllDatasources() {
+ Iterator<String> it=allDatasourcesMap.keySet().iterator();
+ while(it.hasNext()) {
+ String key = it.next();
+ DataSource ds = allDatasourcesMap.get(key);
+ TestLogger.log("DataSource: " + ds.getName());
+
+ }
+
}
+
public void shutdown() {
- if (allDatasourcesMap == null || allDatasourcesMap.size() == 0) {
- return;
+ TestLogger.log("Shutting down data sources");
+
+ if (allDatasourcesMap != null && allDatasourcesMap.size() > 0) {
+ Iterator<String> it=allDatasourcesMap.keySet().iterator();
+ while(it.hasNext()) {
+ String key = it.next();
+ DataSource ds = allDatasourcesMap.get(key);
+ try {
+ ds.shutdown();
+ } catch (Throwable t) {
+
+ }
+ }
+
+ allDatasourcesMap.clear();
}
- Iterator<String> it=allDatasourcesMap.keySet().iterator();
- while(it.hasNext()) {
- String key = (String) it.next();
- DataSource ds = allDatasourcesMap.get(key);
- ds.shutdown();
+ if (modelToDatasourceMap != null || modelToDatasourceMap.size() > 0) {
+ Iterator<String> it=modelToDatasourceMap.keySet().iterator();
+ while(it.hasNext()) {
+ String key = it.next();
+ DataSource ds = modelToDatasourceMap.get(key);
+ try {
+ ds.shutdown();
+ } catch (Throwable t) {
+
+ }
+ }
+
+ modelToDatasourceMap.clear();
}
- allDatasourcesMap.clear();
+ dsfactory.cleanup();
+ DataSourceMgr.reset();
+
}
public void setDataSource(String modelName, DataSource ds) {
@@ -158,6 +221,10 @@
TestLogger.logDebug("Number of total datasource mappings loaded "
+ allDatasourcesMap.size());
+
+
+ dsfactory = new DataSourceFactory(ConfigPropertyLoader.getInstance());
+ dsfactory.config(this);
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -63,20 +63,22 @@
Statement stmt = c.createStatement();
- stmt.addBatch("delete from g2");
- stmt.addBatch("delete from g1");
+ try {
+ stmt.execute("delete from g2");
+ stmt.execute("delete from g1");
+
+ for (int i = 0; i < 100; i++) {
+ stmt.execute("insert into g1 (e1, e2) values("+i+",'"+i+"')");
+ }
+
+
+ for (int i = 0; i < 50; i++) {
+ stmt.execute("insert into g2 (e1, e2) values("+i+",'"+i+"')");
+ }
- for (int i = 0; i < 100; i++) {
- stmt.addBatch("insert into g1 (e1, e2) values("+i+",'"+i+"')");
+ } finally {
+ stmt.close();
}
-
-
- for (int i = 0; i < 50; i++) {
- stmt.addBatch("insert into g2 (e1, e2) values("+i+",'"+i+"')");
- }
-
- stmt.executeBatch();
- stmt.close();
}
@@ -106,11 +108,13 @@
private static void setUpTest(Connection c) throws Exception {
Statement stmt = c.createStatement();
- stmt.addBatch("delete from g2 where e1 >= 50"); //$NON-NLS-1$
- stmt.addBatch("delete from g1 where e1 >= 100");
-
- stmt.executeBatch();
- stmt.close();
+ try {
+ stmt.execute("delete from g2 where e1 >= 50"); //$NON-NLS-1$
+ stmt.execute("delete from g1 where e1 >= 100");
+
+ } finally {
+ stmt.close();
+ }
}
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-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/query/AbstractQueryTransactionTest.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -79,20 +79,13 @@
}
-
-// @Override
-// protected void compareResults(BufferedReader resultReader,
-// BufferedReader expectedReader) throws IOException {
-// assertEquals(read(expectedReader, compareResultsCaseSensitive()), read(
-// resultReader, compareResultsCaseSensitive()));
-// }
-
@Override
public ConnectionStrategy getConnectionStrategy() {
// TODO Auto-generated method stub
return this.connStrategy;
}
+ @SuppressWarnings("deprecation")
@Override
protected void assignExecutionProperties(Statement stmt) {
if (stmt instanceof org.teiid.jdbc.TeiidStatement) {
@@ -189,7 +182,7 @@
* This is because each test could potentially use an include/exclude datasource option
* that could change the mappings between tests.
* @param identifier
- * @return
+ * @return Connection
* @throws QueryTestFailedException
*/
public Connection getSource(String identifier)
@@ -227,7 +220,7 @@
* Indicates what should be done when a failure occurs in
* {@link #testCase()}
*
- * @return
+ * @return boolean
*
* @since
*/
@@ -263,16 +256,8 @@
* end of the test.
*/
public void cleanup() {
- super.closeConnection();
-
ConfigPropertyLoader.reset();
-
- // cleanup all connections created for this test.
- if (connStrategy != null) {
- connStrategy.shutdown();
- }
-
}
@Override
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -22,6 +22,7 @@
super();
}
+ @Override
protected void before(TransactionQueryTestCase test) {
try {
xid = createXid();
@@ -41,6 +42,7 @@
return new XidImpl(0, gid, bid);
}
+ @Override
protected void after(TransactionQueryTestCase test) {
boolean delistSuccessful = false;
boolean commit = false;
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -5,6 +5,7 @@
import java.io.InputStream;
import java.util.Properties;
+import org.junit.Assert;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -15,6 +16,7 @@
public static Properties loadProperties(String filename, Properties defaults) {
+ Assert.assertNotNull(filename);
InputStream in = null;
Properties props = new Properties();
if (defaults != null) {
Added: trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh (rev 0)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh 2010-06-10 16:23:19 UTC (rev 2214)
@@ -0,0 +1,155 @@
+#!/bin/sh
+
+# This script will run the client tests
+
+#============================
+# REQUIRED PROPERTIES
+#
+
+#============================
+# OPTIONAL PROPERTIES
+#
+# (if not set, will default to files within the db project)
+# - QUERYSETDIR - directory location where the test querties can be found
+# - SCENARIODIR - directory location where the scenario files found and determine which query sets and vdbs to use,
+# - DATASOURCEDIR - root directory location to find the various datasources to use
+# - CONFIGFILE - specify the configuration file to use (override ctc-test.properties)
+
+######################################################
+# DEBUGGING OPTION
+#
+# JBEDSP_DEBUG - uncomment to enable the output of debug messages.
+#
+# JBEDSP_DEBUG=true
+#
+
+if [ -z "${QUERYSETDIR}" ]
+ then
+
+ QUERYSETDIR='./src/main/resources/ctc_tests/queries'
+
+fi
+
+if [ -z "${SCENARIODIR}" ]
+ then
+
+ SCENARIODIR='./src/main/resources/ctc_tests/scenarios'
+
+fi
+
+
+if [ -z "${DATASOURCEDIR}" ]
+ then
+
+ DATASOURCEDIR='./src/main/resources/datasources'
+fi
+
+echo "Use Datasource directory: ${DATASOURCEDIR}"
+
+#--------------------
+
+# resolve links - $0 may be a softlink
+LOC="$0"
+
+while [ -h "$LOC" ] ; do
+ ls=`ls -ld "$LOC"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ LOC="$link"
+ else
+ LOC=`dirname "$LOC"`/"$link"
+ fi
+done
+
+LOCDIR=`dirname "$LOC"`
+PRGDIR=`cd "$LOCDIR"; pwd`
+
+cd "${PRGDIR}"
+
+echo "============================"
+echo "Running tests from ${PRGDIR}"
+echo "============================"
+
+# check if running from the kit
+if [ -f "${PRGDIR}/resources/ctc_tests/ctc.xml" ]; then
+ CTCXML=${PRGDIR}/resources/ctc_tests/ctc.xml
+else
+ CTCXML='./src/main/resources/ctc_tests/ctc.xml'
+
+fi
+
+
+ANT_ARGS=" -Dscenario.dir=${SCENARIODIR}"
+ANT_ARGS="${ANT_ARGS} -Dqueryset.artifacts.dir=${QUERYSETDIR}"
+#ANT_ARGS="${ANT_ARGS} -Dvdb.artifacts.dir=${vdb.artifacts.dir}"
+ANT_ARGS="${ANT_ARGS} -Dproj.dir=${PRGDIR}"
+
+# default to the ip address used to start the server
+SVRNAME="0.0.0.0"
+
+if [ ! -z "${SERVERNAME}" ]
+ then
+
+ SVRNAME=${SERVERNAME}
+
+fi
+
+ANT_ARGS="${ANT_ARGS} -Dserver.host.name=${SVRNAME}"
+
+
+if [ ! -z "${XMLCLZZ}" ]
+ then
+
+ ANT_ARGS="${ANT_ARGS} -Dquery.scenario.classname=$XMLCLZZ"
+
+fi
+
+if [ ! -z "${CONFIGFILE}" ]
+ then
+
+ ANT_ARGS="${ANT_ARGS} -Dconfig.file=${CONFIGFILE}"
+
+fi
+
+if [ ! -z "${PROPFILE}" ]
+ then
+
+ ANT_ARGS=" -propertyfile $PROPFILE $ANT_ARGS "
+
+fi
+
+
+ANT_OPTS="-Xmx512m"
+ANT_HOME=${PRGDIR}/ant
+
+# uncomment for additional debugging info in the logfile
+# turn on debug for additional debugging info in the logfile
+if [ -n "$JBEDSP_DEBUG" ]; then
+ ANT_ARGS="${ANT_ARGS} -verbose"
+ fi
+
+if [ ! -x "${PRGDIR}/log" ]; then
+ echo "Create ${PRGDIR}/log directory"
+ mkdir "${PRGDIR}"/log
+fi
+
+if [ -n "${JAVA_OPTS}" ]; then
+ ANT_OPTS="${JAVA_OPTS} $ANT_OPTS "
+fi
+
+CP="${PRGDIR}:${PRGDIR}/ant/*"
+
+LOGLEVEL=info
+
+echo "ANT BUILDFILE=${CTCXML}"
+echo "ANT_HOME=${ANT_HOME}"
+echo "ANT_ARGS=${ANT_ARGS}"
+echo "CP=$CP"
+
+java -cp "${CP}" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS -buildfile ${CTCXML}
+
+
+
+
+
+
Property changes on: trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/test-integration/db/src/main/resources/default-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/default-config.properties 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/resources/default-config.properties 2010-06-10 16:23:19 UTC (rev 2214)
@@ -1,8 +1,8 @@
##########################################
-# Common Properties for everybody
+# Common Properties for the default test of using the Teiid Driver
##########################################
-connection-type=datasource
+connection-type=driver
process-batch = 20
connector-batch = 20
@@ -14,16 +14,17 @@
##########################################
# properties for Teiid connection
##########################################
-#driver=org.teiid.jdbc.TeiidDriver
-driver=com.metamatrix.jdbc.EmbeddedDataSource
+driver=org.teiid.jdbc.TeiidDriver
+URL=jdbc:metamatrix:Transaction@mm://127.0.0.1:31000
-#URL=jdbc:teiid:Transaction@mm://localhost:31000
-URL=jdbc:metamatrix:Transaction@target/classes/transactions/transaction.properties;user=admin;password=teiid
+#;user=admin;password=admin
+
+
User=admin
Password=teiid
DatabaseName=Transaction
-#ServerName=localhost
-ServerName=target/classes/transactions/transaction.properties
+ServerName=localhost
+#ServerName=target/classes/transactions/transaction.properties
PortNumber=31000
application-name=txn-test
@@ -42,7 +43,8 @@
# 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.
#
-# By providing the numerical order, it indicates which datasource to assign based on the order in the usedatasources property.
+# By providing the numerical order, it indicates which datasource to assign based on the order when the "usedatasources" property is
+# specified. If not specified, the numerical order has no impact.
#
# If -Dusedatasources is not set, then the datasource will be assigned randomly when obtaining a datasource.
#
Modified: trunk/test-integration/db/src/main/resources/xa-config.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/xa-config.properties 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/main/resources/xa-config.properties 2010-06-10 16:23:19 UTC (rev 2214)
@@ -1,7 +1,9 @@
##########################################
-# Common Properties for everybody
+# Common Properties for the test that use the Teiid Datasource in order to obtain a connection
##########################################
+connection-type=datasource
+
process-batch = 20
connector-batch = 20
@@ -13,12 +15,12 @@
# properties for Teiid connection
##########################################
driver=org.teiid.jdbc.TeiidDataSource
-URL=jdbc:metamatrix:Transaction@target/classes/transactions/transaction.properties;user=admin;password=teiid
+URL=jdbc:metamatrix:Transaction@mm://127.0.0.1:31000
User=admin
Password=teiid
DatabaseName=Transaction
-ServerName=target/classes/transactions/transaction.properties
-PortNumber=0
+ServerName=localhost
+PortNumber=31000
application-name=txn-test
# jboss
@@ -42,30 +44,6 @@
pm2=2
-##########################################
-# For default design of testcases, these properties are in the setup method of the testcase.
-# However, you can create your own version of the config properties file
-# and specify these properties in the config file
-# NOTE: will need to set the Sytem "config" property in order to override the default-config.properties file
-##########################################
-
-
-#available types (datasource, driver, jndi)
-#connection-type=datasource
-#connection-type=driver
-
-
-# autocommit applies to local transaction-type only
-# default is true
-#autocommit=false
-
-# AUTO_WRAP_OFF = "OFF"
-# AUTO_WRAP_ON = "ON"
-# AUTO_WRAP_PESSIMISTIC = "PESSIMISTIC"
-# AUTO_WRAP_OPTIMISTIC = "OPTIMISTIC"
-
-#txnAutoWrap=off
-
#-----------------------------
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -37,7 +37,7 @@
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.UnitTestUtil;
-
+@Ignore
@SuppressWarnings("nls")
public class TestConnectorBindings extends BaseConnection {
static ServerDatasourceConnection ds;
Modified: trunk/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -25,6 +25,7 @@
import java.sql.Connection;
import java.sql.DatabaseMetaData;
+import org.junit.Ignore;
import org.junit.Test;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.jdbc.AbstractMMQueryTestCase;
@@ -33,6 +34,7 @@
/**
* Test the DatabaseMetadata results using the Parts VDB.
*/
+@Ignore
public class TestVDBLessExecution extends AbstractMMQueryTestCase {
private static final String DQP_PROP_FILE = UnitTestUtil.getTestDataPath() + "/vdbless/dqp.properties;user=test"; //$NON-NLS-1$
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 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/AutoWrapTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -6,6 +6,7 @@
import java.util.ArrayList;
+import org.junit.Test;
import org.teiid.jdbc.AbstractQueryTest;
import org.teiid.test.framework.ConfigPropertyNames;
import org.teiid.test.framework.TransactionContainer;
@@ -16,9 +17,6 @@
public class AutoWrapTransactionTests extends CommonTransactionTests {
- public AutoWrapTransactionTests(String testName) {
- super(testName);
- }
protected TransactionContainer getTransactionContainter() {
@@ -31,6 +29,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
@@ -58,7 +57,7 @@
test.assertRowCount(10);
test.execute("select * from g2 where e1 = 9999");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -67,6 +66,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testSingleSourceBatchCommandReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceBatchCommandReferentialIntegrityRollback") {
public void testCase() throws Exception {
@@ -94,7 +94,7 @@
test.assertRowCount(0);
test.execute("select * from g2 where e1 = 9999");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -103,6 +103,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
ArrayList list = new ArrayList();
@@ -130,13 +131,11 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
test.execute("select * from g2 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
- test.closeConnection();
}
}
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 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -1,42 +1,47 @@
package org.teiid.test.testcases;
-import junit.framework.TestCase;
-
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
+import org.teiid.test.framework.datasource.DataSourceMgr;
-public abstract class BaseAbstractTransactionTestCase extends TestCase {
+public abstract class BaseAbstractTransactionTestCase {
- public BaseAbstractTransactionTestCase(String name) {
- super(name);
-
-
- }
protected abstract TransactionContainer getTransactionContainter();
-
- @Override
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
+ @BeforeClass
+ public static void beforeAll() throws Exception {
+ ConfigPropertyLoader.reset();
+ ConfigPropertyLoader.getInstance();
}
- @Override
- protected void tearDown() throws Exception {
- // TODO Auto-generated method stub
- super.tearDown();
+ @Before
+ public void beforeEach() throws Exception {
}
+ @After
+ public void afterEach() throws Exception {
+ }
+
protected void addProperty(String key, String value) {
ConfigPropertyLoader.getInstance().setProperty(key, value);
}
+
+ @AfterClass
+ public static void afterAll() {
+ DataSourceMgr.getInstance().shutdown();
+ }
+
+
-
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -8,6 +8,9 @@
import java.util.ArrayList;
import java.util.concurrent.TimeoutException;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
import org.teiid.jdbc.AbstractQueryTest;
import org.teiid.jdbc.TeiidSQLException;
import org.teiid.test.framework.TransactionContainer;
@@ -20,12 +23,7 @@
*/
public abstract class CommonTransactionTests extends BaseAbstractTransactionTestCase {
- public CommonTransactionTests(String name) {
- super(name);
- }
-
- protected abstract TransactionContainer getTransactionContainter();
-
+
// void runConcurrentTestCases(int howMany, final String[] sqls) {
//
// SeparateClient[] clients = new SeparateClient[howMany];
@@ -76,6 +74,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceSelect() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceSelect") {
public void testCase() throws Exception {
@@ -97,6 +96,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceUpdate") {
public void testCase() throws Exception {
@@ -111,7 +111,6 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 = 100");
test.assertRowCount(1);
- test.closeConnection();
}
@@ -121,6 +120,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourcePreparedUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePreparedUpdate") {
@@ -136,7 +136,7 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 = 102");
test.assertRowCount(1);
- test.closeConnection();
+
}
/**
@@ -145,6 +145,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceMultipleCommands() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommands") {
public void testCase() throws Exception {
@@ -171,7 +172,7 @@
test.assertRowCount(10);
test.execute("select * from g2 where e1 >= 100");
test.assertRowCount(10);
- test.closeConnection();
+
}
/**
@@ -180,6 +181,7 @@
* Batching = Partial Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourcePartialProcessing() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePartialProcessing") {
public void testCase() throws Exception {
@@ -202,6 +204,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceSelect() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelect") {
public void testCase() throws Exception {
@@ -220,6 +223,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceVirtualSelect() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceVirtualSelect") {
public void testCase() throws Exception {
@@ -238,6 +242,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceUpdate") {
public void testCase() throws Exception {
@@ -257,7 +262,6 @@
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e2 = '500'");
test.assertRowCount(1);
- test.closeConnection();
}
/**
@@ -266,6 +270,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceSelectInto() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelectInto") {
public void testCase() throws Exception {
@@ -281,12 +286,10 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e2 = '501'");
test.assertRowCount(1);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e2 = '501'");
test.assertRowCount(1);
- test.closeConnection();
}
/**
@@ -295,6 +298,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceBulkRowInsert() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsert") {
public void testCase() throws Exception {
@@ -313,14 +317,12 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 100 and e1 < 112");
test.assertRowCount(12);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 100 and e1 < 112");
test.assertRowCount(12);
test.execute("select * from g2 where e1 >= 100 and e1 < 112");
test.assertRowCount(12);
- test.closeConnection();
}
/**
@@ -329,6 +331,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourcePreparedUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePreparedUpdate") {
public void testCase() throws Exception {
@@ -344,12 +347,11 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 = 500");
test.assertRowCount(1);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 = 500");
test.assertRowCount(1);
- test.closeConnection();
+
}
@@ -359,6 +361,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceMultipleCommands() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommands") {
public void testCase() throws Exception {
@@ -404,7 +407,7 @@
} else {
test.assertResultsSetEquals(new String[] {"e2[varchar]", "blah"});
}
- test.closeConnection();
+
}
/**
@@ -413,6 +416,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceMultipleVirtualCommands() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleVirtualCommands") {
public void testCase() throws Exception {
@@ -448,7 +452,7 @@
test.assertRowCount(5);
test.execute("select distinct e2 from g1 where e1 >= 200 and e1 < 207");
test.assertResultsSetEquals(new String[] {"e2[varchar2]", "blah"});
- test.closeConnection();
+
}
/**
@@ -457,6 +461,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testMultipleSourceMultipleCommandsCancel() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsCancel") {
@@ -492,7 +497,6 @@
test.assertRowCount(0);
test.execute("select distinct e2 from g1 where e1 >= 600 and e1 < 650");
test.assertRowCount(0);
- test.closeConnection();
}
/**
@@ -501,6 +505,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testMultipleSourceTimeout() throws Exception{
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceTimeout") {
public void testCase() throws Exception {
@@ -513,7 +518,7 @@
public void after() {
if (!exceptionOccurred()) {
- fail("should have failed with time out exception");
+ Assert.assertTrue("should have failed with time out exception", false );
}
else {
if (getLastException() != null) {
@@ -538,9 +543,9 @@
}
boolean isfound = (msg.indexOf("Operation timed out before completion") != -1 ? true : false);
- assertTrue("Exception Message didnt match 'Operation timed out before completion' found: " + msg, isfound );
+ Assert.assertTrue("Exception Message didnt match 'Operation timed out before completion' found: " + msg, isfound );
} else {
- fail("Program Error: it indicates exception occured, but no exception is found" );
+ Assert.assertTrue("Program Error: it indicates exception occured, but no exception is found", false );
}
}
}
@@ -555,7 +560,7 @@
test.assertRowCount(0);
test.execute("select distinct e2 from g1 where e1 >= 600 and e1 < 750");
test.assertRowCount(0);
- test.closeConnection();
+
}
@@ -589,7 +594,9 @@
* Note: This is producing the below error some times; however this is SQL Server issue.
* http://support.microsoft.com/?kbid=834849
*/
- public void xtestMultipleSourcePartialProcessingUsingLimit() throws Exception {
+ @Ignore
+ @Test
+ public void testMultipleSourcePartialProcessingUsingLimit() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePartialProcessingUsingLimit") {
public void testCase() throws Exception {
execute("select * from vm.g1 where pm1e1 < 100 limit 10");
@@ -609,7 +616,9 @@
* Note: This is producing the below error some times; however this is SQL Server issue.
* http://support.microsoft.com/?kbid=834849
*/
- public void xtestMultipleSourcePartialProcessingUsingMakedep() throws Exception {
+ @Ignore
+ @Test
+ public void testMultipleSourcePartialProcessingUsingMakedep() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePartialProcessingUsingMakedep") {
public void testCase() throws Exception {
execute("select pm1.g1.e1, pm1.g1.e2 from pm1.g1 LEFT OUTER JOIN pm2.g1 MAKENOTDEP ON pm1.g1.e2 = pm2.g1.e2 where pm2.g1.e1 >= 50 and pm2.g1.e1 < 100");
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -4,6 +4,7 @@
*/
package org.teiid.test.testcases;
+import org.junit.Test;
import org.teiid.jdbc.AbstractQueryTest;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.query.AbstractQueryTransactionTest;
@@ -20,11 +21,6 @@
public class LocalTransactionTests extends CommonTransactionTests {
- public LocalTransactionTests(String testName) {
- super(testName);
- }
-
-
@Override
protected TransactionContainer getTransactionContainter() {
// TODO Auto-generated method stub
@@ -37,16 +33,19 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testSingleSourceMultipleCommandsExplicitRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsExplicitRollback") {
- public void testCase() throws Exception {
+ @Override
+ public void testCase() throws Exception {
for (int i = 200; i < 220; i++) {
execute("insert into pm1.g1 (e1, e2) values("+i+",'"+i+"')");
execute("insert into pm1.g2 (e1, e2) values("+i+",'"+i+"')");
}
}
- public boolean rollbackAllways() {
+ @Override
+ public boolean rollbackAllways() {
return true;
}
};
@@ -60,7 +59,7 @@
test.assertRowCount(0);
test.execute("select * from g2 where e1 >= 200 and e1 < 220");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -69,6 +68,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
@@ -94,7 +94,7 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 200 and e1 < 220");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -103,6 +103,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testMultipleSourceMultipleCommandsExplicitRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsExplicitRollback") {
public void testCase() throws Exception {
@@ -131,12 +132,11 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 700 and e1 < 720");
test.assertRowCount(0);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 700 and e1 < 720");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -145,6 +145,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testMultipleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
@@ -174,12 +175,12 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 700 and e1 < 720");
test.assertRowCount(0);
- test.closeConnection();
+
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 700 and e1 < 720");
test.assertRowCount(0);
- test.closeConnection();
+
}
/**
@@ -188,6 +189,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
public void testCase() throws Exception {
@@ -213,14 +215,12 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
test.execute("select * from g2 where e1 >= 100 and e1 < 120");
test.assertRowCount(0);
- test.closeConnection();
}
/**
@@ -229,6 +229,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceMultipleVirtualCommandsRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleVirtualCommandsRollback") {
public void testCase() throws Exception {
@@ -267,6 +268,6 @@
test.assertRowCount(0);
test.execute("select distinct e2 from g1 where e1 >= 600 and e1 < 615");
test.assertRowCount(0);
- test.closeConnection();
+
}
}
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 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OffWrapTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -5,6 +5,7 @@
package org.teiid.test.testcases;
import java.util.ArrayList;
+import org.junit.Test;
import org.teiid.jdbc.AbstractQueryTest;
import org.teiid.test.framework.TransactionContainer;
@@ -16,12 +17,8 @@
public class OffWrapTransactionTests extends BaseAbstractTransactionTestCase {
-
-
- public OffWrapTransactionTests(String testName) {
- super(testName);
- }
+
@Override
protected TransactionContainer getTransactionContainter() {
return new TxnAutoTransaction(TXN_AUTO_WRAP_OPTIONS.AUTO_WRAP_OFF);
@@ -35,6 +32,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceSelect() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceSelect") {
@@ -56,6 +54,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceUpdate") {
public void testCase() throws Exception {
@@ -70,7 +69,6 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 = 100");
test.assertRowCount(1);
- test.closeConnection();
}
/**
@@ -79,6 +77,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testSingleSourceMultipleCommands() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommands") {
public void testCase() throws Exception {
@@ -102,7 +101,7 @@
test.assertRowCount(10);
test.execute("select * from g2 where e1 >= 100");
test.assertRowCount(10);
- test.closeConnection();
+
}
/**
@@ -111,6 +110,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
@@ -136,7 +136,7 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 200");
test.assertRowCount(10);
- test.closeConnection();
+
}
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -149,6 +149,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceSelect() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelect") {
public void testCase() throws Exception {
@@ -167,6 +168,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceUpdate() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceUpdate") {
public void testCase() throws Exception {
@@ -181,12 +183,10 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 = 500");
test.assertRowCount(1);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 = 500");
test.assertRowCount(1);
- test.closeConnection();
}
/**
@@ -195,6 +195,7 @@
* Batching = Full Processing, Single Connector Batch
* result = rollback
*/
+ @Test
public void testMultipleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsReferentialIntegrityRollback") {
@@ -225,12 +226,12 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 700 and e1 < 710");
test.assertRowCount(10);
- test.closeConnection();
+
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 700 and e1 < 710");
test.assertRowCount(10);
- test.closeConnection();
+
}
/**
@@ -239,6 +240,7 @@
* Batching = Full Processing, Single Connector Batch
* result = commit
*/
+ @Test
public void testMultipleSourceBulkRowInsert() throws Exception {
@@ -270,13 +272,12 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 800 and e1 < 807");
test.assertRowCount(7);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 800 and e1 < 807");
test.assertRowCount(7);
test.execute("select * from g2 where e1 >= 800 and e1 < 807");
test.assertRowCount(7);
- test.closeConnection();
+
}
}
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 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/OnWrapTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -23,6 +23,8 @@
import java.util.ArrayList;
+import org.junit.Ignore;
+import org.junit.Test;
import org.teiid.jdbc.AbstractQueryTest;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.ConfigPropertyNames.TXN_AUTO_WRAP_OPTIONS;
@@ -36,9 +38,6 @@
*/
public class OnWrapTransactionTests extends CommonTransactionTests {
- public OnWrapTransactionTests(String testName) {
- super(testName);
- }
@Override
protected TransactionContainer getTransactionContainter() {
@@ -49,6 +48,7 @@
* Sources = 1 Commands = multiple Success Batching = Full Processing,
* Single Connector Batch result = rollback
*/
+ @Test
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback()
throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest(
@@ -82,13 +82,13 @@
test.assertRowCount(10);
test.execute("select * from g2 where e1 = 9999");
test.assertRowCount(0);
- test.closeConnection();
}
/**
* Sources = 1 Commands = multiple Success Batching = Full Processing,
* Single Connector Batch result = rollback
*/
+ @Test
public void testSingleSourceBatchCommandReferentialIntegrityRollback()
throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest(
@@ -120,26 +120,25 @@
test.assertRowCount(0);
test.execute("select * from g2 where e1 = 9999");
test.assertRowCount(0);
- test.closeConnection();
}
/**
* Sources = 2 Commands = 1, Update Batching = Full Processing, Single
* Connector Batch result = commit
*/
+ @Test
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest(
"testMultipleSourceBulkRowInsertRollback") {
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
+ @Override
public void testCase() throws Exception {
for (int i = 100; i < 110; i++) {
- list
- .add("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values("
+ list.add("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values("
+ i + ",'" + i + "'," + i + ",'" + i + "')");
}
- list
- .add("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 >= 100");
+ list.add("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 >= 100");
// force the rollback by trying to insert an invalid row.
list.add("insert into pm1.g2 (e1, e2) values(9999,'9999')");
@@ -147,6 +146,7 @@
executeBatch((String[]) list.toArray(new String[list.size()]));
}
+ @Override
public boolean exceptionExpected() {
return true;
}
@@ -159,13 +159,19 @@
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 100 and e1 < 110");
test.assertRowCount(0);
- test.closeConnection();
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 100 and e1 < 110");
test.assertRowCount(0);
test.execute("select * from g2 where e1 >= 100 and e1 < 110");
test.assertRowCount(0);
- test.closeConnection();
}
+
+ @Ignore
+ @Test
+ @Override
+ public void testMultipleSourceTimeout() throws Exception{
+
+ }
+
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/StandaloneGlobalTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/StandaloneGlobalTransactionTests.java 2010-06-10 04:22:03 UTC (rev 2213)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/StandaloneGlobalTransactionTests.java 2010-06-10 16:23:19 UTC (rev 2214)
@@ -4,6 +4,13 @@
*/
package org.teiid.test.testcases;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.teiid.test.framework.ConfigPropertyNames;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.transaction.StandaloneGlobalTransaction;
@@ -13,16 +20,46 @@
* in places like inside app server
*/
public class StandaloneGlobalTransactionTests extends LocalTransactionTests {
+
+ private static Properties SYS_PROPS;
+
+ @BeforeClass
+ public static void beforeAll() throws Exception {
+ SYS_PROPS = (Properties) System.getProperties().clone();
+
+ System.setProperty(ConfigPropertyNames.CONFIG_FILE, "xa-config.properties");
- public StandaloneGlobalTransactionTests(String testName) {
- super(testName);
}
@Override
+ @Before
+ public void beforeEach() throws Exception {
+ super.beforeEach();
+ }
+
+ @Override
+ @After
+ public void afterEach() throws Exception {
+ super.afterEach();
+
+ }
+
+
+ @Override
protected TransactionContainer getTransactionContainter() {
return new StandaloneGlobalTransaction();
}
+
+ @AfterClass
+ public static void afterAll() {
+
+ System.setProperties(SYS_PROPS);
+ }
+
+
+
+
}
14 years, 6 months
teiid SVN: r2213 - in trunk: common-core/src/test/java/org/teiid/core/types and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-10 00:22:03 -0400 (Thu, 10 Jun 2010)
New Revision: 2213
Removed:
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java
Modified:
trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java
Log:
fixing setting the length prior to serialization for blob/clob types
Modified: trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-06-10 04:01:14 UTC (rev 2212)
+++ trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-06-10 04:22:03 UTC (rev 2213)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.ObjectOutput;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.SQLException;
@@ -142,12 +143,13 @@
}
}
- private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
try {
length();
} catch (SQLException e) {
}
- out.defaultWriteObject();
+ super.writeExternal(out);
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-06-10 04:01:14 UTC (rev 2212)
+++ trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-06-10 04:22:03 UTC (rev 2213)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.ObjectOutput;
import java.io.OutputStream;
import java.io.Reader;
import java.io.StringWriter;
@@ -217,12 +218,13 @@
}
}
- private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
try {
length();
} catch (SQLException e) {
}
- out.defaultWriteObject();
+ super.writeExternal(out);
}
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java 2010-06-10 04:01:14 UTC (rev 2212)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java 2010-06-10 04:22:03 UTC (rev 2213)
@@ -65,6 +65,8 @@
// now read back the object from serilized state
ObjectInputStream in = new ObjectInputStream(new FileInputStream(saved));
ClobType read = (ClobType)in.readObject();
+
+ assertTrue(read.length() > 0);
// make sure we have kept the reference stream id
assertEquals(key, read.getReferenceStreamId());
Deleted: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java 2010-06-10 04:01:14 UTC (rev 2212)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java 2010-06-10 04:22:03 UTC (rev 2213)
@@ -1,61 +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 org.teiid.jdbc;
-
-import static org.junit.Assert.*;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.Statement;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.teiid.jdbc.util.ResultSetUtil;
-@SuppressWarnings("nls")
-public class TestStuff {
-
- @Ignore
- @Test public void testNoExec() throws Exception {
- Connection c = DriverManager.getConnection("jdbc:teiid:tpcrperf@mm://localhost:31000", "admin", "teiid");
- Statement s = c.createStatement();
- long start = System.currentTimeMillis();
- //s.execute("set noexec on");
- s.execute("set showplan debug");
- DatabaseMetaData dmd = c.getMetaData();
-
- //ResultSetUtil.printResultSet(s.executeQuery("select * from TPCR01_OraclePhys.NATION"), 20, false, System.out);
- ResultSetUtil.printResultSet(s.executeQuery("select * from tables"), 20, false, System.out);
-
- //ResultSet rs = s.executeQuery("SELECT ORDERS.O_ORDERKEY, ORDERS.O_ORDERDATE, ORDERS.O_CLERK, CUSTOMER.C_CUSTKEY, CUSTOMER.C_NAME FROM TPCR01_SqlServerVirt.TPCR01.ORDERS,TPCR01_SqlServerVirt.TPCR01.CUSTOMER WHERE (CUSTOMER.C_CUSTKEY = ORDERS.O_CUSTKEY) AND (O_ORDERKEY < 2)");
- System.out.println(System.currentTimeMillis() - start);
-
- System.out.println(s.unwrap(TeiidStatement.class).getDebugLog());
- System.out.println(s.unwrap(TeiidStatement.class).getPlanDescription());
- s.close();
- c.close();
- }
-
-
-}
14 years, 6 months
teiid SVN: r2212 - in trunk: api/src/main/java/org/teiid/logging and 65 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-10 00:01:14 -0400 (Thu, 10 Jun 2010)
New Revision: 2212
Added:
trunk/api/src/main/java/org/teiid/translator/WSConnection.java
trunk/connectors/connector-file/src/main/resources/org/
trunk/connectors/connector-file/src/main/resources/org/teiid/
trunk/connectors/connector-file/src/main/resources/org/teiid/resource/
trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/
trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/
trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
trunk/connectors/connector-ws/src/main/resources/org/
trunk/connectors/connector-ws/src/main/resources/org/teiid/
trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/
trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/
trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/
trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
trunk/connectors/translator-ws/
trunk/connectors/translator-ws/pom.xml
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java
trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/ws/
trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/ws/i18n.properties
trunk/documentation/client-developers-guide/
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/client-developers-guide/src/
trunk/documentation/client-developers-guide/src/main/
trunk/documentation/client-developers-guide/src/main/docbook/
trunk/documentation/client-developers-guide/src/main/docbook/en-US/
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml
trunk/engine/src/main/java/org/teiid/query/sql/symbol/QueryString.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java
trunk/test-integration/db/src/test/java/com/
Removed:
trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java
trunk/connectors/translator-ws/pom.xml
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/xml/
trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/xml/
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestElementCollector.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/file/
trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/streaming/
trunk/connectors/translator-ws/src/test/resources/BookCollection.xml
trunk/connectors/translator-ws/src/test/resources/cis.vdb
trunk/connectors/translator-ws/src/test/resources/documents/
trunk/connectors/translator-ws/src/test/resources/xmltest.vdb
trunk/connectors/translator-xml/
Modified:
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/api/src/main/java/org/teiid/logging/LogConstants.java
trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/build/assembly/jboss-container/dist.xml
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/CompactObjectInputStream.java
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
trunk/common-core/src/main/java/org/teiid/core/TeiidException.java
trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java
trunk/connectors/connector-ws/src/main/rar/META-INF/ra.xml
trunk/connectors/pom.xml
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java
trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLAttributes.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLForest.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLSerialize.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/ExpressionMappingVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/PathMapFilter.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
trunk/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
trunk/engine/src/test/java/org/teiid/query/rewriter/TestOrderByRewrite.java
trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-1114 converting translator-xml to translator-ws with a flexible invoke procedure. anding xml name escaping and more validation. also minor cleanups to javadocs
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -82,6 +82,8 @@
public static final String RETURNING = "RETURNING"; //$NON-NLS-1$
public static final String SEQUENCE = "SEQUENCE"; //$NON-NLS-1$
public static final String EMPTY = "EMPTY"; //$NON-NLS-1$
+
+ public static final String QUERYSTRING = "QUERYSTRING"; //$NON-NLS-1$
}
public interface Reserved {
Modified: trunk/api/src/main/java/org/teiid/logging/LogConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/logging/LogConstants.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/api/src/main/java/org/teiid/logging/LogConstants.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -41,4 +41,6 @@
public static final String CTX_QUERY_RESOLVER = CTX_QUERY_PLANNER + ".RESOLVER"; //$NON-NLS-1$
public static final String CTX_XML_PLANNER = CTX_QUERY_PLANNER + ".XML_PLANNER"; //$NON-NLS-1$
public static final String CTX_XML_PLAN = CTX_DQP + ".XML_PLAN"; //$NON-NLS-1$
+
+ public static final String CTX_WS = LogConstants.CTX_CONNECTOR + ".WS"; //$NON-NLS-1$
}
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -135,14 +135,14 @@
/**
* Get a item that has been placed previously from cache. If no such object then a null will be returned.
- * The item is placed in {@link CacheScope.REQUEST} scope.
+ * The item is placed in {@link CacheScope#REQUEST} scope.
* @param key
* @return
*/
Object get(Object key);
/**
- * Place a item in the Cache in {@link CacheScope.REQUEST} scope.
+ * Place a item in the Cache in {@link CacheScope#REQUEST} scope.
* @param key
* @param value
*/
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -162,6 +162,7 @@
} catch (ResourceException e) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Error closing"); //$NON-NLS-1$
}
+ return;
}
throw new AssertionError("A connection was created, but no implementation provided for closeConnection"); //$NON-NLS-1$
}
Added: trunk/api/src/main/java/org/teiid/translator/WSConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/WSConnection.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/WSConnection.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,78 @@
+/*
+ * 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 org.teiid.translator;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.resource.cci.Connection;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+
+/**
+ * Simple {@link Connection} interface for web services
+ */
+public interface WSConnection extends Connection {
+
+ <T> Dispatch<T> createDispatch(String binding, String endpoint, Class<T> type, Service.Mode mode);
+
+ public static class Util {
+
+ public static String appendQueryString(String endpoint, String param) {
+ return endpoint + (endpoint.indexOf('?') >= 0?'&':'?') + param;
+ }
+
+ public static String httpURLEncode(String s) {
+ try {
+ return URLEncoder.encode(s, "UTF-8").replaceAll("\\+", "%20"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void closeSource(final Source source) {
+ if (!(source instanceof StreamSource)) {
+ return;
+ }
+
+ StreamSource stream = (StreamSource)source;
+ try {
+ if (stream.getInputStream() != null) {
+ stream.getInputStream().close();
+ }
+ } catch (IOException e) {
+ }
+ try {
+ if (stream.getReader() != null) {
+ stream.getReader().close();
+ }
+ } catch (IOException e) {
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/api/src/main/java/org/teiid/translator/WSConnection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/assembly/jboss-container/dist.xml
===================================================================
--- trunk/build/assembly/jboss-container/dist.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/build/assembly/jboss-container/dist.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -90,7 +90,7 @@
<include>org.jboss.teiid.connectors:translator-salesforce</include>
<include>org.jboss.teiid.connectors:connector-salesforce:rar</include>
<include>org.jboss.teiid.connectors:connector-ws:rar</include>
- <include>org.jboss.teiid.connectors:translator-xml</include>
+ <include>org.jboss.teiid.connectors:translator-ws</include>
</includes>
<binaries>
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="DynamicPortfolio" version="1">
- <description>A VDB to test transactions</description>
+ <description>A Dynamic</description>
<!--
Setting to use connector supplied metadata. Can be "true" or "cached".
Modified: trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -148,7 +148,7 @@
Throwable result = null;
for (String className : classNames) {
try {
- result = (Throwable)ReflectionHelper.create(className, args, Thread.currentThread().getContextClassLoader());
+ result = (Throwable)ReflectionHelper.create(className, args, ExceptionHolder.class.getClassLoader());
result.setStackTrace(stackTrace);
break;
} catch (TeiidException e1) {
@@ -177,7 +177,7 @@
// only for top level we would have the contents as not null.
if (contents != null) {
ByteArrayInputStream bais = new ByteArrayInputStream(contents);
- ObjectInputStream ois = new ObjectInputStreamWithClassloader(bais, Thread.currentThread().getContextClassLoader());
+ ObjectInputStream ois = new ObjectInputStreamWithClassloader(bais, ExceptionHolder.class.getClassLoader());
try {
return (Throwable)ois.readObject();
} catch (ClassNotFoundException e) {
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -208,7 +208,7 @@
public static KeyStore loadKeyStore(String name, String password, String type) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException {
// Check in the classpath
- InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
+ InputStream stream = SocketUtil.class.getClassLoader().getResourceAsStream(name);
if (stream == null) {
try {
stream = new FileInputStream(name);
Modified: trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/CompactObjectInputStream.java
===================================================================
--- trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/CompactObjectInputStream.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/CompactObjectInputStream.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -75,7 +75,7 @@
if (classLoader == null) {
clazz = Class.forName(
className, true,
- Thread.currentThread().getContextClassLoader());
+ CompactObjectInputStream.class.getClassLoader());
} else {
clazz = Class.forName(className, true, classLoader);
}
Modified: trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
===================================================================
--- trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -33,8 +33,7 @@
/**
- * An {@link ObjectOutput} which is interoperable with {@link ObjectDecoder}
- * and {@link ObjectDecoderInputStream}.
+ * An {@link ObjectOutput} which is interoperable with {@link ObjectDecoderInputStream}.
*
* @author The Netty Project (netty-dev(a)lists.jboss.org)
* @author Trustin Lee (tlee(a)redhat.com)
Modified: trunk/common-core/src/main/java/org/teiid/core/TeiidException.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/TeiidException.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/common-core/src/main/java/org/teiid/core/TeiidException.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -154,7 +154,8 @@
* Get the exception which is linked to this exception.
*
* @return The linked exception
- * @deprecated - {@see #getCause()}
+ * @see #getCause()
+ * @deprecated
*/
public Throwable getChild() {
return super.getCause();
Modified: trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -24,6 +24,7 @@
import javax.resource.ResourceException;
import javax.resource.spi.InvalidPropertyException;
+import org.teiid.core.BundleUtil;
import org.teiid.resource.spi.BasicConnection;
import org.teiid.resource.spi.BasicConnectionFactory;
import org.teiid.resource.spi.BasicManagedConnectionFactory;
@@ -31,13 +32,14 @@
public class FileManagedConnectionFactory extends BasicManagedConnectionFactory{
private static final long serialVersionUID = -1495488034205703625L;
+ public static final BundleUtil UTIL = BundleUtil.getBundleUtil(FileManagedConnectionFactory.class);
private String parentDirectory;
@Override
public Object createConnectionFactory() throws ResourceException {
if (this.parentDirectory == null) {
- throw new InvalidPropertyException("ParentDirectory is not set");
+ throw new InvalidPropertyException(UTIL.getString("parentdirectory_not_set")); //$NON-NLS-1$
}
return new BasicConnectionFactory() {
Added: trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
===================================================================
--- trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties (rev 0)
+++ trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+parentdirectory_not_set=ParentDirectory is not set
\ No newline at end of file
Property changes on: trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java
===================================================================
--- trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,203 +0,0 @@
-package org.teiid.resource.adapter.ws;
-
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Future;
-
-import javax.resource.ResourceException;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.Response;
-import javax.xml.ws.Service;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.ws.core.ConfigProvider;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.resource.adapter.ws.WSManagedConnectionFactory.InvocationType;
-import org.teiid.resource.spi.BasicConnection;
-
-public class WSConnection extends BasicConnection implements Dispatch<Source>{
- private static QName svcQname = new QName("http://teiid.org", "teiid"); //$NON-NLS-1$ //$NON-NLS-2$
- private static QName portQName = new QName("http://teiid.org", "teiid");//$NON-NLS-1$ //$NON-NLS-2$
-
- private Dispatch<Source> delegate;
- private WSManagedConnectionFactory mcf;
-
- public WSConnection(WSManagedConnectionFactory mcf) {
- this.mcf = mcf;
- createDelegate();
- }
-
- private void createDelegate() {
- if (mcf.getInvocationType() == WSManagedConnectionFactory.InvocationType.HTTP_GET) {
- this.delegate = createHTTPDispatch("GET"); //$NON-NLS-1$
- }
- else if (mcf.getInvocationType() == WSManagedConnectionFactory.InvocationType.HTTP_POST) {
- this.delegate = createHTTPDispatch("POST"); //$NON-NLS-1$
- } else {
- this.delegate = createSOAPDispatch();
- }
- }
-
- private Dispatch<Source> createHTTPDispatch(String requestMethod){
- Service svc = Service.create(svcQname);
- svc.addPort(portQName, HTTPBinding.HTTP_BINDING, mcf.getEndPoint());
-
- Dispatch<Source> dispatch = svc.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
- dispatch.getRequestContext().put(MessageContext.HTTP_REQUEST_METHOD, requestMethod);
- if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.HTTPBasic){
- dispatch.getRequestContext().put(Dispatch.USERNAME_PROPERTY, mcf.getAuthUserName());
- dispatch.getRequestContext().put(Dispatch.PASSWORD_PROPERTY, mcf.getAuthPassword());
- }
-
- Map<String, List<String>> httpHeaders = (Map<String, List<String>>)dispatch.getRequestContext().get(MessageContext.HTTP_REQUEST_HEADERS);
- if(httpHeaders == null) {
- httpHeaders = new HashMap<String, List<String>>();
- }
- httpHeaders.put("Content-Type", Collections.singletonList("text/xml; charset=utf-8"));//$NON-NLS-1$ //$NON-NLS-2$
- httpHeaders.put("User-Agent", Collections.singletonList("Teiid Server"));//$NON-NLS-1$ //$NON-NLS-2$
- dispatch.getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
-
- return dispatch;
- }
-
- private Dispatch<Source> createSOAPDispatch() {
- Service svc = Service.create(svcQname);
-
- svc.addPort(portQName, mcf.getInvocationType() == InvocationType.SOAP11 ? SOAPBinding.SOAP11HTTP_BINDING : SOAPBinding.SOAP12HTTP_BINDING, mcf.getEndPoint());
-
- Dispatch<Source> dispatch = svc.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
- if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.WSSecurity) {
- // JBoss WS-Security
- ((ConfigProvider) this.delegate).setSecurityConfig(mcf.getWsSecurityConfigURL());
- ((ConfigProvider) delegate).setConfigName(mcf.getWsSecurityConfigName());
- }
- return dispatch;
- }
-
- public Binding getBinding() {
- return delegate.getBinding();
- }
-
- public EndpointReference getEndpointReference() {
- return delegate.getEndpointReference();
- }
-
- public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
- return delegate.getEndpointReference(clazz);
- }
-
- public Map<String, Object> getRequestContext() {
- return delegate.getRequestContext();
- }
-
- public Map<String, Object> getResponseContext() {
- return delegate.getResponseContext();
- }
-
-
- /**
- * NOTE: the source msg from the teiid translator going to be SOAP. If execution is different from
- * soap then fix it now.
- */
- @Override
- public Source invoke(Source msg) {
-
- String xmlPayload = null;
- Map<String, Object> map = (Map)getRequestContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
- if (map != null) {
- xmlPayload = (String)map.remove("xml"); //$NON-NLS-1$
- }
-
- if (this.mcf.getInvocationType() == WSManagedConnectionFactory.InvocationType.HTTP_GET) {
- if (this.mcf.getXMLParamName() != null) {
- if (xmlPayload != null) {
- try {
- getRequestContext().put(MessageContext.QUERY_STRING, this.mcf.getXMLParamName()+"="+URLEncoder.encode(xmlPayload, "UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- } else {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "XML Param specified, but no request document was generated."); //$NON-NLS-1$
- }
- }
- else if (getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) == null) {
-
- String path = (String)getRequestContext().get(MessageContext.PATH_INFO);
- String queryString = (String)getRequestContext().get(MessageContext.QUERY_STRING);
- String url = this.mcf.getEndPoint();
- if (path != null) {
- url = url + "/" + path; //$NON-NLS-1$
- }
- if (queryString != null) {
- url = url + "?" + queryString; //$NON-NLS-1$
- }
- getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
- }
- msg = null;
- }
- else if (this.mcf.getInvocationType() == WSManagedConnectionFactory.InvocationType.HTTP_POST) {
- getRequestContext().put(MessageContext.QUERY_STRING, ""); //$NON-NLS-1$
- if (xmlPayload != null) {
- msg = new StreamSource(new StringReader(xmlPayload));
- }
- else {
- msg = null;
- }
- }
- else {
- // JBossWS native adds the null based address property somewhere and results in error if this
- // is corrected
- if (getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) == null) {
- getRequestContext().remove(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- }
- }
-
- if (msg == null) {
- // JBoss Native DispatchImpl throws exception when the source is null
- msg = new StreamSource(new StringReader("<none/>")); //$NON-NLS-1$
- }
- return delegate.invoke(msg);
- }
-
- @Override
- public Future invokeAsync(Source msg, AsyncHandler<Source> handler) {
- return delegate.invokeAsync(msg, handler);
- }
-
- @Override
- public Response<Source> invokeAsync(Source msg) {
- return delegate.invokeAsync(msg);
- }
-
- @Override
- public void invokeOneWay(Source msg) {
- delegate.invokeOneWay(msg);
- }
-
- @Override
- public void close() throws ResourceException {
- this.delegate = null;
- }
-
- @Override
- public void cleanUp() {
- //recreate to ensure the proper state
- //this isn't really a heavy-weight operation
- createDelegate();
- }
-}
Added: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
===================================================================
--- trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java (rev 0)
+++ trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,112 @@
+package org.teiid.resource.adapter.ws;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.resource.ResourceException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.ws.core.ConfigProvider;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
+import org.teiid.resource.spi.BasicConnection;
+import org.teiid.translator.WSConnection;
+
+/**
+ * WebService connection implementation.
+ *
+ * TODO: set a handler chain
+ */
+public class WSConnectionImpl extends BasicConnection implements WSConnection {
+ private static QName svcQname = new QName("http://teiid.org", "teiid"); //$NON-NLS-1$ //$NON-NLS-2$
+ private static QName portQName = new QName("http://teiid.org", "teiid");//$NON-NLS-1$ //$NON-NLS-2$
+
+ private WSManagedConnectionFactory mcf;
+
+ public WSConnectionImpl(WSManagedConnectionFactory mcf) {
+ this.mcf = mcf;
+ }
+
+ public <T> Dispatch<T> createDispatch(String binding, String endpoint, Class<T> type, Mode mode) {
+ Service svc = Service.create(svcQname);
+ if (endpoint != null) {
+ try {
+ new URL(endpoint);
+ //valid url, just use the endpoint
+ } catch (MalformedURLException e) {
+ //otherwise it should be a relative value
+ //but we should still preserve the base path and query string
+ String defaultEndpoint = mcf.getEndPoint();
+ String defaultQueryString = null;
+ String defaultFragment = null;
+ String[] parts = defaultEndpoint.split("\\?", 2); //$NON-NLS-1$
+ defaultEndpoint = parts[0];
+ if (parts.length > 1) {
+ defaultQueryString = parts[1];
+ parts = defaultQueryString.split("#"); //$NON-NLS-1$
+ defaultQueryString = parts[0];
+ if (parts.length > 1) {
+ defaultFragment = parts[1];
+ }
+ }
+ if (endpoint.startsWith("?") || endpoint.startsWith("/")) { //$NON-NLS-1$ //$NON-NLS-2$
+ endpoint = defaultEndpoint + endpoint;
+ } else {
+ endpoint = defaultEndpoint + "/" + endpoint; //$NON-NLS-1$
+ }
+ if (defaultQueryString != null && defaultQueryString.trim().length() > 0) {
+ endpoint = WSConnection.Util.appendQueryString(endpoint, defaultQueryString);
+ }
+ if (defaultFragment != null && endpoint.indexOf('#') < 0) {
+ endpoint = endpoint + '#' + defaultFragment;
+ }
+ }
+ } else {
+ endpoint = mcf.getEndPoint();
+ }
+
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_WS, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_WS, "Creating a dispatch with endpoint", endpoint); //$NON-NLS-1$
+ }
+
+ svc.addPort(portQName, binding, endpoint);
+
+ Dispatch<T> dispatch = svc.createDispatch(portQName, type, mode);
+
+ if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.HTTPBasic){
+ dispatch.getRequestContext().put(Dispatch.USERNAME_PROPERTY, mcf.getAuthUserName());
+ dispatch.getRequestContext().put(Dispatch.PASSWORD_PROPERTY, mcf.getAuthPassword());
+ }
+
+ if (HTTPBinding.HTTP_BINDING.equals(binding)) {
+ Map<String, List<String>> httpHeaders = (Map<String, List<String>>)dispatch.getRequestContext().get(MessageContext.HTTP_REQUEST_HEADERS);
+ if(httpHeaders == null) {
+ httpHeaders = new HashMap<String, List<String>>();
+ }
+ httpHeaders.put("Content-Type", Collections.singletonList("text/xml; charset=utf-8"));//$NON-NLS-1$ //$NON-NLS-2$
+ httpHeaders.put("User-Agent", Collections.singletonList("Teiid Server"));//$NON-NLS-1$ //$NON-NLS-2$
+ dispatch.getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
+ } else if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.WSSecurity) {
+ // JBoss WS-Security
+ ((ConfigProvider) dispatch).setSecurityConfig(mcf.getWsSecurityConfigURL());
+ ((ConfigProvider) dispatch).setConfigName(mcf.getWsSecurityConfigName());
+ }
+ return dispatch;
+ }
+
+ @Override
+ public void close() throws ResourceException {
+
+ }
+
+}
Property changes on: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -23,6 +23,7 @@
import javax.resource.ResourceException;
+import org.teiid.core.BundleUtil;
import org.teiid.resource.spi.BasicConnection;
import org.teiid.resource.spi.BasicConnectionFactory;
import org.teiid.resource.spi.BasicManagedConnectionFactory;
@@ -30,38 +31,28 @@
public class WSManagedConnectionFactory extends BasicManagedConnectionFactory {
private static final long serialVersionUID = -2998163922934555003L;
+
+ public static final BundleUtil UTIL = BundleUtil.getBundleUtil(WSManagedConnectionFactory.class);
- public enum InvocationType {HTTP_GET, HTTP_POST, SOAP11, SOAP12};
public enum SecurityType {None,HTTPBasic,WSSecurity}
- private String invocationType = InvocationType.SOAP12.name();
private String endPoint;
-
private String securityType = SecurityType.None.name(); // None, HTTPBasic, WS-Security
private String wsSecurityConfigURL; // path to the "jboss-wsse-client.xml" file
private String wsSecurityConfigName; // ws-security config name in the above file
private String authPassword; // httpbasic - password
private String authUserName; // httpbasic - username
- private String xmlParamName; // used only in the http get invocation
@Override
- public Object createConnectionFactory() throws ResourceException {
+ public BasicConnectionFactory createConnectionFactory() throws ResourceException {
return new BasicConnectionFactory() {
@Override
public BasicConnection getConnection() throws ResourceException {
- return new WSConnection(WSManagedConnectionFactory.this);
+ return new WSConnectionImpl(WSManagedConnectionFactory.this);
}
};
}
- public InvocationType getInvocationType() {
- return InvocationType.valueOf(invocationType);
- }
-
- public void setInvocationType(String invocationType) {
- this.invocationType = invocationType;
- }
-
public String getAuthPassword() {
return this.authPassword;
}
@@ -110,11 +101,4 @@
this.wsSecurityConfigName = wsSecurityConfigName;
}
- public String getXMLParamName() {
- return xmlParamName;
- }
-
- public void setXMLParamName(String xMLParamName) {
- this.xmlParamName = xMLParamName;
- }
}
Modified: trunk/connectors/connector-ws/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-ws/src/main/rar/META-INF/ra.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/connector-ws/src/main/rar/META-INF/ra.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -7,7 +7,7 @@
version="1.5">
<vendor-name>Red Hat Middleware LLC</vendor-name>
- <eis-type>Teiid XML SOAP Connector</eis-type>
+ <eis-type>Teiid WS Connector</eis-type>
<resourceadapter-version>1.0</resourceadapter-version>
<license>
<description>
@@ -41,13 +41,6 @@
<managedconnectionfactory-class>org.teiid.resource.adapter.ws.WSManagedConnectionFactory</managedconnectionfactory-class>
<config-property>
- <description>{$display:"Invocation Type",$description:"Service Invocation type (HTTP or SOAP)", $allowed="HTTP_GET, HTTP_POST, SOAP11, SOAP12", $required="true", $defaultValue="SOAP12"}</description>
- <config-property-name>InvocationType</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>SOAP12</config-property-value>
- </config-property>
-
- <config-property>
<description>{$display:"URL, End Point",$description:"URL for HTTP, Service Endpoint for SOAP",$required="true"}</description>
<config-property-name>EndPoint</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -83,12 +76,6 @@
<config-property-name>WsSecurityConfigName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
-
- <config-property>
- <description>{$display:"XML Parameter Name", $description="only required for HTTP_GET with an XML based request"}</description>
- <config-property-name>XMLParamName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- </config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>org.teiid.resource.spi.WrappedConnectionFactory</connectionfactory-impl-class>
Added: trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
===================================================================
--- trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties (rev 0)
+++ trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
Property changes on: trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/pom.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -90,11 +90,6 @@
<module>sandbox</module>
- <module>translator-xml</module>
- <!--
- <module>connector-xml-file</module>
- <module>connector-xml-soap</module>
- <module>connector-xml-http</module>
- -->
+ <module>translator-ws</module>
</modules>
</project>
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/LocateFunctionModifier.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -78,8 +78,7 @@
private boolean sourceStringFirst;
/**
- * Constructs a {@link BasicFunctionModifier} object that can be used to
- * translate the scalar function LOCATE() to a source specific scalar
+ * Translates the scalar function LOCATE() to a source specific scalar
* function or expression.
*
* @param langFactory the language factory associated with translation
@@ -89,8 +88,7 @@
}
/**
- * Constructs a {@link BasicFunctionModifier} object that can be used to
- * translate the scalar function LOCATE() to a source specific scalar
+ * Translates the scalar function LOCATE() to a source specific scalar
* function or expression.
*
* @param langFactory the language factory associated with translation
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -164,8 +164,8 @@
Command command = tu.parseCommand("select max(x) from bar"); //$NON-NLS-1$
TranslationHelper.helpTestVisitor("SELECT MAX(cast(bar.x as char(36))) FROM bar", trans, command); //$NON-NLS-1$
- command = tu.parseCommand("select * from (select max(x) from bar) x"); //$NON-NLS-1$
- TranslationHelper.helpTestVisitor("SELECT x.MAX FROM (SELECT MAX(cast(bar.x as char(36))) FROM bar) x", trans, command); //$NON-NLS-1$
+ command = tu.parseCommand("select * from (select max(x) as max from bar) x"); //$NON-NLS-1$
+ TranslationHelper.helpTestVisitor("SELECT x.max FROM (SELECT MAX(cast(bar.x as char(36))) AS max FROM bar) x", trans, command); //$NON-NLS-1$
}
}
Copied: trunk/connectors/translator-ws (from rev 2192, trunk/connectors/translator-xml)
Deleted: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-xml/pom.xml 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/pom.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-xml</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>XML Translator</name>
- <description>This translator consumes the XML documents from Web
- service and transforms the document into a relational structure.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jdom</groupId>
- <artifactId>jdom</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- <version>1.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>nux</groupId>
- <artifactId>nux</artifactId>
- <version>1.6</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-
-</project>
Copied: trunk/connectors/translator-ws/pom.xml (from rev 2202, trunk/connectors/translator-xml/pom.xml)
===================================================================
--- trunk/connectors/translator-ws/pom.xml (rev 0)
+++ trunk/connectors/translator-ws/pom.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-ws</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Web ervice Translator</name>
+ <description>This translator provides access to Web Services.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
Copied: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws (from rev 2202, trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws)
Deleted: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java 2010-06-08 19:11:59 UTC (rev 2202)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,29 +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 org.teiid.translator.ws;
-
-import org.xml.sax.XMLFilter;
-
-public interface SAXFilterProvider {
- XMLFilter[] getExtendedFilters();
-}
Copied: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java (from rev 2202, trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java)
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,112 @@
+/*
+ * 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 org.teiid.translator.ws;
+
+import java.sql.SQLXML;
+import java.util.Collections;
+import java.util.List;
+
+import javax.resource.cci.ConnectionFactory;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service.Mode;
+
+import org.teiid.core.BundleUtil;
+import org.teiid.language.Call;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.Procedure;
+import org.teiid.metadata.ProcedureParameter;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.metadata.BaseColumn.NullType;
+import org.teiid.metadata.ProcedureParameter.Type;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TranslatorProperty;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.WSConnection;
+
+@Translator(name="ws")
+public class WSExecutionFactory extends ExecutionFactory<ConnectionFactory, WSConnection> {
+
+ public static BundleUtil UTIL = BundleUtil.getBundleUtil(WSExecutionFactory.class);
+
+ private Mode defaultServiceMode = Mode.PAYLOAD;
+ private String xmlParamName;
+
+ @TranslatorProperty(description="Contols request/response message wrapping - set to MESSAGE for full control over SOAP messages.", display="Default Service Mode")
+ public Mode getDefaultServiceMode() {
+ return defaultServiceMode;
+ }
+
+ public void setDefaultServiceMode(Mode mode) {
+ this.defaultServiceMode = mode;
+ }
+
+ public String getXmlParamName() {
+ return xmlParamName;
+ }
+
+ public void setXmlParamName(String xmlParamName) {
+ this.xmlParamName = xmlParamName;
+ }
+
+ @Override
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection)
+ throws TranslatorException {
+ return new WSProcedureExecution(command, metadata, executionContext, this, connection);
+ }
+
+ public SQLXML convertToXMLType(Source value) {
+ return (SQLXML)getTypeFacility().convertToRuntimeType(value);
+ }
+
+ @Override
+ public final List getSupportedFunctions() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public void getMetadata(MetadataFactory metadataFactory,
+ WSConnection conn) throws TranslatorException {
+ Procedure p = metadataFactory.addProcedure("invoke"); //$NON-NLS-1$
+
+ //can be one of HTTP, SOAP11, SOAP12
+ ProcedureParameter param = metadataFactory.addProcedureParameter("style", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+
+ param = metadataFactory.addProcedureParameter("action", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+
+ //can be one of string, xml, clob
+ param = metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+
+ param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+
+ metadataFactory.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.XML, Type.ReturnValue, p); //$NON-NLS-1$
+ }
+
+}
Copied: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java (from rev 2202, trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java)
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java (rev 0)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,209 @@
+/*
+ * 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 org.teiid.translator.ws;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.sql.Clob;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.teiid.core.types.ClobType;
+import org.teiid.language.Argument;
+import org.teiid.language.Call;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.translator.DataNotAvailableException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.WSConnection;
+import org.teiid.translator.WSConnection.Util;
+
+/**
+ * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
+ */
+public class WSProcedureExecution implements ProcedureExecution {
+
+ public enum InvocationType {
+ HTTP(HTTPBinding.HTTP_BINDING),
+ SOAP11(SOAPBinding.SOAP11HTTP_BINDING),
+ SOAP12(SOAPBinding.SOAP12HTTP_BINDING);
+
+ private String bindingId;
+
+ private InvocationType(String bindingId) {
+ this.bindingId = bindingId;
+ }
+
+ public String getBindingId() {
+ return bindingId;
+ }
+ };
+
+ RuntimeMetadata metadata;
+ ExecutionContext context;
+ private Call procedure;
+ private SQLXML returnValue;
+ private WSConnection conn;
+ private WSExecutionFactory executionFactory;
+
+ /**
+ * @param env
+ */
+ public WSProcedureExecution(Call procedure, RuntimeMetadata metadata, ExecutionContext context, WSExecutionFactory executionFactory, WSConnection conn) {
+ this.metadata = metadata;
+ this.context = context;
+ this.procedure = procedure;
+ this.conn = conn;
+ this.executionFactory = executionFactory;
+ }
+
+ public void execute() throws TranslatorException {
+ List<Argument> arguments = this.procedure.getArguments();
+
+ String style = (String)arguments.get(0).getArgumentValue().getValue();
+ String action = (String)arguments.get(1).getArgumentValue().getValue();
+ Object docObject = arguments.get(2).getArgumentValue().getValue();
+ Source source = null;
+ try {
+ if (docObject instanceof SQLXML) {
+ SQLXML xml = (SQLXML)docObject;
+ source = xml.getSource(null);
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_WS, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + xml.getString()); //$NON-NLS-1$
+ }
+ } else if (docObject instanceof Clob) {
+ Clob clob = (Clob)docObject;
+ source = new StreamSource(clob.getCharacterStream());
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_WS, MessageLevel.DETAIL)) {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "WebService Request: " + ClobType.getString(clob)); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+ }
+ } else if (docObject instanceof String) {
+ String string = (String)docObject;
+ source = new StreamSource(new StringReader(string));
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_WS, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + string); //$NON-NLS-1$
+ }
+ } else if (docObject != null) {
+ throw new TranslatorException(WSExecutionFactory.UTIL.getString("unknown_doc_type")); //$NON-NLS-1$
+ }
+ String endpoint = (String)arguments.get(3).getArgumentValue().getValue();
+
+ if (style == null) {
+ style = InvocationType.SOAP12.getBindingId();
+ } else {
+ try {
+ InvocationType type = InvocationType.valueOf(style.toUpperCase());
+ style = type.getBindingId();
+ } catch (IllegalArgumentException e) {
+ throw new TranslatorException(WSExecutionFactory.UTIL.getString("invalid_invocation", Arrays.toString(InvocationType.values()))); //$NON-NLS-1$
+ }
+ }
+
+ Dispatch<Source> dispatch = conn.createDispatch(style, endpoint, Source.class, executionFactory.getDefaultServiceMode());
+
+ if (InvocationType.HTTP.getBindingId().equals(style)) {
+ if (action == null) {
+ action = "POST"; //$NON-NLS-1$
+ }
+ dispatch.getRequestContext().put(MessageContext.HTTP_REQUEST_METHOD, action);
+ if (source != null && !"POST".equalsIgnoreCase(action)) { //$NON-NLS-1$
+ if (this.executionFactory.getXmlParamName() == null) {
+ throw new WebServiceException(WSExecutionFactory.UTIL.getString("http_usage_error")); //$NON-NLS-1$
+ }
+ try {
+ Transformer t = TransformerFactory.newInstance().newTransformer();
+ StringWriter writer = new StringWriter();
+ //TODO: prevent this from being too large
+ t.transform(source, new StreamResult(writer));
+ String param = Util.httpURLEncode(this.executionFactory.getXmlParamName())+"="+Util.httpURLEncode(writer.toString()); //$NON-NLS-1$
+ endpoint = WSConnection.Util.appendQueryString(endpoint, param);
+ } catch (TransformerException e) {
+ throw new WebServiceException(e);
+ }
+ }
+ } else {
+ if (action != null) {
+ dispatch.getRequestContext().put(Dispatch.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+ dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, action);
+ }
+ }
+
+ if (source == null) {
+ // JBoss Native DispatchImpl throws exception when the source is null
+ source = new StreamSource(new StringReader("<none/>")); //$NON-NLS-1$
+ }
+ Source result = dispatch.invoke(source);
+ this.returnValue = this.executionFactory.convertToXMLType(result);
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_WS, MessageLevel.DETAIL)) {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "WebService Response: " + this.returnValue.getString()); //$NON-NLS-1$
+ } catch (SQLException e) {
+ }
+ }
+ } catch (SQLException e) {
+ throw new TranslatorException(e);
+ } finally {
+ Util.closeSource(source);
+ }
+ }
+
+ @Override
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
+ return null;
+ }
+
+ @Override
+ public List<?> getOutputParameterValues() throws TranslatorException {
+ return Arrays.asList(returnValue);
+ }
+
+ public void close() {
+
+ }
+
+ public void cancel() throws TranslatorException {
+ // no-op
+ }
+}
Deleted: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,145 +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 org.teiid.translator.ws;
-
-import java.sql.SQLXML;
-import java.util.Collections;
-import java.util.List;
-
-import javax.resource.cci.ConnectionFactory;
-import javax.xml.transform.Source;
-import javax.xml.ws.Dispatch;
-
-import org.teiid.core.BundleUtil;
-import org.teiid.language.Call;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.logging.MessageLevel;
-import org.teiid.metadata.MetadataFactory;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.ProcedureParameter;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.metadata.BaseColumn.NullType;
-import org.teiid.metadata.ProcedureParameter.Type;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.ExecutionFactory;
-import org.teiid.translator.ProcedureExecution;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TranslatorProperty;
-import org.teiid.translator.TypeFacility;
-
-@Translator(name="ws")
-public class XMLExecutionFactory extends ExecutionFactory<ConnectionFactory, Dispatch<Source>> {
-
- public static BundleUtil UTIL = BundleUtil.getBundleUtil(XMLExecutionFactory.class);
-
- private String saxFilterProviderClass;
- private String encoding = "ISO-8859-1"; //$NON-NLS-1$
- private boolean logRequestResponseDocs = false;
-
- @TranslatorProperty(description="Encoding of the XML documents", display="Encoding Scheme")
- public String getCharacterEncodingScheme() {
- return this.encoding;
- }
-
- public void setCharacterEncodingScheme(String encoding) {
- this.encoding = encoding;
- }
-
- @TranslatorProperty(description="Must be extension of org.teiid.translator.xml.SAXFilterProvider class", display="SAX Filter Provider Class")
- public String getSaxFilterProviderClass() {
- return this.saxFilterProviderClass;
- }
-
- public void setSaxFilterProviderClass(String saxFilterProviderClass) {
- this.saxFilterProviderClass = saxFilterProviderClass;
- }
-
- // Can we get rid of this?
- private String inputStreamFilterClass;
-
- public String getInputStreamFilterClass() {
- return this.inputStreamFilterClass;
- }
-
- public void setInputStreamFilterClass(String inputStreamFilterClass) {
- this.inputStreamFilterClass = inputStreamFilterClass;
- }
-
- @TranslatorProperty(description="Log the XML request/response documents", display="Log Request/Response Documents")
- public boolean isLogRequestResponseDocs() {
- return logRequestResponseDocs && LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL);
- }
-
- public void setLogRequestResponseDocs(boolean logRequestResponseDocs) {
- this.logRequestResponseDocs = logRequestResponseDocs;
- }
-
- @Override
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Dispatch<Source> connection)
- throws TranslatorException {
- return new XMLProcedureExecution(command, metadata, executionContext, this, connection);
- }
-
- public SAXFilterProvider getSaxFilterProvider() throws TranslatorException {
- if (getSaxFilterProviderClass() == null) {
- return null;
- }
- return getInstance(SAXFilterProvider.class, getSaxFilterProviderClass(), null, null);
- }
-
- public SQLXML convertToXMLType(Source value) {
- /*XMLReader reader = XMLReaderFactory.createXMLReader();
-
- if (getSaxFilterProvider() != null) {
- XMLFilter[] filters = getSaxFilterProvider().getExtendedFilters();
- for(int i = 0; i < filters.length; i++) {
- XMLFilter filter = filters[i];
- filter.setParent(reader);
- reader = filter;
- }
- }
-
- SAXSource saxSource = new SAXSource(reader, inputSource);*/
-
- return (SQLXML)getTypeFacility().convertToRuntimeType(value);
- }
-
- @Override
- public final List getSupportedFunctions() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public void getMetadata(MetadataFactory metadataFactory,
- Dispatch<Source> conn) throws TranslatorException {
- Procedure p = metadataFactory.addProcedure("invoke"); //$NON-NLS-1$
- metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
- ProcedureParameter param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setNullType(NullType.Nullable);
- param = metadataFactory.addProcedureParameter("soapaction", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setNullType(NullType.Nullable);
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,154 +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 org.teiid.translator.ws;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.sql.Clob;
-import java.sql.SQLException;
-import java.sql.SQLXML;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.Dispatch;
-
-import org.teiid.core.types.ClobType;
-import org.teiid.language.Argument;
-import org.teiid.language.Call;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.DataNotAvailableException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.ProcedureExecution;
-import org.teiid.translator.TranslatorException;
-
-/**
- * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
- */
-public class XMLProcedureExecution implements ProcedureExecution {
-
- RuntimeMetadata metadata;
- ExecutionContext context;
- private Call procedure;
- private boolean returnedResult;
- private SQLXML returnValue;
- private Dispatch<Source> dispatch;
- private XMLExecutionFactory executionFactory;
-
- /**
- * @param env
- */
- public XMLProcedureExecution(Call procedure, RuntimeMetadata metadata, ExecutionContext context, XMLExecutionFactory executionFactory, Dispatch<Source> dispatch) {
- this.metadata = metadata;
- this.context = context;
- this.procedure = procedure;
- this.dispatch = dispatch;
- this.executionFactory = executionFactory;
- }
-
- /**
- * @see org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.Call, int)
- */
- public void execute() throws TranslatorException {
- List<Argument> arguments = this.procedure.getArguments();
-
- Object docObject = (Object)arguments.get(0).getArgumentValue().getValue();
- Source source = null;
- try {
- if (docObject instanceof SQLXML) {
- SQLXML xml = (SQLXML)docObject;
- source = xml.getSource(null);
- if (executionFactory.isLogRequestResponseDocs()) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + xml.getString()); //$NON-NLS-1$
- }
- } else if (docObject instanceof Clob) {
- Clob clob = (Clob)docObject;
- source = new StreamSource(clob.getCharacterStream());
- if (executionFactory.isLogRequestResponseDocs()) {
- try {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + ClobType.getString(clob)); //$NON-NLS-1$
- } catch (IOException e) {
- }
- }
- } else if (docObject instanceof String) {
- String string = (String)docObject;
- source = new StreamSource(new StringReader(string));
- if (executionFactory.isLogRequestResponseDocs()) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + string); //$NON-NLS-1$
- }
- } else if (docObject != null) {
- throw new TranslatorException("Unknown document type, should be one of XML, CLOB, String");
- }
- } catch (SQLException e) {
- throw new TranslatorException(e);
- }
-
- String endpoint = (String)arguments.get(1).getArgumentValue().getValue();
- String soapAction = (String)arguments.get(2).getArgumentValue().getValue();
-
- if (soapAction != null) {
- dispatch.getRequestContext().put(Dispatch.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
- dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, soapAction);
- }
-
- if (endpoint != null) {
- this.dispatch.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, endpoint);
- }
-
- // execute the request
- Source result = this.dispatch.invoke(source);
- this.returnValue = this.executionFactory.convertToXMLType(result);
- if (executionFactory.isLogRequestResponseDocs()) {
- try {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Response " + this.returnValue.getString()); //$NON-NLS-1$
- } catch (SQLException e) {
- }
- }
- }
-
- @Override
- public List<?> next() throws TranslatorException, DataNotAvailableException {
- if (!returnedResult) {
- returnedResult = true;
- return Arrays.asList(this.returnValue);
- }
- return null;
- }
-
- @Override
- public List<?> getOutputParameterValues() throws TranslatorException {
- return Collections.emptyList();
- }
-
- public void close() {
-
- }
-
- public void cancel() throws TranslatorException {
- // no-op
- }
-}
Modified: trunk/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-xml/src/main/resources/META-INF/jboss-beans.xml 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="translator-xml-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
- <property name="info"><inject bean="translator-xml"/></property>
+ <bean name="translator-ws-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
+ <property name="info"><inject bean="translator-ws"/></property>
<property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
</bean>
- <bean name="translator-xml" class="org.teiid.templates.TranslatorTemplateInfo">
+ <bean name="translator-ws" class="org.teiid.templates.TranslatorTemplateInfo">
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.translator.xml.XMLExecutionFactory</parameter>
- <parameter class="java.lang.String">translator-xml</parameter>
- <parameter class="java.lang.String">xml</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.ws.WSExecutionFactory</parameter>
+ <parameter class="java.lang.String">translator-ws</parameter>
+ <parameter class="java.lang.String">ws</parameter>
</constructor>
</bean>
Added: trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/ws/i18n.properties
===================================================================
--- trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/ws/i18n.properties (rev 0)
+++ trunk/connectors/translator-ws/src/main/resources/org/teiid/translator/ws/i18n.properties 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+
+http_usage_error=In HTTP invocation mode, a non-POST method was specified with a request document. Either the document should be added to the query string or POST should be used as the method.
+unknown_doc_type=Unknown document object type, should be one of XML, CLOB, String
+invalid_invocation=Invalid invocation style specified, should be one of {0}
\ No newline at end of file
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,42 +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 org.teiid.translator.xml;
-
-import org.teiid.language.Select;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.xml.RequestPreprocessor;
-
-public class MockQueryPreprocessor implements RequestPreprocessor {
-
- public MockQueryPreprocessor() {
- super();
- }
-
- public Select preprocessQuery(Select query, RuntimeMetadata m_metadata, ExecutionContext exeContext) {
- return query;
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,215 +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 org.teiid.translator.xml;
-
-import java.io.File;
-import java.io.StringReader;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jdom.Document;
-import org.jdom.input.SAXBuilder;
-import org.mockito.Mockito;
-import org.teiid.language.Select;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-
-import com.metamatrix.cdk.api.TranslationUtility;
-/**
- *
- */
-public class ProxyObjectFactory {
-
- public static final String JMS_DESTINATION = "dynamicQueues/topic1";
- public static final String INITIAL_CONTEXT_FACTORY = "org.apache.activemq.jndi.ActiveMQInitialContextFactory";
- private static String docFolder = null;
-
-
- private ProxyObjectFactory() {
-
- }
-
-
-// public static HTTPManagedConnectionFactory getHTTPTestConnectorEnvironment(Properties props) {
-// if (props == null) {
-// props = getDefaultHTTPProps();
-// }
-// HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
-// PropertiesUtils.setBeanProperties(env, props, null);
-// return env;
-// }
-
- public static ExecutionContext getDefaultSecurityContext() {
- return Mockito.mock(ExecutionContext.class);
- }
-
- public static ExecutionContext getDefaultExecutionContext() {
- ExecutionContext ec = Mockito.mock(ExecutionContext.class);
- Mockito.stub(ec.getRequestIdentifier()).toReturn("request");
- Mockito.stub(ec.getPartIdentifier()).toReturn("testPartId");
-
- return ec;
- }
-
- public static ExecutionContext getExecutionContext(String requestID, String partId) {
- ExecutionContext ec = Mockito.mock(ExecutionContext.class);
- Mockito.stub(ec.getRequestIdentifier()).toReturn(requestID);
- Mockito.stub(ec.getPartIdentifier()).toReturn(partId);
-
- return ec;
- }
-
-
-//
-// public static Properties getDefaultHTTPProps() {
-// Properties testHTTPProps = new Properties();
-// testHTTPProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE.toString());
-// testHTTPProps.setProperty(HTTPConnectorState.URI, "http://localhost:8673"); //$NON-NLS-1$
-// testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60"); //$NON-NLS-1$
-// testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState"); //$NON-NLS-1$
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
-// testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS, "com.metamatrix.connector.xml.http.DefaultTrustDeserializer");
-// testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_NAME_VALUE);
-// testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD, HTTPConnectorState.GET);
-// return testHTTPProps;
-// }
-
-
-//
-// public static Properties getDefaultNameValueRequestProps() {
-// Properties defaultHTTPProps = getDefaultHttpProps();
-// defaultHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_NAME_VALUE);
-// return defaultHTTPProps;
-// }
-
-// public static Properties getDefaultHttpProps() {
-// Properties testHTTPProps = new Properties();
-// testHTTPProps.put(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE);
-// testHTTPProps.put(XMLConnectorStateImpl.CONNECTOR_CAPABILITES, "com.metamatrix.connector.xml.base.XMLCapabilities");
-// testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState");
-// testHTTPProps.setProperty(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS, "com.metamatrix.connector.xml.base.NoQueryPreprocessing");
-// testHTTPProps.setProperty(XMLConnectorStateImpl.SAX_FILTER_PROVIDER_CLASS, "com.metamatrix.connector.xml.base.NoExtendedFilters");
-// testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD, HTTPConnectorState.GET);
-// testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_XML_REQUEST);
-// testHTTPProps.setProperty(HTTPConnectorState.URI, "http://0.0.0.0:8673");
-// //testHTTPProps.setProperty(HTTPConnectorState.PROXY_URI, "http://0.0.0.0:8673");
-// testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60");
-// testHTTPProps.setProperty(HTTPConnectorState.XML_PARAMETER_NAME, "XMLRequest");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
-// testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS, "com.metamatrix.connector.xml.http.DefaultTrustDeserializer");
-// return testHTTPProps;
-// }
-
-
-
-
-// public static XMLConnector getDefaultXMLConnector() {
-// XMLConnector conn;
-// try {
-// conn = new XMLConnector();
-// conn.initialize(getDefaultTestConnectorEnvironment());
-// } catch (ConnectorException ce) {
-// ce.printStackTrace();
-// conn = null;
-// }
-// return conn;
-// }
-
-// public static XMLConnector getDefaultHTTPConnector(Properties props) {
-// XMLConnector conn;
-// try {
-// conn = new XMLConnector();
-// conn.initialize(getHTTPTestConnectorEnvironment(props));
-// } catch (ConnectorException ce) {
-// ce.printStackTrace();
-// conn = null;
-// }
-// return conn;
-// }
-//
-// public static XMLConnectionImpl getDefaultXMLConnection() {
-// XMLConnectionImpl connection;
-// try {
-// ExecutionContext ctx = getDefaultSecurityContext();
-// connection = (XMLConnectionImpl) getDefaultXMLConnector().getConnection();
-// } catch (ConnectorException ce) {
-// connection = null;
-// } catch (NullPointerException ne) {
-// connection = null;
-// }
-// return connection;
-// }
-//
-// private static XMLConnectionImpl getHTTPXMLConnection(Properties props) {
-// XMLConnectionImpl connection;
-// try {
-// ExecutionContext ctx = getDefaultSecurityContext();
-// connection = (XMLConnectionImpl) getDefaultHTTPConnector(props).getConnection();
-// } catch (ConnectorException ce) {
-// connection = null;
-// } catch (NullPointerException ne) {
-// connection = null;
-// }
-// return connection;
-// }
-
-
- public static Select getDefaultIQuery(String vdbPath, String queryString) {
- TranslationUtility transUtil = new TranslationUtility(vdbPath);
- Select query = (Select) transUtil.parseCommand(queryString);
- return query;
- }
-
- public static RuntimeMetadata getDefaultRuntimeMetadata(String vdbPath) {
- TranslationUtility transUtil = new TranslationUtility(vdbPath);
- RuntimeMetadata meta = transUtil.createRuntimeMetadata();
- return meta;
- }
-
- public static Document getDefaultDocument() throws Exception {
- Document doc = null;
- SAXBuilder builder = new SAXBuilder();
- StringReader reader = new StringReader("<foo><bar>baz</bar></foo>");
- doc = builder.build(reader);
- return doc;
- }
-
- public static String getStateCollegeVDBLocation() {
- return getDocumentsFolder() + "/UnitTests.vdb";
- }
-
- public static String getDocumentsFolder() {
- //is the test running locally or in CruiseControl?
- if (docFolder == null) {
- URL url = ProxyObjectFactory.class.getClassLoader().getResource("documents");
- try {
- docFolder = new File(url.toURI()).toString();
- } catch (URISyntaxException e) {
- }
- }
- return docFolder;
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,119 +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 org.teiid.translator.xml;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-import org.teiid.metadata.Column;
-
-
-@SuppressWarnings("nls")
-public class TestCartesianCriteriaGenerator {
-
- @Test
- public void testCartesian() throws Exception {
- String[] validValues = {"ACE", "ADE", "BCE", "BDE", "ACF", "ADF", "BCF", "BDF"};
-
- List<CriteriaDesc> list = new ArrayList<CriteriaDesc>();
-
- Column c1 = new Column();
- c1.setName("c1");
-
- Column c2 = new Column();
- c2.setName("c2");
-
- Column c3 = new Column();
- c3.setName("c3");
-
- CriteriaDesc desc1 = new CriteriaDesc(c1, Arrays.asList(new String[] {"A", "B"}));
- CriteriaDesc desc2 = new CriteriaDesc(c2, Arrays.asList(new String[] {"C", "D"}));
- CriteriaDesc desc3 = new CriteriaDesc(c3, Arrays.asList(new String[] {"E", "F"}));
- list.add(desc1);
- list.add(desc2);
- list.add(desc3);
-
- List<List<CriteriaDesc>> catesianProduct = CartesienCriteriaGenerator.generateCartesianCriteria(list);
-
- assertEquals(8, catesianProduct.size());
- for (List<CriteriaDesc> cds:catesianProduct) {
- assertEquals(3, cds.size());
-
- String value = "";
- for (CriteriaDesc cd:cds) {
- List values = cd.getValues();
- for (Object v:values) {
- value = value+v.toString();
- }
- }
- assertTrue(Arrays.asList(validValues).contains(value));
- }
- }
-
-
- @Test
- public void testCartesianWithMultiValue() throws Exception {
- // the brackets represent the grouping, how they come as multi values.
- String[] validValues = {"[A][C][EF]", "[A][D][EF]", "[B][C][EF]", "[B][D][EF]"};
-
- List<CriteriaDesc> list = new ArrayList<CriteriaDesc>();
-
- Column c1 = new Column();
- c1.setName("c1");
-
- Column c2 = new Column();
- c2.setName("c2");
-
- // make this column takes multi values
- Column c3 = new Column();
- c3.setName("c3");
- c3.setProperty(CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME, CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_MULTI_ELEMENT_NAME);
-
- CriteriaDesc desc1 = new CriteriaDesc(c1, Arrays.asList(new String[] {"[A]", "[B]"}));
- CriteriaDesc desc2 = new CriteriaDesc(c2, Arrays.asList(new String[] {"[C]", "[D]"}));
- CriteriaDesc desc3 = new CriteriaDesc(c3, Arrays.asList(new String[] {"[E", "F]"}));
- list.add(desc1);
- list.add(desc2);
- list.add(desc3);
-
- List<List<CriteriaDesc>> catesianProduct = CartesienCriteriaGenerator.generateCartesianCriteria(list);
-
- assertEquals(4, catesianProduct.size());
- for (List<CriteriaDesc> cds:catesianProduct) {
- assertEquals(3, cds.size());
-
- String value = "";
- for (CriteriaDesc cd:cds) {
- List values = cd.getValues();
- for (Object v:values) {
- value = value+v.toString();
- }
- }
- assertTrue(Arrays.asList(validValues).contains(value));
- }
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,608 +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 org.teiid.translator.xml;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.BaseInCondition;
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Comparison;
-import org.teiid.language.Condition;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.LanguageUtil;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.CriteriaDesc;
-
-
-/**
- *
- */
-public class TestCriteriaDesc extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select RequiredDefaultedParam from CriteriaDescTable " //$NON-NLS-1$
- + "where RequiredDefaultedParam in ('foo') order by RequiredDefaultedParam"; //$NON-NLS-1$
- private static final String VALUE = "value1"; //$NON-NLS-1$
-
-
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
- public void testGetCriteriaDescForColumn() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnDefaultedValue() throws Exception {
- //case 2: param, required, defaulted
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNoCriteria() throws Exception {
- //case 3: param, not required, not defaulted, not allowed empty
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNull("CriteriaDesc is not null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnAllowEmpty() throws Exception {
- //case 4: param, not required, not defaulted, allowed empty
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- final int colLocation = 0;
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnError() {
- //case 5: param, required, not defaulted
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredUndefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("exception not thrown"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnNotParam() throws Exception {
- //case 6: not a param
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OutputColumn from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNull("CriteriaDesc is not null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnCompare() throws Exception {
- //case 7: compare criteria
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam = 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
-
- public void testGetCriteriaDescForColumnMultiElement() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select MultiElementParam from CriteriaDescTable where MultiElementParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnDelimited() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLikeSearchable() {
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select LikeSearchableParam from CriteriaDescTable where LikeSearchableParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("should not be able to handle default value"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnUnlikeSearchable() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select UnlikeSearchableParam from CriteriaDescTable where UnlikeSearchableParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- }
-
- public void testGetCriteriaDescForColumnUnsearchable() {
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select UnsearchableParam from CriteriaDescTable where UnsearchableParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("should not be able to handle default value"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnLike() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam like 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNotEquals() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam != 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where concat(RequiredDefaultedParam, 'bar') in('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNameMatchFailure() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where AttributeParam in('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
-
- public void testGetCriteriaDescForColumnLeftLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable " //$NON-NLS-1$
- + "where concat('bar', 'foo') = concat('bar', RequiredDefaultedParam)"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnTwoElements() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where OutputColumn = RequiredDefaultedParam"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLeftElementEqualsLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where AttributeParam = 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLeftElementEqualsNonLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where" //$NON-NLS-1$
- + " RequiredDefaultedParam = concat('foo', OutputColumn)"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetInputXPathNoXpath() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadNoInputXpath from CriteriaDescTable where BadNoInputXpath in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals(desc.getColumnName(), desc.getInputXpath());
- }
-
-
- public void testGetInputXPathEmptyXpath() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadEmptyInputXPath from CriteriaDescTable where BadEmptyInputXPath in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals(desc.getColumnName(), desc.getInputXpath());
- }
-
- public void testGetDataAttributeNameEmptyName() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadNoDataAttributeName from CriteriaDescTable where BadNoDataAttributeName in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals("", desc.getDataAttributeName()); //$NON-NLS-1$
- }
-
- public void testGetInputXpath() throws TranslatorException {
- String query = "select RequiredDefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- String inputXPath = "/req/default/value"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertNotNull("CriteriaDesc is null", desc.getInputXpath()); //$NON-NLS-1$
- assertEquals(inputXPath, desc.getInputXpath());
- }
-
- public void testIsUnlimited() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("Criteria is flagged as unlimited", desc.isUnlimited()); //$NON-NLS-1$
- }
-
- public void testIsAutoIncrement() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is flagged as autoIncrement", desc.isAutoIncrement()); //$NON-NLS-1$
- }
-
- public void testIsParentAttribute() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- //before its inited
- assertFalse("criterion is flagged as an attribute", desc.isParentAttribute()); //$NON-NLS-1$
- //and after for code coverage
- assertFalse("criterion is flagged as an attribute", desc.isParentAttribute()); //$NON-NLS-1$
- }
-
- public void testIsEnumeratedAttribute() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is an enumerated attribute", desc.isEnumeratedAttribute()); //$NON-NLS-1$
- }
-
- public void testAllowEmptyValueFalse() throws TranslatorException {
- String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertFalse("criterion should not allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- }
-
- public void testAllowEmptyValueTrue() throws TranslatorException {
- String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- //before init
- assertTrue("criterion should allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- //and after for code coverage
- assertTrue("criterion should allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- }
-
- public void testIsDataInAttributeFalse() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is flagged as data in attribute", desc.isDataInAttribute()); //$NON-NLS-1$
- }
-
- public void testIsDataInAttributeTrue() throws TranslatorException {
- String query = "select AttributeParam from CriteriaDescTable where AttributeParam in ('foo')"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertTrue("criterion is not flagged as data in attribute", desc.isDataInAttribute()); //$NON-NLS-1$
- }
-
- public void testGetDataAttributeName() throws TranslatorException {
- String query = "select AttributeColumn from TestTable where AttributeColumn in ('foo')"; //$NON-NLS-1$
- Column elem = getElement(query);
- String attributeName = "myAttribute"; //$NON-NLS-1$
- ArrayList list = new ArrayList();
- list.add(VALUE);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertNotNull("CriteriaDesc is null", desc.getDataAttributeName()); //$NON-NLS-1$
- assertTrue("column name mismatch - expected " + attributeName //$NON-NLS-1$
- + " returned " + desc.getDataAttributeName(), //$NON-NLS-1$
- desc.getDataAttributeName().equals(attributeName));
- }
-
- public void testGetValues() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- List values = desc.getValues();
- assertNotNull("Values list is null", values); //$NON-NLS-1$
- assertEquals(values.get(0), VALUE);
- }
-
- public void testGetNumberOfValues() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertEquals(1, desc.getNumberOfValues());
- }
-
- public void testGetCurrentIndexValue() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertEquals(VALUE, desc.getCurrentIndexValue());
- }
-
- public void testGetCurrentIndexValueEnumerated() throws Exception {
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo', 'bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals("There should be two values" , 2, desc.getNumberOfValues()); //$NON-NLS-1$
- assertEquals("foo", desc.getCurrentIndexValue()); //$NON-NLS-1$
- desc.incrementIndex();
- assertEquals("bar", desc.getCurrentIndexValue()); //$NON-NLS-1$
- }
-
- public void testIncrementIndexEnumerated() throws Exception {
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo', 'bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- RuntimeMetadata metadata = ProxyObjectFactory.getDefaultRuntimeMetadata(vdbPath);
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertTrue("We should be able to increment this CriteriaDesc", desc.incrementIndex()); //$NON-NLS-1$
- }
-
- public void testGetCurrentIndexValueNoValue() throws Exception {
- final String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertEquals("", desc.getCurrentIndexValue()); //$NON-NLS-1$
- }
-
- public void testGetCurrentIndexValueNoValueNotEmpty() throws Exception {
- final String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertNull(desc.getCurrentIndexValue());
- }
-
- public void testIncrementIndex() throws Exception {
- final String value2 = "value2"; //$NON-NLS-1$
- String query = "select MultiCol from MultiTable where MultiCol in ('" + VALUE + "', '" + value2 + "')"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- list.add(VALUE);
- list.add(value2);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertEquals(VALUE, desc.getCurrentIndexValue());
- assertTrue("index increment failed", desc.incrementIndex()); //$NON-NLS-1$
- assertEquals(value2, desc.getCurrentIndexValue());
- assertFalse("index went beyond number of values", desc.incrementIndex()); //$NON-NLS-1$
- }
-
- public void testResetIndex() throws Exception {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- desc.resetIndex();
- }
-
- public void testNameMatch() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- Condition crit = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crit);
- Iterator criteriaIter = criteriaList.iterator();
- Expression expr = null;
- while (criteriaIter.hasNext()) {
- Condition criteriaSeg = (Condition) criteriaIter.next();
- if (criteriaSeg instanceof Comparison) {
- Comparison compCriteria = (Comparison) criteriaSeg;
- expr = compCriteria.getLeftExpression();
- break;
- } else if (criteriaSeg instanceof BaseInCondition) {
- expr = ((BaseInCondition) criteriaSeg).getLeftExpression();
- break;
- }
- }
- final String column = "CriteriaDescTable.RequiredDefaultedParam"; //$NON-NLS-1$
- assertTrue("column name mismatch - expected " + column + " returned " + expr, //$NON-NLS-1$ //$NON-NLS-2$
- CriteriaDesc.nameMatch(expr, column));
- }
-
- public void testStringifyCriteria() {
- String withQuotes = "'foodle doodle'"; //$NON-NLS-1$
- String withoutQuotes = "foodle doodle"; //$NON-NLS-1$
- assertEquals("stringify failed", withoutQuotes, CriteriaDesc.stringifyCriteria(withQuotes)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaDoubleQuotes() {
- String control = "foodle doodle"; //$NON-NLS-1$
- String test = "\"foodle doodle\""; //$NON-NLS-1$
- assertEquals("stringify failed", control, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaSingleQuote() {
- String test = "'ello govnor."; //$NON-NLS-1$
- assertEquals("stringify failed", test, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaSingleDoubleQuote() {
- String test = "\"ello govnor."; //$NON-NLS-1$
- assertEquals("stringify failed", test, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
-
- public void testBadTableSelect() throws TranslatorException {
- String tempVdbpath = vdbPath;
- vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb"; //$NON-NLS-1$
- try {
- createCriteriaDesc("select BadCol1 from BadTable"); //$NON-NLS-1$
- } finally {
- vdbPath = tempVdbpath;
- }
- }
-
- public void testElementAllowsEmpty() throws TranslatorException {
- String tempVdbpath = vdbPath;
- vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb"; //$NON-NLS-1$
- String strQuery = "Select Balance from Response"; //$NON-NLS-1$
- try {
- Column elem = getElement(strQuery);
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, query);
- } finally {
- vdbPath = tempVdbpath;
- }
- }
-
-
- private CriteriaDesc createCriteriaDesc(String query) throws TranslatorException {
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- list.add(VALUE);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- return desc;
- }
-
- private Column getElement(String query) throws TranslatorException {
- return getElement(query, 0);
- }
-
- private Column getElement(String query, int colLocation)
- throws TranslatorException {
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- return elem;
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestElementCollector.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestElementCollector.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestElementCollector.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,82 +0,0 @@
-package org.teiid.translator.xml;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLXML;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.teiid.core.types.InputStreamFactory;
-import org.teiid.core.types.SQLXMLImpl;
-import org.teiid.language.Select;
-import org.teiid.translator.xml.streaming.ElementProcessor;
-import org.teiid.translator.xml.streaming.ReaderFactory;
-import org.teiid.translator.xml.streaming.StreamingRowCollector;
-
-
-@SuppressWarnings("nls")
-public class TestElementCollector extends TestCase {
-
- StreamingRowCollector builder;
- String filename = ProxyObjectFactory.getDocumentsFolder() + "/purchaseOrders.xml";
- String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/File/purchase_orders.vdb";
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Map prefixes = new HashMap<String, String>();
- prefixes.put("po", "http://www.example.com/PO1");
- prefixes.put("xsd", "http://www.w3.org/2001/XMLSchema");
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "SELECT * FROM po_list.ITEM");
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- ElementProcessor processor = new ElementProcessor(info);
- builder = new StreamingRowCollector(prefixes, ReaderFactory.getXMLReader(null), processor);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- builder = null;
- }
-
- public void testGetTables1() {
- String path = "/po:purchaseOrders/order/items/item";
- int itemCount = 5968;
- try {
- StremableDocument doc = new StremableDocument(getSQLXML(new FileInputStream(filename)), "foo");
- List result = builder.getElements(doc, Arrays.asList(path));
- assertEquals(itemCount, result.size());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetRoot() {
- String path = "/";
- int itemCount = 1;
- try {
- StremableDocument doc = new StremableDocument(getSQLXML(new FileInputStream(filename)), "foo");
- List result = builder.getElements(doc, Arrays.asList(path));
- assertEquals(itemCount, result.size());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-
- SQLXML getSQLXML(final InputStream in) {
- InputStreamFactory isf = new InputStreamFactory("ISO-8859-1") {
- @Override
- public InputStream getInputStream() throws IOException {
- return in;
- }
- };
- return new SQLXMLImpl(isf);
- }
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,191 +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 org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Select;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ExecutionInfo;
-import org.teiid.translator.xml.QueryAnalyzer;
-
-/**
- *
- */
-public class TestExecutionInfo extends TestCase {
-
- /**
- * Constructor for ExecutionInfoTest.
- * @param arg0
- */
-
- private static final String QUERY = "select Company_id from Company where Company_id = 'MetaMatrix' order by Company_id";
-
- private ExecutionInfo m_info;
-
- //removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(ExecutionInfoTest.class, new Class[] {ExecutionInfo.class});
-
- }
-*/
-
- public TestExecutionInfo(String arg0) {
- super(arg0);
- }
-
- @Override
- public void setUp() throws TranslatorException {
- String vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- m_info = analyzer.getExecutionInfo();
-
- }
-
- @Override
- public void tearDown() {
- m_info = null;
- }
-
- public void testExecutionInfo() {
- ExecutionInfo info = new ExecutionInfo();
- assertNotNull("ExecutionInfo is null", info);
- assertEquals(0, info.getColumnCount());
- assertNotNull(info.getCriteria());
- assertNotNull(info.getOtherProperties());
- assertNotNull(info.getParameters());
- assertNotNull(info.getRequestedColumns());
- assertNotNull(info.getTableXPath());
- }
-
- public void testGetTableXPath() {
- assertEquals("/Mydata/company", m_info.getTableXPath());
- }
-
- public void testGetRequestedColumns() {
- List columns = m_info.getRequestedColumns();
- assertNotNull("requestedColumns list is null", columns);
- assertEquals(1, columns.size());
- }
-
- public void testGetColumnCount() {
- assertEquals(1, m_info.getColumnCount());
- }
-
- public void testGetParameters() {
- List params = m_info.getParameters();
- assertNotNull("Param list is null", params);
- assertEquals(0, params.size());
- }
-
- public void testGetCriteria() {
- String vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- //String query = "Select AttributeColumn from TestTable where AttributeColumn in ('foo')";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(iquery);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- List crits = info.getCriteria();
- assertNotNull("Criteria list is null", crits);
- assertEquals(1, crits.size());
- } catch (TranslatorException ce) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-
- public void testGetOtherProperties() throws TranslatorException {
- String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb";
- String strQuery = "select * from Response";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- Map<String, String> props = info.getOtherProperties();
- assertFalse("properties are empty", props.isEmpty());
- info.setOtherProperties(null);
- assertNotNull(info.getOtherProperties());
- }
-
- public void testSetTableXPath() {
- String xpath = "/new/path";
- m_info.setTableXPath(xpath);
- assertEquals(xpath, m_info.getTableXPath());
- m_info.setTableXPath("");
- assertNull(m_info.getTableXPath());
- }
-
- public void testSetRequestedColumns() {
- String reqCol = "Company_id";
- ArrayList reqCols = new ArrayList();
- reqCols.add(reqCol);
- m_info.setRequestedColumns(reqCols);
- assertEquals(reqCol, m_info.getRequestedColumns().get(0));
- }
-
- public void testSetColumnCount() {
- final int count = 3;
- m_info.setColumnCount(count);
- assertEquals(count, m_info.getColumnCount());
-
- }
-
- public void testSetParameters() {
- String param = "[Company_id]";
- ArrayList params = new ArrayList();
- params.add(param);
- m_info.setParameters(params);
- assertEquals(param, m_info.getParameters().get(0));
- }
-
- public void testSetCriteria() {
- String crit = "Company_id";
- ArrayList crits = new ArrayList();
- crits.add(crit);
- m_info.setParameters(crits);
- assertEquals(crit, m_info.getParameters().get(0));
- }
-
- public void testSetOtherProperties() {
- String prop = "myProp";
- String key = "foo";
- Map<String, String> props = new HashMap<String, String>();
- props.put(key, prop);
- m_info.setOtherProperties(props);
- assertEquals(prop, m_info.getOtherProperties().get(key));
-
- m_info.setOtherProperties(null);
- assertNotNull("OtherProerties was set to null", m_info.getOtherProperties());
- assertEquals(0, m_info.getOtherProperties().size());
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,172 +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 org.teiid.translator.xml;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Comparison;
-import org.teiid.language.Condition;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.LanguageUtil;
-import org.teiid.language.Literal;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.OutputXPathDesc;
-
-
-/**
- *
- */
-public class TestOutputXPathDesc extends TestCase {
-
-
- private static String vdbPath;
- private static final String QUERY = "select OutputColumn from CriteriaDescTable where"
- + " OutputColumn in ('foo') order by OutputColumn";
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-// removing hansel while testing clover
-
-/*
- public static Test suite() {
- return new CoverageDecorator(OutputXPathDescTest.class, new Class[] {OutputXPathDesc.class});
- }
-*/
-
- /**
- * Constructor for OutputXPathDescTest.
- * @param arg0
- */
- public TestOutputXPathDesc(String arg0) {
- super(arg0);
- }
-
- /*
- * Class under test for void OutputXPathDesc(Element)
- */
- public void testOutputXPathDescElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNull(desc.getCurrentValue());
- assertNotNull(desc.getDataType());;
- }
-
- public void testOutputXPathDescParam() throws Exception {
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam in ('foo')";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNotNull("OutputXPathDesc is null", desc);
- }
-
-
- public void testOutputXPathDescNoXPath() throws Exception {
- try {
- String query = "select OutputColumnNoXPath from CriteriaDescTable";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = (DerivedColumn) iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- fail("should not be able to create OuputXPathDesc with no XPath");
- } catch (TranslatorException ce) {
- return;
- }
- }
- /*
- * Class under test for void OutputXPathDesc(ILiteral)
- */
- public void testOutputXPathDescILiteral() throws Exception {
- String strLiteral = "MetaMatrix";
- String strQuery = "Select Company_id from Company where Company_id = '" + strLiteral + "'";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- Condition crits = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crits);
- Comparison compCriteria = (Comparison) criteriaList.get(0);
- Literal literal = (Literal) compCriteria.getRightExpression();
- OutputXPathDesc desc = new OutputXPathDesc(literal);
- assertNotNull(desc);
- assertEquals(strLiteral, desc.getCurrentValue().toString());
- assertEquals(strLiteral.getClass(), desc.getDataType());
- }
-
- public void testOutputXPathDescILiteralNullValue() throws Exception {
- String strLiteral = "MetaMatrix";
- String strQuery = "Select Company_id from Company where Company_id = '" + strLiteral + "'";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- Condition crits = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crits);
- Comparison compCriteria = (Comparison) criteriaList.get(0);
- Literal literal = (Literal) compCriteria.getRightExpression();
- literal.setValue(null);
- OutputXPathDesc desc = new OutputXPathDesc(literal);
- assertNotNull(desc);
- assertNull(desc.getCurrentValue());
- assertEquals(strLiteral.getClass(), desc.getDataType());
- }
-
- public void testSetAndGetCurrentValue() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- String myVal = "myValue";
- desc.setCurrentValue(myVal);
- assertEquals(myVal, desc.getCurrentValue());
- }
-
- public void testGetDataType() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNotNull(desc.getDataType());
- assertEquals(String.class, desc.getDataType());
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,200 +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 org.teiid.translator.xml;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ParameterDescriptor;
-
-
-/**
- *
- */
-public class TestParameterDescriptor extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select OutputColumn from CriteriaDescTable where"
- + " OutputColumn in ('MetaMatrix') order by OutputColumn";
-
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-
-// removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(ParameterDescriptorTest.class, new Class[] {ParameterDescriptor.class});
- }
-
-*/
- /**
- * Constructor for ParameterDescriptorTest.
- * @param arg0
- */
- public TestParameterDescriptor(String arg0) {
- super(arg0);
- }
-
- /*
- * Class under test for void ParameterDescriptor(Element)
- */
- public void testParameterDescriptorElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
-
- public void testParameterDescriptorElementParameter() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "select RequiredDefaultedParam from CriteriaDescTable");
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
-
-
- public void testParameterDescriptorElementSpaceXPath() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "select OutputColumnSpaceXPath from CriteriaDescTable");
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
- /*
- * Class under test for void ParameterDescriptor(ILiteral)
- */
- public void testParameterDescriptor() {
- ParameterDescriptor desc = new ParameterDescriptorImpl();
- assertNotNull(desc);
- assertNull(desc.getXPath());
- assertFalse(desc.isParameter());
- assertNull(desc.getColumnName());
- }
-
- public void testSetGetXPath() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- String xpath = "/foo";
- desc.setXPath(xpath);
- assertEquals(xpath, desc.getXPath());
- }
-
- public void testSetIsParameter() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- boolean is = !desc.isParameter();
- desc.setIsParameter(is);
- assertEquals(is, desc.isParameter());
- }
-
- public void testSetGetColumnName() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- String name = "myColumn";
- desc.setColumnName(name);
- assertEquals(name, desc.getColumnName());
- }
-
- public void testSetGetColumnNumber() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- int number = desc.getColumnNumber() + 1;
- desc.setColumnNumber(number);
- assertEquals(number, desc.getColumnNumber());
- }
-
- public void testGetElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertEquals(element, desc.getElement());
- }
-
- public void testTestForParam() throws Exception {
- String trueQuery = "select EmptyCol from EmptyTable where EmptyCol = 'foo'";
- String falseQuery = "select Company_id from Company";
-
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, trueQuery);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- assertTrue(ParameterDescriptor.testForParam(element));
-
- query = ProxyObjectFactory.getDefaultIQuery(vdbPath, falseQuery);
- symbols = query.getDerivedColumns();
- selectSymbol = (DerivedColumn) symbols.get(0);
- expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- element = ((ColumnReference) expr).getMetadataObject();
- assertFalse(ParameterDescriptor.testForParam(element));
- }
-
- private ParameterDescriptor getParameterDescriptor() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- return desc;
- }
-
- private class ParameterDescriptorImpl extends ParameterDescriptor {
- public ParameterDescriptorImpl() {
- super();
- }
-
- public ParameterDescriptorImpl(Column element) throws TranslatorException {
- super(element);
- }
-
- }
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,165 +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 org.teiid.translator.xml;
-
-
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Select;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ExecutionInfo;
-import org.teiid.translator.xml.QueryAnalyzer;
-
-/**
- *
- */
-public class TestQueryAnalyzer extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select SimpleOutput from SimpleTable where SimpleOutput = 'MetaMatrix' order by SimpleOutput";
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-// removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(QueryAnalyzerTest.class, new Class[] {QueryAnalyzer.class});
- }
-
-*/
- /**
- * Constructor for QueryAnalyzerTest.
- * @param arg0
- */
- public TestQueryAnalyzer(String arg0) {
- super(arg0);
- }
-
- public void testQueryAnalyzer() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- assertNotNull("analyzer is null", analyzer);
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyze() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeSimpleSelect() {
- String strQuery = "select SimpleOutput from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeLiteralSelect() {
- String strQuery = "select SimpleOutput, 'foo' from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeFunctionSelect() {
- String strQuery = "select concat(SimpleOutput, 'foo') from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeParameterSelect() {
- String strQuery = "select SimpleParam from SimpleInput where SimpleParam in ('foo')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeComplexQuery() {
- String strQuery = "select SimpleOut from SimpleInput where SimpleParam in ('foo')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeComplexQuery2() {
- String strQuery = "select SimpleOut from SimpleInput where SimpleParam in ('foo') and OtherOut in ('bar')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetExecutionInfo() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- assertNotNull("analyzer is null", analyzer);
- ExecutionInfo base = analyzer.getExecutionInfo();
- assertEquals(1, base.getColumnCount());
- analyzer.analyze();
- ExecutionInfo post = analyzer.getExecutionInfo();
- assertTrue(post.getColumnCount() > 0);
- assertEquals(1, post.getCriteria().size());
- assertEquals(1, post.getRequestedColumns().size());
- assertNotNull(post.getTableXPath());
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
-
- }
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,195 +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 org.teiid.translator.xml;
-
-import org.teiid.translator.xml.XMLExecutionFactory;
-
-import junit.framework.TestCase;
-
-
-/**
- *
- */
-public class TestXMLCapabilities extends TestCase {
-
-
- private XMLExecutionFactory m_caps = null;
- /**
- * Constructor for XMLCapabilitiesTest.
- * @param arg0
- */
- public TestXMLCapabilities(String arg0) {
- super(arg0);
- }
-
- @Override
- public void setUp() {
- m_caps = new XMLExecutionFactory();
-
- }
-
- public void testGetMaxInCriteriaSize() {
- assertEquals(Integer.MAX_VALUE, m_caps.getMaxInCriteriaSize());
- }
-
- public void testSupportsCompareCriteriaEquals() {
- assertTrue(m_caps.supportsCompareCriteriaEquals());
- }
-
- public void testSupportsInCriteria() {
- assertTrue(m_caps.supportsInCriteria());
- }
-
- public void testXMLCapabilities() {
- XMLExecutionFactory caps = new XMLExecutionFactory();
- assertNotNull(caps);
- }
-
- /*
- * Class under test for List getSupportedFunctions()
- */
- public void testGetSupportedFunctions() {
- assertNotNull(m_caps.getSupportedFunctions());
- }
-
- public void testSupportsSelectDistinct() {
- assertFalse(m_caps.supportsSelectDistinct());
- }
-
- public void testSupportsAliasedGroup() {
- assertFalse(m_caps.supportsAliasedTable());
- }
-
- public void testSupportsJoins() {
- assertFalse(m_caps.supportsInnerJoins());
- }
-
- public void testSupportsSelfJoins() {
- assertFalse(m_caps.supportsSelfJoins());
- }
-
- public void testSupportsOuterJoins() {
- assertFalse(m_caps.supportsOuterJoins());
- }
-
- public void testSupportsFullOuterJoins() {
- assertFalse(m_caps.supportsFullOuterJoins());
- }
-
- public void testSupportsBetweenCriteria() {
- assertFalse(m_caps.supportsBetweenCriteria());
- }
-
- public void testSupportsLikeCriteria() {
- assertFalse(m_caps.supportsLikeCriteria());
- }
-
- public void testSupportsLikeCriteriaEscapeCharacter() {
- assertFalse(m_caps.supportsLikeCriteriaEscapeCharacter());
- }
-
- public void testSupportsInCriteriaSubquery() {
- assertFalse(m_caps.supportsInCriteriaSubquery());
- }
-
- public void testSupportsIsNullCriteria() {
- assertFalse(m_caps.supportsIsNullCriteria());
- }
-
- public void testSupportsOrCriteria() {
- assertFalse(m_caps.supportsOrCriteria());
- }
-
- public void testSupportsNotCriteria() {
- assertFalse(m_caps.supportsNotCriteria());
- }
-
- public void testSupportsExistsCriteria() {
- assertFalse(m_caps.supportsExistsCriteria());
- }
-
- public void testSupportsQuantifiedCompareCriteriaSome() {
- assertFalse(m_caps.supportsQuantifiedCompareCriteriaSome());
- }
-
- public void testSupportsQuantifiedCompareCriteriaAll() {
- assertFalse(m_caps.supportsQuantifiedCompareCriteriaAll());
- }
-
- public void testSupportsOrderBy() {
- assertFalse(m_caps.supportsOrderBy());
- }
-
- public void testSupportsAggregatesSum() {
- assertFalse(m_caps.supportsAggregatesSum());
- }
-
- public void testSupportsAggregatesAvg() {
- assertFalse(m_caps.supportsAggregatesAvg());
- }
-
- public void testSupportsAggregatesMin() {
- assertFalse(m_caps.supportsAggregatesMin());
- }
-
- public void testSupportsAggregatesMax() {
- assertFalse(m_caps.supportsAggregatesMax());
- }
-
- public void testSupportsAggregatesCount() {
- assertFalse(m_caps.supportsAggregatesCount());
- }
-
- public void testSupportsAggregatesCountStar() {
- assertFalse(m_caps.supportsAggregatesCountStar());
- }
-
- public void testSupportsAggregatesDistinct() {
- assertFalse(m_caps.supportsAggregatesDistinct());
- }
-
- public void testSupportsScalarSubqueries() {
- assertFalse(m_caps.supportsScalarSubqueries());
- }
-
- public void testSupportsCorrelatedSubqueries() {
- assertFalse(m_caps.supportsCorrelatedSubqueries());
- }
-
- public void testSupportsCaseExpressions() {
- assertFalse(m_caps.supportsCaseExpressions());
- }
-
- public void testSupportsSearchedCaseExpressions() {
- assertFalse(m_caps.supportsSearchedCaseExpressions());
- }
-
- public void testSupportsInlineViews() {
- assertFalse(m_caps.supportsInlineViews());
- }
-
- public void testSupportsUnions() {
- assertFalse(m_caps.supportsUnions());
- }
-
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,19 +0,0 @@
-package org.teiid.translator.xml;
-
-import junit.framework.TestCase;
-
-import org.teiid.translator.xml.streaming.ReaderFactory;
-import org.xml.sax.XMLReader;
-
-
-public class TestXMLReaderFactory extends TestCase {
-
- public void testGetSAXBuilder() {
- try {
- XMLReader reader = ReaderFactory.getXMLReader(null);
- assertNotNull(reader);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-}
Deleted: trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,88 +0,0 @@
-package org.teiid.translator.xml;
-
-import java.util.List;
-
-import org.teiid.translator.xml.streaming.InvalidPathException;
-import org.teiid.translator.xml.streaming.XPathSplitter;
-
-import junit.framework.TestCase;
-
-
-public class TestXPathSplitter extends TestCase {
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * ((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items3) | (/po:purchaseOrders/order/items4))/item
- *
- * becomes
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- * becomes
- *
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- */
- public void testSplit() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items) | (/po:purchaseOrders/order/items))/item");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitSimple() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("/po:purchaseOrders/order/items/item");
- assertEquals(1, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitCompund() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("(/po:purchaseOrders/order/items/item)|(/po:purchaseOrders/order/items)");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitCompund2() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("(/po:purchaseOrders/order/items/item)|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))");
- assertEquals(3, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- /**
- * ((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))
- *
- * /po:purchaseOrders/order/items
- * /po:purchaseOrders/order/item
- *
- */
- public void testSplitCompund3() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-}
Deleted: trunk/connectors/translator-ws/src/test/resources/BookCollection.xml
===================================================================
--- trunk/connectors/translator-xml/src/test/resources/BookCollection.xml 2010-06-08 14:41:59 UTC (rev 2192)
+++ trunk/connectors/translator-ws/src/test/resources/BookCollection.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1,543 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><Books:bookCollection xmlns:Books="http://www.metamatrix.com/XMLSchema/DataSets/Books">
-<!--
-
- 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.
-
--->
-
- <book isbn="0-7356-0877-7">
- <title>After the Gold Rush</title>
- <subtitle>Creating a True Profession of Software Engineering</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-55615-484-4">
- <title>Code Complete</title>
- <subtitle>A Practical Handbook of Software Construction</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1993</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-556-15900-5">
- <title>Rapid Development</title>
- <subtitle>Taming Wild Software Schedules</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7356-0631-5">
- <title>Software Requirements</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Wiegers</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-57231-621-7">
- <title>Software Project Survival Guide</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-43287-0">
- <title>Automated Software Testing</title>
- <subtitle>Introduction, Management, and Performance</subtitle>
- <edition>1</edition>
- <authors>
- <author>Dustin</author>
- <author>Rashka</author>
- <author>Paul</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-31000-7">
- <title>Inside Java 2 Security</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Gong</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="020130998X">
- <title>The Unified Modeling Language Reference Manual</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Rumbaugh</author>
- <author>Jacobson</author>
- <author>Booch</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-70225-8">
- <title>Writing Effective Use Cases</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Cockburn</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0201877562">
- <title>Software Testing in the Real World</title>
- <subtitle>Improving the Process</subtitle>
- <edition>1</edition>
- <authors>
- <author>Kit</author>
- <author>Finzi</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1995</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-43336-2">
- <title>SQL Queries for Mere Mortals</title>
- <subtitle>A Hands-on Guide to Data Manipulation in SQL</subtitle>
- <edition>1</edition>
- <authors>
- <author>Hernandez</author>
- <author>Viescas</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-65758-9">
- <title>LDAP Programming with Java</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Weltman</author>
- <author>Dahbura</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-44787-8">
- <title>The Practical SQL Handbook</title>
- <subtitle>Using Structured Query Language</subtitle>
- <edition>1</edition>
- <authors>
- <author>Bowman</author>
- <author>Emerson</author>
- <author>Darnovsky</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-10088-6">
- <title>Compilers</title>
- <subtitle>Principles, Techniques, and Tools</subtitle>
- <edition>1</edition>
- <authors>
- <author>Aho</author>
- <author>Sethi</author>
- <author>Ullman</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1985</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-31009-0">
- <title>Concurrent Programming in Java</title>
- <subtitle>Design Principles and Patterns</subtitle>
- <edition>2</edition>
- <authors>
- <author>Lea</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-471-98710-7">
- <title>Concurrency State Models & Java Programs</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Kramer</author>
- <author>Magee</author>
- </authors>
- <publishingInformation>
- <publisher>Wiley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-471355232">
- <title>Building and Managing the Meta Data Repository</title>
- <subtitle>A Full Life-Cycle Guide</subtitle>
- <edition>1</edition>
- <authors>
- <author>Marco</author>
- </authors>
- <publishingInformation>
- <publisher>Wiley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7897-2271-2">
- <title>Complete Idiot's Guide to Project Management with Microsoft Project 2000</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Black</author>
- </authors>
- <publishingInformation>
- <publisher>Que</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-932633-33-1">
- <title>Creating a Software Engineering Culture</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Wiegers</author>
- </authors>
- <publishingInformation>
- <publisher>Dorset House Publishing</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-932633-43-9">
- <title>Peopleware</title>
- <subtitle>Productive Projects and Teams</subtitle>
- <edition>2</edition>
- <authors>
- <author>DeMarco</author>
- <author>Lister</author>
- </authors>
- <publishingInformation>
- <publisher>Dorset House Publishing</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1558605150">
- <title>Database Design for Smarties</title>
- <subtitle>Using UML for Data Modeling</subtitle>
- <edition>1</edition>
- <authors>
- <author>Muller</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-558-60190-2">
- <title>Transaction Processing</title>
- <subtitle>Concepts and Techniques</subtitle>
- <edition>1</edition>
- <authors>
- <author>Gray</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1992</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-55860-415-4">
- <title>Principles of Transaction Processing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Bernstein</author>
- <author>Newcomer</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1997</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1558605231">
- <title>Readings in Database Systems</title>
- <subtitle/>
- <edition>3</edition>
- <authors>
- <author>Stonebraker</author>
- <author>Hellerstein</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-13-239856-7">
- <title>How to Run Successful Projects II</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>O'Connell</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-13-014714-1">
- <title>The XML Handbook</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Goldfarb</author>
- <author>Prescod</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0130273635">
- <title>Thinking in Java</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Eckel</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="130402648">
- <title>Database System Implementation</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Ullman</author>
- <author>Garcia-Molina</author>
- <author>Widom</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-596-00016-2">
- <title>Java and XML</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>McLaughlin</author>
- <author>Loukides</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-56592-487-8">
- <title>Java in a Nutshell</title>
- <subtitle/>
- <edition>3</edition>
- <authors>
- <author>Flanagan</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-56592-483-5">
- <title>Java Enterprise in a Nutshell</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Flanagan</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-672-31602-1">
- <title>Java Security Handbook</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Jaworski</author>
- <author>Perrone</author>
- </authors>
- <publishingInformation>
- <publisher>Sams</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-672-31983-7">
- <title>Software Testing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Patton</author>
- </authors>
- <publishingInformation>
- <publisher>Sams</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861002-77-7">
- <title>Professional Java Server Programming</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Ayers</author>
- <author>Bergsten</author>
- <author>Diamond</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861-00506-7">
- <title>XSLT Programmer's Reference</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Kay</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861-00312-9">
- <title>XSLT Programmer's Reference</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Kay</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-818-68300-7">
- <title>The Software Project Manager's Handbook</title>
- <subtitle>Principles that Work</subtitle>
- <edition>1</edition>
- <authors>
- <author>Phillips</author>
- </authors>
- <publishingInformation>
- <publisher>IEEE Computer Society</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-884777-84-8">
- <title>Swing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Robinson</author>
- <author>Vorobiev</author>
- </authors>
- <publishingInformation>
- <publisher>Manning</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-893115-10-0">
- <title>Taming Java Threads</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Holub</author>
- </authors>
- <publishingInformation>
- <publisher>Apress</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-57870-070-1">
- <title>Understanding and Deploying LDAP Directory Services</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Howes</author>
- <author>Smith</author>
- <author>Good</author>
- </authors>
- <publishingInformation>
- <publisher>Macmillan</publisher>
- <publishDate>1990</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7821-1148-3">
- <title>SQL Instant Reference</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Gruber</author>
- </authors>
- <publishingInformation>
- <publisher>Sybex</publisher>
- <publishDate>1993</publishDate>
- </publishingInformation>
- </book>
-</Books:bookCollection>
\ No newline at end of file
Deleted: trunk/connectors/translator-ws/src/test/resources/cis.vdb
===================================================================
(Binary files differ)
Deleted: trunk/connectors/translator-ws/src/test/resources/xmltest.vdb
===================================================================
(Binary files differ)
Added: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml (rev 0)
+++ trunk/documentation/client-developers-guide/pom.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,70 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>client-developers-guide</artifactId>
+ <packaging>jdocbook</packaging>
+ <name>Teiid Client Developers Guide</name>
+ <description>The Client Developers Guide</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>DataCaching.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>client_developers_guide.pdf</finalName>
+ </format>
+ <!-- <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format> -->
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Property changes on: trunk/documentation/client-developers-guide/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml
===================================================================
Property changes on: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1035,6 +1035,18 @@
<para>x in {string}</para>
</entry>
</row>
+ <row>
+ <entry>
+ <para>QUERYSTRING(path [, expr [AS name] ...])</para>
+ </entry>
+ <entry>
+ <para>Returns a properly encoded query string appended to the given path. Null valued expressions are omitted, and a null path is treated as ''.</para>
+ <para>e.g. QUERYSTRING('path', 'value' as "&x", ' & ' as y, null as z) returns 'path?%26x=value&y=%20%26%20'</para>
+ </entry>
+ <entry>
+ <para>path, expr in {string}. name is an identifier</para>
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-10 04:01:14 UTC (rev 2212)
@@ -832,7 +832,7 @@
<para>
Usage:
<synopsis label="Usage">XMLTABLE([<NSP>,] xquery-expression [<PASSING>] [COLUMNS <COLUMN>, ... )] AS name</synopsis>
- <synopsis label="Usage">COLUMN := name (FOR ORDINALITY | (datatype [PATH string] [DEFAULT expression]))</synopsis>
+ <synopsis label="Usage">COLUMN := name (FOR ORDINALITY | (datatype [DEFAULT expression] [PATH string]))</synopsis>
</para>
<para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para>
<para>See XMLQUERY for the definition of <link linkend="passing">PASSING</link>.</para>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -133,7 +133,7 @@
MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
ExecutionFactory executionFactory = getExecutionFactory();
Object connectionFactory = getConnectionFactory();
- Object connection = executionFactory.getConnection(executionFactory);
+ Object connection = executionFactory.getConnection(connectionFactory);
try {
executionFactory.getMetadata(factory, connection);
} finally {
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -57,7 +57,6 @@
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.function.source.XMLSystemFunctions;
-import org.teiid.query.function.source.XMLSystemFunctions.NameValuePair;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.AbstractSetCriteria;
@@ -83,6 +82,7 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
@@ -98,11 +98,22 @@
import org.teiid.query.util.CommandContext;
import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
+import org.teiid.translator.WSConnection.Util;
public class Evaluator {
- private final static char[] REGEX_RESERVED = new char[] {'$', '(', ')', '*', '.', '?', '[', '\\', ']', '^', '{', '|', '}'}; //in sorted order
+ public static class NameValuePair<T> {
+ public String name;
+ public T value;
+
+ public NameValuePair(String name, T value) {
+ this.name = name;
+ this.value = value;
+ }
+ }
+
+ private final static char[] REGEX_RESERVED = new char[] {'$', '(', ')', '*', '.', '?', '[', '\\', ']', '^', '{', '|', '}'}; //in sorted order
private final static MatchCriteria.PatternTranslator LIKE_TO_REGEX = new MatchCriteria.PatternTranslator(".*", ".", REGEX_RESERVED, '\\'); //$NON-NLS-1$ //$NON-NLS-2$
private Map elements;
@@ -580,71 +591,122 @@
} else if(expression instanceof ScalarSubquery) {
return evaluate((ScalarSubquery) expression, tuple);
} else if (expression instanceof XMLElement){
- XMLElement function = (XMLElement)expression;
- List<Expression> content = function.getContent();
+ return evaluateXMLElement(tuple, (XMLElement)expression);
+ } else if (expression instanceof XMLForest){
+ return evaluateXMLForest(tuple, (XMLForest)expression);
+ } else if (expression instanceof XMLSerialize){
+ return evaluateXMLSerialize(tuple, (XMLSerialize)expression);
+ } else if (expression instanceof XMLQuery) {
+ return evaluateXMLQuery(tuple, (XMLQuery)expression);
+ } else if (expression instanceof QueryString) {
+ return evaluateQueryString(tuple, (QueryString)expression);
+ } else {
+ throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0016, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0016, expression.getClass().getName()));
+ }
+ }
+
+ //TODO: exception if length is too long?
+ private Object evaluateQueryString(List tuple, QueryString queryString)
+ throws ExpressionEvaluationException, BlockedException,
+ TeiidComponentException {
+ Evaluator.NameValuePair<Object>[] pairs = getNameValuePairs(tuple, queryString.getArgs(), false);
+ String path = (String)internalEvaluate(queryString.getPath(), tuple);
+ if (path == null) {
+ path = ""; //$NON-NLS-1$
+ }
+ boolean appendedAny = false;
+ StringBuilder result = new StringBuilder();
+ for (Evaluator.NameValuePair<Object> nameValuePair : pairs) {
+ if (nameValuePair.value == null) {
+ continue;
+ }
+ if (appendedAny) {
+ result.append('&');
+ }
+ appendedAny = true;
+ result.append(Util.httpURLEncode(nameValuePair.name)).append('=').append(Util.httpURLEncode((String)nameValuePair.value));
+ }
+ if (!appendedAny) {
+ return path;
+ }
+ result.insert(0, '?');
+ result.insert(0, path);
+ return result.toString();
+ }
+
+ private Object evaluateXMLQuery(List tuple, XMLQuery xmlQuery)
+ throws BlockedException, TeiidComponentException,
+ FunctionExecutionException {
+ boolean emptyOnEmpty = true;
+ if (xmlQuery.getEmptyOnEmpty() != null) {
+ emptyOnEmpty = xmlQuery.getEmptyOnEmpty();
+ }
+ try {
+ SequenceIterator iter = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getPassing(), tuple);
+ return xmlQuery.getXQueryExpression().createXMLType(iter, emptyOnEmpty);
+ } catch (TeiidProcessingException e) {
+ throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
+ } catch (XPathException e) {
+ throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
+ }
+ }
+
+ private Object evaluateXMLSerialize(List tuple, XMLSerialize xs)
+ throws ExpressionEvaluationException, BlockedException,
+ TeiidComponentException, FunctionExecutionException {
+ XMLType value = (XMLType) internalEvaluate(xs.getExpression(), tuple);
+ if (value == null) {
+ return null;
+ }
+ try {
+ if (!xs.isDocument()) {
+ return DataTypeManager.transformValue(value, xs.getType());
+ }
+ if (value.getType() == Type.UNKNOWN) {
+ Type type = StringToSQLXMLTransform.isXml(value.getCharacterStream());
+ value.setType(type);
+ }
+ if (value.getType() == Type.DOCUMENT || value.getType() == Type.ELEMENT) {
+ return DataTypeManager.transformValue(value, xs.getType());
+ }
+ } catch (SQLException e) {
+ throw new FunctionExecutionException(e, e.getMessage());
+ } catch (TransformationException e) {
+ throw new FunctionExecutionException(e, e.getMessage());
+ }
+ throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlserialize")); //$NON-NLS-1$
+ }
+
+ private Object evaluateXMLForest(List tuple, XMLForest function)
+ throws ExpressionEvaluationException, BlockedException,
+ TeiidComponentException, FunctionExecutionException {
+ List<DerivedColumn> args = function.getArgs();
+ Evaluator.NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args, true);
+
+ try {
+ return XMLSystemFunctions.xmlForest(context, namespaces(function.getNamespaces()), nameValuePairs);
+ } catch (TeiidProcessingException e) {
+ throw new FunctionExecutionException(e, e.getMessage());
+ }
+ }
+
+ private Object evaluateXMLElement(List tuple, XMLElement function)
+ throws ExpressionEvaluationException, BlockedException,
+ TeiidComponentException, FunctionExecutionException {
+ List<Expression> content = function.getContent();
List<Object> values = new ArrayList<Object>(content.size());
for (Expression exp : content) {
values.add(internalEvaluate(exp, tuple));
}
try {
- NameValuePair<Object>[] attributes = null;
+ Evaluator.NameValuePair<Object>[] attributes = null;
if (function.getAttributes() != null) {
- attributes = getNameValuePairs(tuple, function.getAttributes().getArgs());
+ attributes = getNameValuePairs(tuple, function.getAttributes().getArgs(), true);
}
return XMLSystemFunctions.xmlElement(context, function.getName(), namespaces(function.getNamespaces()), attributes, values);
} catch (TeiidProcessingException e) {
throw new FunctionExecutionException(e, e.getMessage());
}
- } else if (expression instanceof XMLForest){
- XMLForest function = (XMLForest)expression;
- List<DerivedColumn> args = function.getArgs();
- NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args);
-
- try {
- return XMLSystemFunctions.xmlForest(context, namespaces(function.getNamespaces()), nameValuePairs);
- } catch (TeiidProcessingException e) {
- throw new FunctionExecutionException(e, e.getMessage());
- }
- } else if (expression instanceof XMLSerialize){
- XMLSerialize xs = (XMLSerialize)expression;
- XMLType value = (XMLType) internalEvaluate(xs.getExpression(), tuple);
- if (value == null) {
- return null;
- }
- try {
- if (!xs.isDocument()) {
- return DataTypeManager.transformValue(value, xs.getType());
- }
- if (value.getType() == Type.UNKNOWN) {
- Type type = StringToSQLXMLTransform.isXml(value.getCharacterStream());
- value.setType(type);
- }
- if (value.getType() == Type.DOCUMENT || value.getType() == Type.ELEMENT) {
- return DataTypeManager.transformValue(value, xs.getType());
- }
- } catch (SQLException e) {
- throw new FunctionExecutionException(e, e.getMessage());
- } catch (TransformationException e) {
- throw new FunctionExecutionException(e, e.getMessage());
- }
- throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlserialize")); //$NON-NLS-1$
- } else if (expression instanceof XMLQuery) {
- XMLQuery xmlQuery = (XMLQuery)expression;
- boolean emptyOnEmpty = true;
- if (xmlQuery.getEmptyOnEmpty() != null) {
- emptyOnEmpty = xmlQuery.getEmptyOnEmpty();
- }
- try {
- SequenceIterator iter = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getPassing(), tuple);
- return xmlQuery.getXQueryExpression().createXMLType(iter, emptyOnEmpty);
- } catch (TeiidProcessingException e) {
- throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
- } catch (XPathException e) {
- throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
- }
- } else {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0016, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0016, expression.getClass().getName()));
- }
}
public SequenceIterator evaluateXQuery(SaxonXQueryExpression xquery, List<DerivedColumn> cols, List<?> tuple)
@@ -662,30 +724,33 @@
return xquery.evaluateXQuery(contextItem, parameters);
}
- private NameValuePair<Object>[] getNameValuePairs(List tuple, List<DerivedColumn> args)
+ private Evaluator.NameValuePair<Object>[] getNameValuePairs(List tuple, List<DerivedColumn> args, boolean xmlNames)
throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
- NameValuePair<Object>[] nameValuePairs = new NameValuePair[args.size()];
+ Evaluator.NameValuePair<Object>[] nameValuePairs = new Evaluator.NameValuePair[args.size()];
for (int i = 0; i < args.size(); i++) {
DerivedColumn symbol = args.get(i);
String name = symbol.getAlias();
Expression ex = symbol.getExpression();
if (name == null && ex instanceof ElementSymbol) {
name = ((ElementSymbol)ex).getShortName();
+ if (xmlNames) {
+ name = XMLSystemFunctions.escapeName(name, true);
+ }
}
- nameValuePairs[i] = new NameValuePair<Object>(name, internalEvaluate(ex, tuple));
+ nameValuePairs[i] = new Evaluator.NameValuePair<Object>(name, internalEvaluate(ex, tuple));
}
return nameValuePairs;
}
- private NameValuePair<String>[] namespaces(XMLNamespaces namespaces) {
+ private Evaluator.NameValuePair<String>[] namespaces(XMLNamespaces namespaces) {
if (namespaces == null) {
return null;
}
List<NamespaceItem> args = namespaces.getNamespaceItems();
- NameValuePair<String>[] nameValuePairs = new NameValuePair[args.size()];
+ Evaluator.NameValuePair<String>[] nameValuePairs = new Evaluator.NameValuePair[args.size()];
for(int i=0; i < args.size(); i++) {
NamespaceItem item = args.get(i);
- nameValuePairs[i] = new NameValuePair<String>(item.getPrefix(), item.getUri());
+ nameValuePairs[i] = new Evaluator.NameValuePair<String>(item.getPrefix(), item.getUri());
}
return nameValuePairs;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -57,6 +57,7 @@
import javax.xml.xpath.XPathExpressionException;
import net.sf.saxon.om.Item;
+import net.sf.saxon.om.Name11Checker;
import net.sf.saxon.sxpath.XPathEvaluator;
import net.sf.saxon.sxpath.XPathExpression;
import net.sf.saxon.trans.XPathException;
@@ -72,9 +73,11 @@
import org.teiid.core.types.XMLTranslator;
import org.teiid.core.types.XMLType;
import org.teiid.core.types.XMLType.Type;
+import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionMethods;
import org.teiid.query.processor.xml.XMLUtil;
import org.teiid.query.util.CommandContext;
+import org.teiid.translator.WSConnection.Util;
/**
@@ -84,17 +87,7 @@
*/
public class XMLSystemFunctions {
- public static class NameValuePair<T> {
- String name;
- T value;
-
- public NameValuePair(String name, T value) {
- this.name = name;
- this.value = value;
- }
- }
-
- //YEAR 0 in the server timezone. used to determine negative years
+ //YEAR 0 in the server timezone. used to determine negative years
public static long YEAR_ZERO;
static String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss"; //$NON-NLS-1$
@@ -131,34 +124,14 @@
}, Streamable.STREAMING_BATCH_SIZE_IN_BYTES);
return DataTypeManager.transformValue(new XMLType(result), DataTypeManager.DefaultDataClasses.CLOB);
} finally {
- closeSource(styleSource);
- closeSource(xmlSource);
+ Util.closeSource(styleSource);
+ Util.closeSource(xmlSource);
}
}
- private static void closeSource(final Source source) {
- if (!(source instanceof StreamSource)) {
- return;
- }
-
- StreamSource stream = (StreamSource)source;
- try {
- if (stream.getInputStream() != null) {
- stream.getInputStream().close();
- }
- } catch (IOException e) {
- }
- try {
- if (stream.getReader() != null) {
- stream.getReader().close();
- }
- } catch (IOException e) {
- }
- }
-
- public static XMLType xmlForest(final CommandContext context, final NameValuePair[] namespaces, final NameValuePair[] values) throws TeiidComponentException, TeiidProcessingException {
+ public static XMLType xmlForest(final CommandContext context, final Evaluator.NameValuePair[] namespaces, final Evaluator.NameValuePair[] values) throws TeiidComponentException, TeiidProcessingException {
boolean valueExists = false;
- for (NameValuePair nameValuePair : values) {
+ for (Evaluator.NameValuePair nameValuePair : values) {
if (nameValuePair.value != null) {
valueExists = true;
break;
@@ -177,7 +150,7 @@
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
- for (NameValuePair nameValuePair : values) {
+ for (Evaluator.NameValuePair nameValuePair : values) {
if (nameValuePair.value == null) {
continue;
}
@@ -202,7 +175,7 @@
* @throws TeiidProcessingException
*/
public static XMLType xmlElement(CommandContext context, final String name,
- final NameValuePair<String>[] namespaces, final NameValuePair<?>[] attributes, final List<?> contents) throws TeiidComponentException, TeiidProcessingException {
+ final Evaluator.NameValuePair<String>[] namespaces, final Evaluator.NameValuePair<?>[] attributes, final List<?> contents) throws TeiidComponentException, TeiidProcessingException {
XMLType result = new XMLType(XMLUtil.saveToBufferManager(context.getBufferManager(), new XMLTranslator() {
@Override
@@ -224,10 +197,10 @@
}
private static void addElement(final String name, Writer writer, XMLEventWriter eventWriter, XMLEventFactory eventFactory,
- NameValuePair<String> namespaces[], NameValuePair<?> attributes[], List<?> contents) throws XMLStreamException, IOException, TransformerException {
+ Evaluator.NameValuePair<String> namespaces[], Evaluator.NameValuePair<?> attributes[], List<?> contents) throws XMLStreamException, IOException, TransformerException {
eventWriter.add(eventFactory.createStartElement("", null, name)); //$NON-NLS-1$
if (namespaces != null) {
- for (NameValuePair<String> nameValuePair : namespaces) {
+ for (Evaluator.NameValuePair<String> nameValuePair : namespaces) {
if (nameValuePair.name == null) {
if (nameValuePair.value == null) {
eventWriter.add(eventFactory.createNamespace(XMLConstants.NULL_NS_URI));
@@ -240,7 +213,7 @@
}
}
if (attributes != null) {
- for (NameValuePair<?> nameValuePair : attributes) {
+ for (Evaluator.NameValuePair<?> nameValuePair : attributes) {
if (nameValuePair.value != null) {
eventWriter.add(eventFactory.createAttribute(new QName(nameValuePair.name), getStringValue(nameValuePair.value)));
}
@@ -464,7 +437,7 @@
// Return string representation of non-node value
return o.toString();
} finally {
- closeSource(s);
+ Util.closeSource(s);
}
}
@@ -483,4 +456,51 @@
eval.createExpression(xpath);
}
+ public static String escapeName(String name, boolean fully) {
+ StringBuilder sb = new StringBuilder();
+ char[] chars = name.toCharArray();
+ int i = 0;
+ if (fully && name.regionMatches(true, 0, "xml", 0, 3)) { //$NON-NLS-1$
+ sb.append(escapeChar(name.charAt(0)));
+ sb.append(chars, 1, 2);
+ i = 3;
+ }
+ for (; i < chars.length; i++) {
+ char chr = chars[i];
+ switch (chr) {
+ case ':':
+ if (fully || i == 0) {
+ sb.append(escapeChar(chr));
+ continue;
+ }
+ break;
+ case '_':
+ if (chars.length > i && chars[i+1] == 'x') {
+ sb.append(escapeChar(chr));
+ continue;
+ }
+ break;
+ default:
+ //TODO: there should be handling for surrogates
+ // and invalid chars
+ if (i == 0) {
+ if (!Name11Checker.getInstance().isNCNameStartChar(chr)) {
+ sb.append(escapeChar(chr));
+ continue;
+ }
+ } else if (!Name11Checker.getInstance().isNCNameChar(chr)) {
+ sb.append(escapeChar(chr));
+ continue;
+ }
+ break;
+ }
+ sb.append(chr);
+ }
+ return sb.toString();
+ }
+
+ private static String escapeChar(char chr) {
+ return "_u00" + Integer.toHexString(chr).toUpperCase() + "_"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -122,7 +122,7 @@
private TempMetadataID createElementSymbol(String tempName, SingleElementSymbol symbol, boolean isTempTable) {
// Create new element name
- String elementName = tempName + SingleElementSymbol.SEPARATOR + symbol.getShortCanonicalName();
+ String elementName = tempName + SingleElementSymbol.SEPARATOR + symbol.getShortName();
Object metadataID = null;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -49,7 +49,7 @@
}
/**
- * If the result set named rsName does not exist yet in the {@link ProcessorEnvironment}, then
+ * If the result set named rsName does not exist yet in the {@link ProcedurePlan}, then
* this instruction will define that result set. It will then throw a BlockedException if
* this result set is selecting from other than temp groups (because those results will be
* delivered asynchronously). IF the result set named rsName does already exist, this
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -243,6 +243,10 @@
return null;
}
+ if (!(constant.getValue() instanceof Comparable)) {
+ return null; //this is the case for xml constants
+ }
+
Constant reverse = getProperlyTypedConstant(result.getValue(), constant.getType());
if (((Comparable)constant.getValue()).compareTo(reverse.getValue()) == 0) {
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -58,10 +58,12 @@
import org.teiid.query.sql.navigator.PostOrderNavigator;
import org.teiid.query.sql.symbol.CaseExpression;
import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.DerivedColumn;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.XMLQuery;
@@ -348,6 +350,18 @@
handleException(e);
}
}
+
+ @Override
+ public void visit(QueryString obj) {
+ try {
+ obj.setPath(ResolverUtil.convertExpression(obj.getPath(), DataTypeManager.DefaultDataTypes.STRING, metadata));
+ for (DerivedColumn col : obj.getArgs()) {
+ col.setExpression(ResolverUtil.convertExpression(col.getExpression(), DataTypeManager.DefaultDataTypes.STRING, metadata));
+ }
+ } catch (QueryResolverException e) {
+ handleException(new QueryResolverException(e, QueryPlugin.Util.getString("XMLQuery.resolvingError", obj))); //$NON-NLS-1$
+ }
+ }
public TeiidComponentException getComponentException() {
return this.componentException;
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -134,6 +134,7 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
@@ -1912,6 +1913,8 @@
rewriteExpressions(expression);
} else if (expression instanceof XMLQuery) {
rewriteExpressions(expression);
+ } else if (expression instanceof QueryString) {
+ rewriteExpressions(expression);
}
if(dataMgr == null) {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -134,4 +134,5 @@
public void visit(DerivedColumn obj) {}
public void visit(XMLSerialize obj) {}
public void visit(XMLQuery obj) {}
+ public void visit(QueryString obj) {}
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -172,6 +172,7 @@
@Override
public XMLTable clone() {
XMLTable clone = new XMLTable();
+ this.copy(clone);
for (XMLColumn column : columns) {
clone.getColumns().add(column.clone());
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -91,6 +91,7 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
@@ -584,6 +585,14 @@
postVisitVisitor(obj);
}
+ @Override
+ public void visit(QueryString obj) {
+ preVisitVisitor(obj);
+ visitNode(obj.getPath());
+ visitNodes(obj.getArgs());
+ postVisitVisitor(obj);
+ }
+
public static void doVisit(LanguageObject object, LanguageVisitor visitor, boolean order) {
PreOrPostOrderNavigator nav = new PreOrPostOrderNavigator(visitor, order);
object.acceptVisitor(nav);
Added: trunk/engine/src/main/java/org/teiid/query/sql/symbol/QueryString.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/QueryString.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/QueryString.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,105 @@
+/*
+ * 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 org.teiid.query.sql.symbol;
+
+import java.util.List;
+
+import org.teiid.core.types.DataTypeManager.DefaultDataClasses;
+import org.teiid.query.sql.LanguageObject;
+import org.teiid.query.sql.LanguageVisitor;
+import org.teiid.query.sql.visitor.SQLStringVisitor;
+
+/**
+ * Represents XMLATTRIBUTES name value pairs
+ */
+public class QueryString implements Expression {
+
+ private static final long serialVersionUID = -3348922701950966494L;
+ private List<DerivedColumn> args;
+ private Expression path;
+
+ public QueryString(Expression path, List<DerivedColumn> args) {
+ this.args = args;
+ this.path = path;
+ }
+
+ public List<DerivedColumn> getArgs() {
+ return args;
+ }
+
+ @Override
+ public QueryString clone() {
+ QueryString clone = new QueryString((Expression)path.clone(), LanguageObject.Util.deepClone(args, DerivedColumn.class));
+ return clone;
+ }
+
+ @Override
+ public int hashCode() {
+ return path.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof QueryString)) {
+ return false;
+ }
+ QueryString other = (QueryString)obj;
+ return path.equals(other.path) && args.equals(other.args);
+ }
+
+ @Override
+ public void acceptVisitor(LanguageVisitor visitor) {
+ visitor.visit(this);
+ }
+
+ public Expression getPath() {
+ return path;
+ }
+
+ public void setPath(Expression path) {
+ this.path = path;
+ }
+
+ @Override
+ public String toString() {
+ return SQLStringVisitor.getSQLString(this);
+ }
+
+ @Override
+ public Class<?> getType() {
+ return DefaultDataClasses.STRING;
+ }
+
+ @Override
+ public boolean isResolved() {
+ for (DerivedColumn col : args) {
+ if (!col.getExpression().isResolved()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/sql/symbol/QueryString.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLAttributes.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLAttributes.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLAttributes.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -24,7 +24,6 @@
import java.util.List;
-import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
@@ -54,7 +53,7 @@
@Override
public int hashCode() {
- return HashCodeUtil.hashCode(args.hashCode());
+ return args.hashCode();
}
public boolean equals(Object obj) {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLForest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLForest.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLForest.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -25,6 +25,7 @@
import java.util.List;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
@@ -75,6 +76,9 @@
@Override
public XMLForest clone() {
XMLForest clone = new XMLForest(LanguageObject.Util.deepClone(args, DerivedColumn.class));
+ if (namespaces != null) {
+ clone.namespaces = namespaces.clone();
+ }
return clone;
}
@@ -91,7 +95,7 @@
return false;
}
XMLForest other = (XMLForest)obj;
- return args.equals(other.args);
+ return args.equals(other.args) && EquivalenceUtil.areEqual(namespaces, other.namespaces);
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLSerialize.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLSerialize.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLSerialize.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -84,6 +84,10 @@
@Override
public XMLSerialize clone() {
XMLSerialize clone = new XMLSerialize();
+ clone.document = this.document;
+ clone.expression = (Expression)this.expression.clone();
+ clone.typeString = this.typeString;
+ clone.type = this.type;
return clone;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/ExpressionMappingVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/ExpressionMappingVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/ExpressionMappingVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -61,6 +61,7 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.symbol.XMLElement;
@@ -327,6 +328,11 @@
obj.setValue(replaceExpression(obj.getValue()));
}
+ @Override
+ public void visit(QueryString obj) {
+ obj.setPath(replaceExpression(obj.getPath()));
+ }
+
/**
* The object is modified in place, so is not returned.
* @param obj Language object
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -111,6 +111,7 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
@@ -1722,18 +1723,18 @@
parts.add(NonReserved.ORDINALITY);
} else {
parts.add(col.getType());
+ if (col.getDefaultExpression() != null) {
+ parts.add(SPACE);
+ parts.add(DEFAULT);
+ parts.add(SPACE);
+ parts.add(registerNode(col.getDefaultExpression()));
+ }
if (col.getPath() != null) {
parts.add(SPACE);
parts.add(NonReserved.PATH);
parts.add(SPACE);
parts.add(new Constant(col.getPath()));
}
- if (col.getDefaultExpression() != null) {
- parts.add(SPACE);
- parts.add(DEFAULT);
- parts.add(SPACE);
- parts.add(registerNode(col.getDefaultExpression()));
- }
}
if (cols.hasNext()) {
parts.add(","); //$NON-NLS-1$
@@ -1807,6 +1808,19 @@
}
parts.add(Tokens.RPAREN);
}
+
+ @Override
+ public void visit(QueryString obj) {
+ parts.add(NonReserved.QUERYSTRING);
+ parts.add("("); //$NON-NLS-1$
+ parts.add(registerNode(obj.getPath()));
+ if (!obj.getArgs().isEmpty()) {
+ parts.add(","); //$NON-NLS-1$
+ parts.add(SPACE);
+ registerNodes(obj.getArgs(), 0);
+ }
+ parts.add(")"); //$NON-NLS-1$
+ }
public static String escapeSinglePart(String part) {
if(isReservedWord(part)) {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -31,6 +31,8 @@
import java.util.Map;
import java.util.Set;
+import net.sf.saxon.om.Name11Checker;
+import net.sf.saxon.om.QNameException;
import net.sf.saxon.trans.XPathException;
import org.teiid.api.exception.query.ExpressionEvaluationException;
@@ -101,9 +103,11 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.symbol.XMLAttributes;
+import org.teiid.query.sql.symbol.XMLElement;
import org.teiid.query.sql.symbol.XMLForest;
import org.teiid.query.sql.symbol.XMLNamespaces;
import org.teiid.query.sql.symbol.XMLQuery;
@@ -1140,23 +1144,63 @@
@Override
public void visit(XMLForest obj) {
+ validateDerivedColumnNames(obj, obj.getArgs());
for (DerivedColumn dc : obj.getArgs()) {
+ if (dc.getAlias() == null) {
+ continue;
+ }
+ validateQName(obj, dc.getAlias());
+ }
+ }
+
+ private String[] validateQName(LanguageObject obj, String name) {
+ try {
+ return Name11Checker.getInstance().getQNameParts(name);
+ } catch (QNameException e) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.xml_invalid_qname", name), obj); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ private void validateDerivedColumnNames(LanguageObject obj, List<DerivedColumn> cols) {
+ for (DerivedColumn dc : cols) {
if (dc.getAlias() == null && !(dc.getExpression() instanceof ElementSymbol)) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.expression_requires_name"), obj); //$NON-NLS-1$
- }
+ }
}
- }
+ }
@Override
public void visit(XMLAttributes obj) {
+ validateDerivedColumnNames(obj, obj.getArgs());
for (DerivedColumn dc : obj.getArgs()) {
- if (dc.getAlias() == null && !(dc.getExpression() instanceof ElementSymbol)) {
- handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.expression_requires_name"), obj); //$NON-NLS-1$
- }
+ if (dc.getAlias() == null) {
+ continue;
+ }
+ if ("xmlns".equals(dc.getAlias())) { //$NON-NLS-1$
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.xml_attributes_reserved"), obj); //$NON-NLS-1$
+ }
+ String[] parts = validateQName(obj, dc.getAlias());
+ if (parts == null) {
+ continue;
+ }
+ if ("xmlns".equals(parts[0])) { //$NON-NLS-1$
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.xml_attributes_reserved", dc.getAlias()), obj); //$NON-NLS-1$
+ }
}
}
@Override
+ public void visit(XMLElement obj) {
+ validateQName(obj, obj.getName());
+ }
+
+ @Override
+ public void visit(QueryString obj) {
+ validateDerivedColumnNames(obj, obj.getArgs());
+ }
+
+ @Override
public void visit(XMLTable obj) {
List<DerivedColumn> passing = obj.getPassing();
validatePassing(obj, obj.getXQueryExpression(), passing);
Modified: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/PathMapFilter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/PathMapFilter.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/PathMapFilter.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -9,7 +9,6 @@
import net.sf.saxon.expr.PathMap.PathMapNode;
import net.sf.saxon.expr.PathMap.PathMapRoot;
import net.sf.saxon.om.Axis;
-import net.sf.saxon.om.Item;
import net.sf.saxon.pattern.NodeTest;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.type.Type;
@@ -186,9 +185,4 @@
}
}
- @Override
- public void append(Item item, int locationId,
- int copyNamespaces) throws XPathException {
- super.append(item, locationId, copyNamespaces);
- }
}
\ No newline at end of file
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-10 04:01:14 UTC (rev 2212)
@@ -2162,12 +2162,12 @@
}
) | (
datatype = dataType()
+ [
+ <DEFAULT_KEYWORD> defaultExpr = expression(info)
+ ]
[
nonReserved("PATH") path = stringVal()
]
- [
- <DEFAULT_KEYWORD> defaultExpr = expression(info)
- ]
{
return new XMLTable.XMLColumn(name, (String)datatype.getValue(), path, defaultExpr);
}
@@ -3226,7 +3226,7 @@
expression = null;
}
<RPAREN>
- )
+ )
|
LOOKAHEAD(<ID>, {matchesAny(getToken(1).image, "timestampadd", "timestampdiff") != null}) (
funcName = nonReserved("TIMESTAMPADD", "TIMESTAMPDIFF")
@@ -3249,8 +3249,13 @@
expression = null;
}
<RPAREN>
- )
+ )
|
+ LOOKAHEAD(<ID>, {getToken(1).image.equalsIgnoreCase("querystring")}) expression = queryString(info)
+ {
+ return expression;
+ }
+ |
(
(funcToken = <LEFT> | funcToken = <RIGHT> | funcToken = <CHAR> | funcToken = <USER>
| funcToken = <YEAR> | funcToken = <MONTH> | funcToken = <HOUR>
@@ -3380,6 +3385,27 @@
}
}
+QueryString queryString(ParseInfo info) :
+{
+ Expression path = null;
+ DerivedColumn arg = null;
+ ArrayList<DerivedColumn> args = new ArrayList<DerivedColumn>();
+}
+{
+ nonReserved("QUERYSTRING") <LPAREN>
+ path = expression(info)
+ (<COMMA> arg=derivedColumn(info)
+ {
+ args.add(arg);
+ arg = null;
+ }
+ )*
+ <RPAREN>
+ {
+ return new QueryString(path, args);
+ }
+}
+
XMLElement xmlElement(ParseInfo info) :
{
String name = null;
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-10 04:01:14 UTC (rev 2212)
@@ -279,7 +279,7 @@
ERR.015.012.0025 = Command must project at least one symbol
ERR.015.012.0026 = Expressions of type OBJECT, CLOB, BLOB, or XML cannot be used in SELECT DISTINCT, ORDER BY, GROUP BY, or non-all set queries: [{0}]
ERR.015.012.0027 = Expressions of type OBJECT, CLOB, BLOB, or XML cannot be used in comparison: {0}.
-ValidationVisitor.expression_requires_name = Non-column expressions require a name in XMLATTRIBUTES, XMLFOREST, or XMLTABLE
+ValidationVisitor.expression_requires_name = Non-column expressions require a name in XMLATTRIBUTES, XMLFOREST, or QUERYSTRING
ValidationVisitor.invalid_lookup_key=Expressions of type OBJECT, CLOB, BLOB, or XML cannot be used as LOOKUP key columns: {0}.
ValidationVisitor.limit_not_valid_for_xml=The limit clause cannot be used on an XML document query.
ValidationVisitor.translated_or=Translated user criteria must not contain OR criteria
@@ -816,6 +816,7 @@
ExpressionEvaluator.Must_push=Function {0} is marked in the function metadata as a function that must be evaluated at the source.
ExpressionEvaluator.Eval_failed=Unable to evaluate {0}: {1}
XMLSerialize.resolvingError=XMLSerialize is valid only for XML expressions: {0}
+QueryString.resolvingError=All query string expressions must be convertable to string.
Evaluator.xmlserialize=XMLSerialize: data exception - not an xml document
Evaluator.xmlquery=Error evaluating XMLQuery: {0}
Evaluator.xmlquery_content=XQuery evaluation was expected to return content, but it returned a sequence.
@@ -893,7 +894,9 @@
ValidationVisitor.text_table_delimiter=Text table DELIMITER cannot be the same as the QUOTE or ESCAPE characters.
ValidationVisitor.text_table_newline=Text table DELIMITER, QUOTE, and ESCAPE characters cannot be the new line character.
ValidationVisitor.xml_namespaces=At most only one NO DEFAULT or DEFAULT namespace may be specified.
-ValidationVisitor.xml_namespaces_reserved=At most only one NO DEFAULT or DEFAULT namespace may be specified.
+ValidationVisitor.xml_namespaces_reserved=The namespaces xmlns and xml are reserved.
+ValidationVisitor.xml_attributes_reserved=The namespace xmlns is reserved.
+ValidationVisitor.xml_invalid_qname=The qname "{0}" is invalid.
ValidationVisitor.context_item_type=XMLTABLE or XMLQUERY PASSING context item must be an XML value.
ValidationVisitor.passing_requires_name=XMLTABLE or XMLQUERY PASSING clause can only contain at most 1 unnamed item.
ValidationVisitor.duplicate_passing=XMLTABLE or XMLQUERY PASSING clause duplicate item name "{0}".
Modified: trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -25,8 +25,6 @@
import static org.junit.Assert.*;
import java.io.File;
-import java.io.Reader;
-import java.io.StringReader;
import java.sql.Timestamp;
import java.util.TimeZone;
@@ -203,6 +201,14 @@
assertEquals("1969-12-31T18:00:00", XMLSystemFunctions.getStringValue(new Timestamp(0)));
}
+ @Test public void testNameEscaping() throws Exception {
+ assertEquals("_u003A_b", XMLSystemFunctions.escapeName(":b", true));
+ }
+
+ @Test public void testNameEscaping1() throws Exception {
+ assertEquals("a_u005F_x", XMLSystemFunctions.escapeName("a_x", true));
+ }
+
@BeforeClass static public void setUpOnce() {
TimeZone.setDefault(TimeZone.getTimeZone("GMT-6:00"));
}
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -135,6 +135,7 @@
assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
assertEquals("Command objects do not match: ", expectedCommand, actualCommand); //$NON-NLS-1$
+ assertEquals("Cloned command objects do not match: ", expectedCommand, actualCommand.clone()); //$NON-NLS-1$
}
static void helpTestExpression(String sql, String expectedString, Expression expected) throws QueryParserException {
@@ -143,6 +144,7 @@
assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
assertEquals("Command objects do not match: ", expected, actual); //$NON-NLS-1$
+ assertEquals("Cloned command objects do not match: ", expected, actual.clone()); //$NON-NLS-1$
}
static void helpException(String sql) {
@@ -200,7 +202,7 @@
new ElementSymbol("g1.a1"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("g2.a2")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g1, g2, JoinType.JOIN_INNER, crits);
From from = new From();
@@ -398,7 +400,7 @@
new ElementSymbol("g2.a"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("g3.a")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g2, g3, JoinType.JOIN_INNER, crits);
From from = new From();
@@ -425,7 +427,7 @@
new ElementSymbol("myG.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("myH.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_RIGHT_OUTER, crits);
From from = new From();
@@ -452,7 +454,7 @@
new ElementSymbol("myG.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("myH.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_RIGHT_OUTER, crits);
From from = new From();
@@ -479,7 +481,7 @@
new ElementSymbol("myG.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("myH.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_LEFT_OUTER, crits);
From from = new From();
@@ -506,7 +508,7 @@
new ElementSymbol("myG.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("myH.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_LEFT_OUTER, crits);
From from = new From();
@@ -533,7 +535,7 @@
new ElementSymbol("myG.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("myH.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_FULL_OUTER, crits);
From from = new From();
@@ -560,7 +562,7 @@
new ElementSymbol("g.x"), //$NON-NLS-1$
CompareCriteria.EQ,
new ElementSymbol("h.x")); //$NON-NLS-1$
- ArrayList crits = new ArrayList();
+ ArrayList<Criteria> crits = new ArrayList<Criteria>();
crits.add(jcrit);
JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_FULL_OUTER, crits);
From from = new From();
@@ -6736,7 +6738,7 @@
@Test public void testXmlNamespaces() throws Exception {
XMLForest f = new XMLForest(Arrays.asList(new DerivedColumn("table", new ElementSymbol("a"))));
- f.setNamespaces(new XMLNamespaces(Arrays.asList(new XMLNamespaces.NamespaceItem(), new XMLNamespaces.NamespaceItem("x", "http://foo"))));
+ f.setNamespaces(new XMLNamespaces(Arrays.asList(new XMLNamespaces.NamespaceItem(), new XMLNamespaces.NamespaceItem("http://foo", "x"))));
helpTestExpression("xmlforest(xmlnamespaces(no default, 'http://foo' as x), a as \"table\")", "XMLFOREST(XMLNAMESPACES(NO DEFAULT, 'http://foo' AS x), a AS \"table\")", f);
}
@@ -6792,7 +6794,7 @@
}
@Test public void testXMLTable() throws Exception {
- String sql = "SELECT * from xmltable(xmlnamespaces(no default), '/' columns x for ordinality, y date path '@date' default {d'2000-01-01'}) as x"; //$NON-NLS-1$
+ String sql = "SELECT * from xmltable(xmlnamespaces(no default), '/' columns x for ordinality, y date default {d'2000-01-01'} path '@date') as x"; //$NON-NLS-1$
Query query = new Query();
query.setSelect(new Select(Arrays.asList(new AllSymbol())));
XMLTable xt = new XMLTable();
@@ -6804,7 +6806,7 @@
columns.add(new XMLTable.XMLColumn("y", "date", "@date", new Constant(Date.valueOf("2000-01-01"))));
xt.setColumns(columns);
query.setFrom(new From(Arrays.asList(xt)));
- helpTest(sql, "SELECT * FROM XMLTABLE(XMLNAMESPACES(NO DEFAULT), '/' COLUMNS x FOR ORDINALITY, y date PATH '@date' DEFAULT {d'2000-01-01'}) AS x", query);
+ helpTest(sql, "SELECT * FROM XMLTABLE(XMLNAMESPACES(NO DEFAULT), '/' COLUMNS x FOR ORDINALITY, y date DEFAULT {d'2000-01-01'} PATH '@date') AS x", query);
}
@Test public void testXmlSerialize() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -27,8 +27,8 @@
import java.util.Arrays;
import java.util.List;
+import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.core.TeiidProcessingException;
import org.teiid.query.unittest.FakeMetadataFactory;
@SuppressWarnings({"nls", "unchecked"})
@@ -41,12 +41,7 @@
Arrays.asList("<foo><bar><bar1/></foo>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
/**
@@ -60,15 +55,10 @@
Arrays.asList("<foo><bar><bar1></bar1></foo>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElement() {
+ @Test public void testXmlElement() throws Exception {
String sql = "SELECT xmlelement(e1, e2) from pm1.g1 order by e1, e2"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -80,15 +70,10 @@
Arrays.asList("<e1>1</e1>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElementWithConcat() {
+ @Test public void testXmlElementWithConcat() throws Exception {
String sql = "SELECT xmlelement(e1, e2, xmlconcat(xmlelement(x), xmlelement(y, e3))) from pm1.g1 order by e1, e2"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -100,15 +85,10 @@
Arrays.asList("<e1>1<x></x><y>true</y></e1>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElementWithForest() {
+ @Test public void testXmlElementWithForest() throws Exception {
String sql = "SELECT xmlelement(x, xmlforest(e1, e2, '1' as val)) from pm1.g1 order by e1, e2 limit 2"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -116,15 +96,10 @@
Arrays.asList("<x><e1>a</e1><e2>0</e2><val>1</val></x>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElementWithAttributes() {
+ @Test public void testXmlElementWithAttributes() throws Exception {
String sql = "SELECT xmlelement(x, xmlattributes(e1, e2, '1' as val)) from pm1.g1 order by e1, e2 limit 2"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -132,30 +107,20 @@
Arrays.asList("<x e1=\"a\" e2=\"0\" val=\"1\"></x>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElementWithPi() {
+ @Test public void testXmlElementWithPi() throws Exception {
String sql = "SELECT xmlelement(x, xmlpi(name e1, ' 1'))"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<x><?e1 1?></x>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlElementWithNamespaces() {
+ @Test public void testXmlElementWithNamespaces() throws Exception {
String sql = "SELECT xmlelement(x, xmlnamespaces(no default, 'http://foo' as x, 'http://foo1' as y), xmlattributes(e1), e2) from pm1.g1 order by e1, e2 limit 2"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -163,60 +128,40 @@
Arrays.asList("<x xmlns=\"\" xmlns:x=\"http://foo\" xmlns:y=\"http://foo1\" e1=\"a\">0</x>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlAgg() {
+ @Test public void testXmlAgg() throws Exception {
String sql = "SELECT xmlelement(parent, xmlAgg(xmlelement(x, xmlattributes(e1, e2)))) from pm1.g1"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<parent><x e1=\"a\" e2=\"0\"></x><x e2=\"1\"></x><x e1=\"a\" e2=\"3\"></x><x e1=\"c\" e2=\"1\"></x><x e1=\"b\" e2=\"2\"></x><x e1=\"a\" e2=\"0\"></x></parent>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlAggOrderBy() {
+ @Test public void testXmlAggOrderBy() throws Exception {
String sql = "SELECT xmlelement(parent, xmlAgg(xmlelement(x, xmlattributes(e1, e2)) order by e2)) from pm1.g1"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<parent><x e1=\"a\" e2=\"0\"></x><x e1=\"a\" e2=\"0\"></x><x e2=\"1\"></x><x e1=\"c\" e2=\"1\"></x><x e1=\"b\" e2=\"2\"></x><x e1=\"a\" e2=\"3\"></x></parent>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlSerialize() {
+ @Test public void testXmlSerialize() throws Exception {
String sql = "SELECT xmlserialize(document xmlelement(parent) as string)"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<parent></parent>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTable() {
+ @Test public void testXmlTable() throws Exception {
String sql = "select * from xmltable('/a/b' passing convert('<a><b>first</b><b x=\"attr\">second</b></a>', xml) columns x string path '@x', val string path '/.') as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -224,31 +169,21 @@
Arrays.asList("attr", "second"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTableDefaultAndParent() {
- String sql = "select * from xmltable('/a/b' passing convert('<a y=\"rev\"><b>first</b><b x=\"1\">second</b></a>', xml) columns x integer path '@x' default -1, val string path '../@y') as x"; //$NON-NLS-1$
+ @Test public void testXmlTableDefaultAndParent() throws Exception {
+ String sql = "select * from xmltable('/a/b' passing convert('<a y=\"rev\"><b>first</b><b x=\"1\">second</b></a>', xml) columns x integer default -1 path '@x' , val string path '../@y') as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList(-1, "rev"),
Arrays.asList(1, "rev"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTableReturnXml() {
+ @Test public void testXmlTableReturnXml() throws Exception {
String sql = "select * from xmltable('/a/b' passing convert('<a><b>first</b><b x=\"1\">second</b></a>', xml) columns val xml path '.') as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -256,45 +191,30 @@
Arrays.asList("<b x=\"1\">second</b>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTableNoColumns() {
+ @Test public void testXmlTableNoColumns() throws Exception {
String sql = "select * from xmltable('/a' passing convert('<a><b>first</b><b x=\"1\">second</b></a>', xml)) as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<a><b>first</b><b x=\"1\">second</b></a>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTablePassing() {
+ @Test public void testXmlTablePassing() throws Exception {
String sql = "select * from xmltable('<root>{for $x in $a/a/b return <c>{$x}</c>}</root>' passing convert('<a><b>first</b><b x=\"1\">second</b></a>', xml) as a columns x xml path 'c[1]/b') as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("<b>first</b>"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTableForOrdinalityAndDefaultPath() {
+ @Test public void testXmlTableForOrdinalityAndDefaultPath() throws Exception {
String sql = "select * from xmltable('/a/b' passing convert('<a><b><c>1</c></b><b>1</b><b><c>1</c></b><b>1</b></a>', xml) columns x for ordinality, c integer) as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
@@ -304,42 +224,27 @@
Arrays.asList(4, null),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlTableDescendantPath() {
+ @Test public void testXmlTableDescendantPath() throws Exception {
String sql = "select * from xmltable('<a>{for $i in (1 to 5) return $i}</a>' columns x string path '//text()') as x"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("1 2 3 4 5"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
- @Test public void testXmlQuery() {
+ @Test public void testXmlQuery() throws Exception {
String sql = "select xmlquery('for $i in (1 to 5) return $i')"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("1 2 3 4 5"),
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
+ process(sql, expected);
}
@Test public void testXmlQueryEmptyNull() throws Exception {
@@ -349,12 +254,29 @@
Arrays.asList((String)null)
};
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
+ process(sql, expected);
+ }
+
+ @Test public void testXmlNameEscaping() throws Exception {
+ String sql = "select xmlforest(\"xml\") from (select 1 as \"xml\") x"; //$NON-NLS-1$
+ List<?>[] expected = new List<?>[] {
+ Arrays.asList("<_u0078_ml>1</_u0078_ml>")
+ };
+
+ process(sql, expected);
+ }
+
+ private static FakeDataManager dataManager = new FakeDataManager();
+
+ @BeforeClass public static void oneTimeSetUp() {
+ sampleData1(dataManager);
+ }
+
+ private void process(String sql, List<?>[] expected) throws Exception {
ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
helpProcess(plan, createCommandContext(), dataManager, expected);
- }
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -953,11 +953,11 @@
List elements = (List) ElementCollectorVisitor.getElements(resolvedQuery.getSelect(), false);
ElementSymbol elem1 = (ElementSymbol)elements.get(0);
- assertEquals("Did not get expected element", "X.E1", elem1.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Did not get expected element", "X.e1", elem1.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Did not get expected type", DataTypeManager.DefaultDataClasses.STRING, elem1.getType()); //$NON-NLS-1$
ElementSymbol elem2 = (ElementSymbol)elements.get(1);
- assertEquals("Did not get expected element", "X.E2", elem2.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Did not get expected element", "X.e2", elem2.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Did not get expected type", DataTypeManager.DefaultDataClasses.INTEGER, elem2.getType()); //$NON-NLS-1$
}
@@ -2719,7 +2719,7 @@
Command cmd = helpResolve(proc.toString());
- String sExpected = "CREATE VIRTUAL PROCEDURE\nBEGIN\nCREATE LOCAL TEMPORARY TABLE #matt (x integer);\nINSERT INTO #matt (#MATT.X) VALUES (1);\nEND\n\tCREATE LOCAL TEMPORARY TABLE #matt (x integer)\n\tINSERT INTO #matt (#MATT.X) VALUES (1)\n"; //$NON-NLS-1$
+ String sExpected = "CREATE VIRTUAL PROCEDURE\nBEGIN\nCREATE LOCAL TEMPORARY TABLE #matt (x integer);\nINSERT INTO #matt (#MATT.x) VALUES (1);\nEND\n\tCREATE LOCAL TEMPORARY TABLE #matt (x integer)\n\tINSERT INTO #matt (#MATT.x) VALUES (1)\n"; //$NON-NLS-1$
String sActual = cmd.printCommandTree();
assertEquals( sExpected, sActual );
}
@@ -2946,4 +2946,8 @@
assertEquals(1, command.getProjectedSymbols().size());
}
+ @Test public void testQueryString() throws Exception {
+ helpResolveException("select querystring({x '<a/>'})");
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/query/rewriter/TestOrderByRewrite.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/rewriter/TestOrderByRewrite.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/rewriter/TestOrderByRewrite.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -309,7 +309,7 @@
@Test public void testOrderByExpression() throws Exception {
Query resolvedQuery = (Query) getCommand("SELECT 0 AS SOMEINT, pm1.g1.e2 as y FROM pm1.g1 ORDER BY e2 || e1, e3"); //$NON-NLS-1$
- assertEquals("SELECT X_1.SOMEINT, X_1.Y FROM (SELECT 0 AS SOMEINT, pm1.g1.e2 AS y, (e2 || e1) AS EXPR1, e3 FROM pm1.g1) AS X_1 ORDER BY X_1.EXPR1, X_1.E3", resolvedQuery.toString()); //$NON-NLS-1$
+ assertEquals("SELECT X_1.SOMEINT, X_1.y FROM (SELECT 0 AS SOMEINT, pm1.g1.e2 AS y, (e2 || e1) AS EXPR1, e3 FROM pm1.g1) AS X_1 ORDER BY X_1.EXPR1, X_1.e3", resolvedQuery.toString()); //$NON-NLS-1$
}
@Test public void testRewiteOrderBy() {
Modified: trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -1931,7 +1931,7 @@
@Test public void testRewriteSelectInto() {
String sql = "select distinct pm1.g1.e1 into #temp from pm1.g1"; //$NON-NLS-1$
- String expected = "INSERT INTO #temp (#TEMP.E1) SELECT DISTINCT pm1.g1.e1 FROM pm1.g1"; //$NON-NLS-1$
+ String expected = "INSERT INTO #temp (#TEMP.e1) SELECT DISTINCT pm1.g1.e1 FROM pm1.g1"; //$NON-NLS-1$
helpTestRewriteCommand(sql, expected);
}
@@ -1941,7 +1941,7 @@
*/
@Test public void testRewriteSelectInto1() {
String sql = "select distinct e2, e2, e3, e4 into pm1.g1 from pm1.g2"; //$NON-NLS-1$
- String expected = "INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4) SELECT PM1_G1_1.E2 AS e1, PM1_G1_1.E2_0 AS e2, PM1_G1_1.E3, PM1_G1_1.E4 FROM (SELECT DISTINCT e2, e2 AS E2_0, e3, e4 FROM pm1.g2) AS pm1_g1_1"; //$NON-NLS-1$
+ String expected = "INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4) SELECT PM1_G1_1.e2 AS e1, PM1_G1_1.E2_0 AS e2, PM1_G1_1.e3, PM1_G1_1.e4 FROM (SELECT DISTINCT e2, e2 AS E2_0, e3, e4 FROM pm1.g2) AS pm1_g1_1"; //$NON-NLS-1$
helpTestRewriteCommand(sql, expected);
}
@@ -1998,7 +1998,7 @@
procedure += "Select x from temp;\n"; //$NON-NLS-1$
procedure += "END\n"; //$NON-NLS-1$
- helpTestRewriteCommand(procedure, "CREATE VIRTUAL PROCEDURE\nBEGIN\nCREATE LOCAL TEMPORARY TABLE temp (x string, y integer, z integer);\nINSERT INTO temp (TEMP.X, TEMP.Y, TEMP.Z) SELECT TEMP_1.E2 AS X, TEMP_1.X AS Y, TEMP_1.X_0 AS Z FROM (SELECT pm1.g1.e2, 1 AS x, 2 AS X_0 FROM pm1.g1 ORDER BY pm1.g1.e2 LIMIT 1) AS temp_1;\nSELECT x FROM temp;\nEND"); //$NON-NLS-1$
+ helpTestRewriteCommand(procedure, "CREATE VIRTUAL PROCEDURE\nBEGIN\nCREATE LOCAL TEMPORARY TABLE temp (x string, y integer, z integer);\nINSERT INTO temp (TEMP.x, TEMP.y, TEMP.z) SELECT TEMP_1.e2 AS x, TEMP_1.x AS y, TEMP_1.X_0 AS z FROM (SELECT pm1.g1.e2, 1 AS x, 2 AS X_0 FROM pm1.g1 ORDER BY pm1.g1.e2 LIMIT 1) AS temp_1;\nSELECT x FROM temp;\nEND"); //$NON-NLS-1$
}
@Test public void testRewriteNot() {
@@ -2290,5 +2290,11 @@
QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
helpTestRewriteCommand(original, "SELECT * FROM XMLTABLE('/' PASSING 2 AS a COLUMNS x string DEFAULT curdate()) AS x", metadata);
}
+
+ @Test public void testRewriteQueryString() throws Exception {
+ String original = "querystring('path', 'value' as \"&x\", ' & ' as y, null as z)"; //$NON-NLS-1$
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+ helpTestRewriteExpression(original, "'path?%26x=value&y=%20%26%20'", metadata);
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-09 16:37:31 UTC (rev 2211)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -2022,5 +2022,13 @@
@Test public void testXMLQueryPassingContextType() {
helpValidate("select xmlquery('/' passing 2)", new String[] {"XMLQUERY('/' PASSING 2)"}, FakeMetadataFactory.example1Cached());
}
+
+ @Test public void testQueryString() {
+ helpValidate("select querystring('/', '1')", new String[] {"QUERYSTRING('/', '1')"}, FakeMetadataFactory.example1Cached());
+ }
+ @Test public void testXmlNameValidation() throws Exception {
+ helpValidate("select xmlelement(\":\")", new String[] {"XMLELEMENT(NAME \":\")"}, FakeMetadataFactory.example1Cached());
+ }
+
}
Added: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java 2010-06-10 04:01:14 UTC (rev 2212)
@@ -0,0 +1,61 @@
+/*
+ * 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 org.teiid.jdbc;
+
+import static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.teiid.jdbc.util.ResultSetUtil;
+@SuppressWarnings("nls")
+public class TestStuff {
+
+ @Ignore
+ @Test public void testNoExec() throws Exception {
+ Connection c = DriverManager.getConnection("jdbc:teiid:tpcrperf@mm://localhost:31000", "admin", "teiid");
+ Statement s = c.createStatement();
+ long start = System.currentTimeMillis();
+ //s.execute("set noexec on");
+ s.execute("set showplan debug");
+ DatabaseMetaData dmd = c.getMetaData();
+
+ //ResultSetUtil.printResultSet(s.executeQuery("select * from TPCR01_OraclePhys.NATION"), 20, false, System.out);
+ ResultSetUtil.printResultSet(s.executeQuery("select * from tables"), 20, false, System.out);
+
+ //ResultSet rs = s.executeQuery("SELECT ORDERS.O_ORDERKEY, ORDERS.O_ORDERDATE, ORDERS.O_CLERK, CUSTOMER.C_CUSTKEY, CUSTOMER.C_NAME FROM TPCR01_SqlServerVirt.TPCR01.ORDERS,TPCR01_SqlServerVirt.TPCR01.CUSTOMER WHERE (CUSTOMER.C_CUSTKEY = ORDERS.O_CUSTKEY) AND (O_ORDERKEY < 2)");
+ System.out.println(System.currentTimeMillis() - start);
+
+ System.out.println(s.unwrap(TeiidStatement.class).getDebugLog());
+ System.out.println(s.unwrap(TeiidStatement.class).getPlanDescription());
+ s.close();
+ c.close();
+ }
+
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStuff.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 6 months
teiid SVN: r2211 - trunk/jboss-integration/src/main/java/org/teiid/jboss.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-06-09 12:37:31 -0400 (Wed, 09 Jun 2010)
New Revision: 2211
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
Log:
TEIID-1117: Capturing the Shutdown event of the container using a JMX notification, and used that to determine the shutdown based undeploy vs a undeploy based on the user activity. Then managed the cached directories based on these events.
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2010-06-09 14:45:23 UTC (rev 2210)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2010-06-09 16:37:31 UTC (rev 2211)
@@ -29,12 +29,15 @@
import javax.management.NotificationListener;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.Server;
import org.jboss.system.ServiceMBeanSupport;
import org.teiid.deployers.ContainerLifeCycleListener;
public class JBossLifeCycleListener extends ServiceMBeanSupport implements NotificationListener, ContainerLifeCycleListener{
+ public final String START_NOTIFICATION_TYPE = "org.jboss.system.server.started"; //$NON-NLS-1$
+ /** The JMX notification event type sent on begin of the server shutdown */
+ public final String STOP_NOTIFICATION_TYPE = "org.jboss.system.server.stopped"; //$NON-NLS-1$
+
private boolean shutdownInProgress = false;
public JBossLifeCycleListener() {
@@ -52,10 +55,10 @@
@Override
public void handleNotification(Notification msg, Object handback) {
String type = msg.getType();
- if (type.equals(Server.START_NOTIFICATION_TYPE)) {
+ if (type.equals(START_NOTIFICATION_TYPE)) {
}
- if (type.equals(Server.STOP_NOTIFICATION_TYPE)) {
+ if (type.equals(STOP_NOTIFICATION_TYPE)) {
shutdownInProgress = true;
}
}
14 years, 6 months
teiid SVN: r2210 - in trunk: jboss-integration/src/main/java/org/teiid/adminapi/jboss and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-06-09 10:45:23 -0400 (Wed, 09 Jun 2010)
New Revision: 2210
Added:
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
Modified:
trunk/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
Log:
TEIID-1117: Capturing the Shutdown event of the container using a JMX notification, and used that to determine the shutdown based undeploy vs a undeploy based on the user activity. Then managed the cached directories based on these events.
Modified: trunk/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-06-08 21:28:18 UTC (rev 2209)
+++ trunk/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-06-09 14:45:23 UTC (rev 2210)
@@ -8,6 +8,8 @@
<bean name="ConnectorManagerRepository" class="org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository"/>
<bean name="SecurityHelper" class="org.teiid.jboss.JBossSecurityHelper"/>
+ <bean name="JBossLifeCycleListener" class="org.teiid.jboss.JBossLifeCycleListener"/>
+
<bean name="VDBParserDeployer" class="org.teiid.deployers.VDBParserDeployer">
<property name="objectSerializer"><inject bean="ObjectSerializer"/></property>
<property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
@@ -45,7 +47,8 @@
<property name="contextCache"><inject bean="ContextCache"/></property>
<property name="objectSerializer"><inject bean="ObjectSerializer"/></property>
<property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
- <property name="translatorRepository"><inject bean="translatorRepository"/></property>
+ <property name="translatorRepository"><inject bean="translatorRepository"/></property>
+ <property name="containerLifeCycleListener"><inject bean="JBossLifeCycleListener"/></property>
<depends>SystemVDBDeployer</depends>
</bean>
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2010-06-08 21:28:18 UTC (rev 2209)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2010-06-09 14:45:23 UTC (rev 2210)
@@ -300,6 +300,7 @@
public static void removeArchive(DeploymentManager deploymentManager, String... deploymentNames) throws AdminProcessingException{
try {
+ execute(deploymentManager.stop(deploymentNames), IntegrationPlugin.Util.getString("failed_to_remove")); //$NON-NLS-1$
execute(deploymentManager.remove(deploymentNames), IntegrationPlugin.Util.getString("failed_to_remove")); //$NON-NLS-1$
} catch (Exception e) {
handleException(e);
Added: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java (rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2010-06-09 14:45:23 UTC (rev 2210)
@@ -0,0 +1,67 @@
+/*
+ * 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 org.teiid.jboss;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.jboss.bootstrap.spi.Server;
+import org.jboss.system.ServiceMBeanSupport;
+import org.teiid.deployers.ContainerLifeCycleListener;
+
+public class JBossLifeCycleListener extends ServiceMBeanSupport implements NotificationListener, ContainerLifeCycleListener{
+
+ private boolean shutdownInProgress = false;
+
+ public JBossLifeCycleListener() {
+ try {
+ MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);
+ ObjectName on = new ObjectName("jboss.system:type=Server"); //$NON-NLS-1$
+ server.addNotificationListener(on, this, null, null);
+ } catch (MalformedObjectNameException e) {
+ //ignore
+ } catch (InstanceNotFoundException e) {
+ //ignore
+ }
+ }
+
+ @Override
+ public void handleNotification(Notification msg, Object handback) {
+ String type = msg.getType();
+ if (type.equals(Server.START_NOTIFICATION_TYPE)) {
+ }
+
+ if (type.equals(Server.STOP_NOTIFICATION_TYPE)) {
+ shutdownInProgress = true;
+ }
+ }
+
+ @Override
+ public boolean isShutdownInProgress() {
+ return shutdownInProgress;
+ }
+}
Property changes on: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java (rev 0)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java 2010-06-09 14:45:23 UTC (rev 2210)
@@ -0,0 +1,26 @@
+/*
+ * 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 org.teiid.deployers;
+
+public interface ContainerLifeCycleListener {
+ boolean isShutdownInProgress();
+}
Property changes on: trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-06-08 21:28:18 UTC (rev 2209)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-06-09 14:45:23 UTC (rev 2210)
@@ -62,6 +62,7 @@
private TranslatorRepository translatorRepository;
private DQPContextCache contextCache;
private ObjectSerializer serializer;
+ private ContainerLifeCycleListener shutdownListener;
public VDBDeployer() {
super(VDBMetaData.class);
@@ -277,7 +278,7 @@
}
private void deleteMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb) throws IOException {
- if (!unit.getRoot().exists()) {
+ if (!unit.getRoot().exists() || !shutdownListener.isShutdownInProgress()) {
File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
if (cacheFileName.exists()) {
FileUtils.removeDirectoryAndChildren(cacheFileName.getParentFile());
@@ -332,4 +333,8 @@
public void setTranslatorRepository(TranslatorRepository repo) {
this.translatorRepository = repo;
}
+
+ public void setContainerLifeCycleListener(ContainerLifeCycleListener listener) {
+ shutdownListener = listener;
+ }
}
14 years, 6 months