[teiid-commits] teiid SVN: r2166 - in trunk: build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio and 11 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri May 28 00:34:27 EDT 2010


Author: shawkins
Date: 2010-05-28 00:34:24 -0400 (Fri, 28 May 2010)
New Revision: 2166

Added:
   trunk/build/kits/jboss-container/teiid-examples/portfolio/data/
   trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt
   trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
   trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
   trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/
   trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
   trunk/connectors/translator-file/src/test/resources/file.txt
   trunk/connectors/translator-file/src/test/resources/file1.txt
Removed:
   trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt
   trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt
   trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml
   trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt
   trunk/connectors/translator-file/src/test/java/org/teiid/translator/text/
   trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java
Modified:
   trunk/api/src/main/java/org/teiid/metadata/Datatype.java
   trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
   trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
   trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
   trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml
   trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
   trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
   trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
   trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java
   trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt
Log:
TEIID-1102 removing the text translator in favor of the file translator - updating dynamic vdb example

Modified: trunk/api/src/main/java/org/teiid/metadata/Datatype.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/Datatype.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/api/src/main/java/org/teiid/metadata/Datatype.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -28,7 +28,8 @@
 public class Datatype extends AbstractMetadataRecord {
 	
 	private static final long serialVersionUID = -7839335802224393230L;
-
+	private static final String OLD_PACKAGE = "com.metamatrix.common."; //$NON-NLS-1$
+	
 	public enum Type {
 		Basic,
 		UserDefined,
@@ -185,6 +186,12 @@
      * @param string
      */
     public void setJavaClassName(String string) {
+    	if (string != null) {
+    		int index = string.indexOf(OLD_PACKAGE);
+    		if (index == 0) {
+    			string = "org.teiid.core." + string.substring(OLD_PACKAGE.length()); //$NON-NLS-1$
+    		}
+    	}
         javaClassName = string;
     }
 

Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -4,13 +4,12 @@
 	- portfolio-dynamic-vdb.xml
 	- ../portfolio/marketdata-file-ds.xml
 	- ../portfolio/portfolio-ds.xml 
-	- ../portfolio/marketdata-text-translator.xml
 
 Start the JBoss Container
 
-Use the simple client example run script i.e. 
+Use the simple client example run script e.g. 
 
-$run.sh localhost 31000 dynamicportfolio "select * from product, price where product.symbol=price.symbol"
+$./run.sh localhost 31000 dynamicportfolio "select * from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) price where product.symbol=price.symbol"
 
 That will execute the query against both Derby and the text file using the 
 connector supplied metadata. 

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-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml	2010-05-28 04:34:24 UTC (rev 2166)
@@ -23,11 +23,11 @@
     --> 
     <model name="MarketData">
         <!-- 
-            Each of source represents translator and data source  reading and writing data. There are pre-defined translators or
-            you can create one. They are defined using "-translator.xml" file. Connections define connections
-            to physical sources. In JBoss AS they are typically defined using "xxx-ds.xml" files. 
+            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="marketdata-text" connection-jndi-name="java:marketdata-text-connection"/>
+        <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
     </model>
 
     <model name="Accounts">

Modified: trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -9,7 +9,6 @@
 Copy the Translators/ConnectionFactories for the example to the "<jboss home>/server/default/deploy" directory.
 	- marketdata-file-ds.xml
 	- portfolio-ds.xml 
-	- marketdata-text-translator.xml
  
 Start the JBoss Container
 

Copied: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt (from rev 2160, trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt)
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt	                        (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,11 @@
+SYMBOL,PRICE
+RHT 30.00
+BA,42.75
+MON,78.75
+ORCL,16.54
+SY,24.30
+MSFT,20.60
+IBM,80.89
+DELL,10.75
+HPQ,31.52
+GE,16.45

Added: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt	                        (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,10 @@
+SYMBOL,PRICE
+MRK,27.20
+DIS,20.53
+MCD,54.55
+DOW,21.80
+GM,3.15
+SBGI,2.19
+COLM,33.89
+COLB,12.64
+BSY,23.81
\ No newline at end of file


Property changes on: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,6 +0,0 @@
-MarketData.Price.location = marketdata-price.txt
-MarketData.Price.delimiter = ,
-MarketData.Price.headerLine = 1
-MarketData.Price.skipHeaderLines = 1
-MarketData.Price.columns=SYMBOL,PRICE
-MarketData.Price.types=string,bigdecimal

Modified: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml	2010-05-28 04:34:24 UTC (rev 2166)
@@ -11,7 +11,7 @@
         file mentioned above. 
        -->
              
-      <config-property name="ParentDirectory" type="java.lang.String">${jboss.server.home.dir}/teiid-examples/portfolio</config-property>
+      <config-property name="ParentDirectory" type="java.lang.String">${jboss.server.home.dir}/teiid-examples/portfolio/data</config-property>
             
       <max-pool-size>20</max-pool-size>
 

Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,20 +0,0 @@
-SYMBOL,PRICE
-BA,42.75
-MON,78.75
-ORCL,16.54
-SY,24.30
-MSFT,20.60
-IBM,80.89
-DELL,10.75
-HPQ,31.52
-GE,16.45
-MRK,27.20
-DIS,20.53
-MCD,54.55
-DOW,21.80
-GM,3.15
-JAVA,3.79
-SBGI,2.19
-COLM,33.89
-COLB,12.64
-BSY,23.81
\ No newline at end of file

Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml	2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<translator-factory>
-    <translator>
-        <name>text</name>
-        <execution-factory-class>org.teiid.translator.text.TextExecutionFactory</execution-factory-class>
-        <template-name>translator-text-${project.version}</template-name>
-        <translator-property name="DescriptorFile" value="file://${jboss.server.home.dir}/teiid-examples/portfolio/marketdata-def.txt"/>
-    </translator>
-</translator-factory>
\ No newline at end of file

Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)

Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -29,6 +29,7 @@
 import org.teiid.jdbc.TeiidDataSource;
 import org.teiid.jdbc.TeiidStatement;
 
+ at SuppressWarnings("nls")
 public class JDBCClient {
 	public static void main(String[] args) throws Exception {
 		if (args.length < 4) {
@@ -39,7 +40,7 @@
 		System.out.println("Executing using the TeiidDriver");
 		execute(getDriverConnection(args[0], args[1], args[2]), args[3]);
 
-		System.out.println("");
+		System.out.println("-----------------------------------");
 		System.out.println("Executing using the TeiidDataSource");
 		// this is showing how to make a Data Source connection. 
 		execute(getDataSourceConnection(args[0], args[1], args[2]), args[3]);
@@ -73,15 +74,14 @@
 			
 			ResultSetMetaData metadata = results.getMetaData();
 			int columns = metadata.getColumnCount();
-			
-			while(results.next()) {
+			System.out.println("Results");
+			for (int row = 1; results.next(); row++) {
+				System.out.println(row + ": ");
 				for (int i = 0; i < columns; i++) {
 					System.out.print(results.getString(i+1));
 					System.out.print(",");
 				}
-				System.out.println("");
 			}
-			
 			System.out.println("Query Plan");
 			System.out.println(statement.unwrap(TeiidStatement.class).getPlanDescription());
 			

Copied: trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt (from rev 2160, trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt)
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt	                        (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,11 @@
+JDBCClient.java shows making connections to Teiid in embedded mode through both a Driver
+and a DataSource.
+
+The program expects four arguments <host> <port> <vdb> <sql-command>.  There are helper run scripts 
+that can be run as follows:
+
+$./run.sh localhost 31000 portfolio "select * from CustomerAccount"
+
+Note that the query is in quotes so that it is understood as a single argument.
+
+See the other examples for deployable .vdb and .xml files to create vdbs.
\ No newline at end of file


Property changes on: trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,11 +0,0 @@
-JDBCClient.java shows making connections to Teiid in embedded mode through both a Driver
-and a DataSource.
-
-The program expects four arguments <host> <port> <vdb> <sql-command>.  There are helper run scripts 
-that can be run as follows:
-
-$run.sh localhost 31000 portfolio "select * from CustomerAccount"
-
-Note that the query is in quotes so that it is understood as a single argument.
-
-See the other examples for deployable .vdb and .xml files to create vdbs.
\ No newline at end of file

Modified: trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -73,7 +73,7 @@
 
 		@Override
 		public void execute() throws TranslatorException {
-			FileConnection.Util.getFiles((String)command.getArguments().get(0).getArgumentValue().getValue(), fc);
+			files = FileConnection.Util.getFiles((String)command.getArguments().get(0).getArgumentValue().getValue(), fc);
 			String name = command.getProcedureName();
 			if (name.equalsIgnoreCase(GETTEXTFILES)) {
 				isText = true;
@@ -102,7 +102,7 @@
 				return null;
 			}
 			ArrayList<Object> result = new ArrayList<Object>(2);
-			final File file = files[index];
+			final File file = files[index++];
 			FileInputStreamFactory isf = new FileInputStreamFactory(file, encoding);
 			isf.setLength(file.length());
 			Object value = null;

Copied: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file (from rev 2160, trunk/connectors/translator-file/src/test/java/org/teiid/translator/text)

Added: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java	                        (rev 0)
+++ trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,65 @@
+/*
+ * 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.file;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Arrays;
+
+import javax.resource.cci.ConnectionFactory;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.language.Argument;
+import org.teiid.language.Call;
+import org.teiid.language.Literal;
+import org.teiid.language.Argument.Direction;
+import org.teiid.translator.FileConnection;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.TypeFacility;
+
+ at SuppressWarnings("nls")
+public class TestFileExecutionFactory {
+
+	@Test public void testGetTextFiles() throws Exception {
+		FileExecutionFactory fef = new FileExecutionFactory();
+		ConnectionFactory cf = Mockito.mock(ConnectionFactory.class);
+		FileConnection fc = Mockito.mock(FileConnection.class);
+		Mockito.stub(cf.getConnection()).toReturn(fc);
+		Mockito.stub(fc.getFile("*.txt")).toReturn(new File(UnitTestUtil.getTestDataPath(), "*.txt"));
+		Call call = fef.getLanguageFactory().createCall("getTextFiles", Arrays.asList(new Argument(Direction.IN, new Literal("*.txt", TypeFacility.RUNTIME_TYPES.STRING), TypeFacility.RUNTIME_TYPES.STRING, null)), null);
+		ProcedureExecution pe = fef.createProcedureExecution(call, null, null, cf);
+		pe.execute();
+		int count = 0;
+		while (true) {
+			if (pe.next() == null) {
+				break;
+			}
+			count++;
+		}
+		assertEquals(2, count);
+	}
+	
+}


Property changes on: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/connectors/translator-file/src/test/resources/file.txt
===================================================================


Property changes on: trunk/connectors/translator-file/src/test/resources/file.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/connectors/translator-file/src/test/resources/file1.txt
===================================================================


Property changes on: trunk/connectors/translator-file/src/test/resources/file1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -122,7 +122,7 @@
 			}
 		}
 		if (result.isEmpty()) {
-	        throw new QueryMetadataException(name+TransformationMetadata.NOT_EXISTS_MESSAGE);
+	        throw new QueryMetadataException(name.substring(1)+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}
 		return result;
 	}

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -22,11 +22,16 @@
 
 package org.teiid.dqp.internal.datamgr.language;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import junit.framework.TestCase;
 
 import org.teiid.core.types.DataTypeManager;
 import org.teiid.language.ColumnReference;
 import org.teiid.language.DerivedColumn;
+import org.teiid.language.Literal;
+import org.teiid.language.Select;
 
 
 public class TestSelectSymbolImpl extends TestCase {
@@ -56,5 +61,18 @@
     public void testGetExpression() throws Exception {
         assertNotNull(example("testName", null).getExpression()); //$NON-NLS-1$
     }
+    
+    public void testGetColumnDataTypes(){
+        Class<?>[] expectedResults = new Class[2];
+        List<DerivedColumn> symbols = new ArrayList<DerivedColumn>();
+        symbols.add(new DerivedColumn("c1", new Literal("3", DataTypeManager.DefaultDataClasses.STRING)));  //$NON-NLS-1$//$NON-NLS-2$
+        expectedResults[0] = DataTypeManager.DefaultDataClasses.STRING;
+        symbols.add(new DerivedColumn("c2", new Literal(new Integer(5), DataTypeManager.DefaultDataClasses.INTEGER)));  //$NON-NLS-1$
+        expectedResults[1] = DataTypeManager.DefaultDataClasses.INTEGER;
+        Select query = new Select(symbols, false, null, null, null, null, null);
+        Class<?>[] results = query.getColumnTypes();  
+        assertEquals( results[0], expectedResults[0]);
+        assertEquals( results[1], expectedResults[1]);     
+    }
 
 }

Deleted: trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java	2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,58 +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.query.sql.lang;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.core.types.DataTypeManager;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Literal;
-import org.teiid.language.Select;
-
-
-public class TestJDBCExecutionHelper extends TestCase{
-    
-    public TestJDBCExecutionHelper(String name) {
-        super(name);
-    }
-
-    //tests
-    public void testGetColumnDataTypes(){
-        Class[] expectedResults = new Class[2];
-        List symbols = new ArrayList();
-        symbols.add(new DerivedColumn("c1", new Literal("3", DataTypeManager.DefaultDataClasses.STRING)));  //$NON-NLS-1$//$NON-NLS-2$
-        expectedResults[0] = DataTypeManager.DefaultDataClasses.STRING;
-        symbols.add(new DerivedColumn("c2", new Literal(new Integer(5), DataTypeManager.DefaultDataClasses.INTEGER)));  //$NON-NLS-1$//$NON-NLS-2$
-        expectedResults[1] = DataTypeManager.DefaultDataClasses.INTEGER;
-        Select query = new Select(symbols, false, null, null, null, null, null);
-        Class[] results = query.getColumnTypes();  
-        assertEquals( results[0], expectedResults[0]);
-        assertEquals( results[1], expectedResults[1]);     
-    }
-
-}

Modified: trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt
===================================================================
--- trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt	2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt	2010-05-28 04:34:24 UTC (rev 2166)
@@ -10,16 +10,16 @@
 NOTATION	false	false	NOTATION	java.lang.String	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e	string	anySimpleType	null
 Name	false	false	Name	java.lang.String	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576	string	token	null
 QName	false	false	QName	java.lang.String	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e	string	anySimpleType	null
-XMLLiteral	false	false	XMLLiteral	com.metamatrix.common.types.XMLType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32	xml	string	null
+XMLLiteral	false	false	XMLLiteral	org.teiid.core.types.XMLType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32	xml	string	null
 anyURI	false	false	anyURI	java.lang.String	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e	string	anySimpleType	null
 base64Binary	false	false	base64Binary	java.lang.String	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7	string	anySimpleType	null
 bigdecimal	false	false	bigdecimal	java.math.BigDecimal	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d	bigdecimal	decimal	null
 biginteger	false	false	biginteger	java.math.BigInteger	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d	biginteger	decimal	null
-blob	false	false	blob	com.metamatrix.common.types.BlobType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95	blob	base64Binary	null
+blob	false	false	blob	org.teiid.core.types.BlobType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95	blob	base64Binary	null
 boolean	false	false	boolean	java.lang.Boolean	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7	boolean	anySimpleType	null
 byte	false	false	byte	java.lang.Byte	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016	byte	short	null
 char	false	false	char	java.lang.Character	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d	char	string	null
-clob	false	false	clob	com.metamatrix.common.types.ClobType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3	clob	string	null
+clob	false	false	clob	org.teiid.core.types.ClobType	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3	clob	string	null
 date	false	false	date	java.sql.Date	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7	date	anySimpleType	null
 dateTime	false	false	dateTime	java.sql.Timestamp	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21	timestamp	anySimpleType	null
 decimal	false	false	decimal	java.math.BigDecimal	0	0	No Nulls	false	false	false	0	0	Searchable	mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7	bigdecimal	anySimpleType	null



More information about the teiid-commits mailing list