teiid SVN: r1117 - trunk/build/kit-embedded/bin.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-10 12:15:38 -0400 (Fri, 10 Jul 2009)
New Revision: 1117
Modified:
trunk/build/kit-embedded/bin/run.bat
trunk/build/kit-embedded/bin/run.sh
trunk/build/kit-embedded/bin/shutdown.bat
trunk/build/kit-embedded/bin/shutdown.sh
Log:
TEIID-259: Making Server scripts always run from TEIID_HOME, so that we always have consistent ${user.dir}, irrespective of where it is executed from.
Modified: trunk/build/kit-embedded/bin/run.bat
===================================================================
--- trunk/build/kit-embedded/bin/run.bat 2009-07-10 16:05:15 UTC (rev 1116)
+++ trunk/build/kit-embedded/bin/run.bat 2009-07-10 16:15:38 UTC (rev 1117)
@@ -54,6 +54,8 @@
echo A new key with keystore generated at %KEYSTORE_FILE%
)
+cd %TEIID_HOME%
+
echo ===============================================================================
echo.
echo Teiid Bootstrap Environment
Modified: trunk/build/kit-embedded/bin/run.sh
===================================================================
--- trunk/build/kit-embedded/bin/run.sh 2009-07-10 16:05:15 UTC (rev 1116)
+++ trunk/build/kit-embedded/bin/run.sh 2009-07-10 16:15:38 UTC (rev 1117)
@@ -47,6 +47,7 @@
TEIID_HOME=`cd $DIRNAME/..; pwd`
fi
export TEIID_HOME
+cd $TEIID_HOME
# Setup the JVM
if [ "x$JAVA" = "x" ]; then
Modified: trunk/build/kit-embedded/bin/shutdown.bat
===================================================================
--- trunk/build/kit-embedded/bin/shutdown.bat 2009-07-10 16:05:15 UTC (rev 1116)
+++ trunk/build/kit-embedded/bin/shutdown.bat 2009-07-10 16:15:38 UTC (rev 1117)
@@ -46,6 +46,8 @@
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+cd %TEIID_HOME%
+
echo ===============================================================================
echo.
echo Teiid Bootstrap Environment
Modified: trunk/build/kit-embedded/bin/shutdown.sh
===================================================================
--- trunk/build/kit-embedded/bin/shutdown.sh 2009-07-10 16:05:15 UTC (rev 1116)
+++ trunk/build/kit-embedded/bin/shutdown.sh 2009-07-10 16:15:38 UTC (rev 1117)
@@ -47,6 +47,7 @@
TEIID_HOME=`cd $DIRNAME/..; pwd`
fi
export TEIID_HOME
+cd $TEIID_HOME
# Setup the JVM
if [ "x$JAVA" = "x" ]; then
15 years, 5 months
teiid SVN: r1116 - trunk/engine/src/test/java/com/metamatrix/query/processor/proc.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-10 12:05:15 -0400 (Fri, 10 Jul 2009)
New Revision: 1116
Modified:
trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
Log:
updating reference unit tests
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-07-10 16:03:48 UTC (rev 1115)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-07-10 16:05:15 UTC (rev 1116)
@@ -53,10 +53,12 @@
import com.metamatrix.query.mapping.relational.QueryNode;
import com.metamatrix.query.metadata.TempMetadataID;
import com.metamatrix.query.optimizer.QueryOptimizer;
-import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
+import com.metamatrix.query.optimizer.TestOptimizer;
+import com.metamatrix.query.optimizer.capabilities.AllCapabilities;
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.DefaultCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
import com.metamatrix.query.parser.QueryParser;
import com.metamatrix.query.processor.FakeDataManager;
import com.metamatrix.query.processor.ProcessorDataManager;
@@ -2711,7 +2713,7 @@
*
* @throws Exception
*/
- public void testRomvalOfNonJoinCritWithReference() throws Exception {
+ public void testRemovalOfNonJoinCritWithReference() throws Exception {
String proc = ""; //$NON-NLS-1$
String sql = ""; //$NON-NLS-1$
@@ -2755,7 +2757,7 @@
*
* @throws Exception
*/
- public void testRomvalOfNonJoinCritWithReference2() throws Exception {
+ public void testRemovalOfNonJoinCritWithReference2() throws Exception {
String proc = ""; //$NON-NLS-1$
String sql = ""; //$NON-NLS-1$
@@ -2775,80 +2777,11 @@
" declare integer myVar = 5;" + //$NON-NLS-1$
" " + sql + ";" + //$NON-NLS-1$ //$NON-NLS-2$
"END"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities() {
- public boolean supportsCapability(String capability) {
- return true;
- }
- public boolean supportsFunction(String functionName) {
- return true;
- }
- };
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = createProcedureMetadata(proc);
- String userQuery = "SELECT * FROM (EXEC pm1.sq1()) as proc"; //$NON-NLS-1$
- FakeDataManager dataMgr = exampleDataManager2(metadata);
- ProcessorPlan plan = getProcedurePlan(userQuery, metadata, capFinder);
- List[] expected = new List[] {
- Arrays.asList( new Object[] { "First", "First", new Integer(5), new Integer(5)} ), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList( new Object[] { "Second", null, new Integer(15), null} ), //$NON-NLS-1$
- Arrays.asList( new Object[] { "Third", null, new Integer(51), null} ) //$NON-NLS-1$
- };
- helpTestProcess(plan, expected, dataMgr);
- }
-
- /**
- * Test the use of a procedure variable in the criteria of a LEFT OUTER
- * JOIN which will be optimized out as non-JOIN criteria.
- * <p>
- * This test case verifies that the procedure variable will not be pushed
- * to the data manager when a JOIN of a temporary table and source are
- * performed and the physical source supports all capabilities.
- *
- * @throws Exception
- */
- public void testRomvalOfNonJoinCritWithReference3() throws Exception {
- String proc = ""; //$NON-NLS-1$
-
- String sql = ""; //$NON-NLS-1$
- sql += "SELECT " + //$NON-NLS-1$
- " #temp1.e1 AS pm1g1e1, " + //$NON-NLS-1$
- " pm2.g2.e1 AS pm2g2e1, " + //$NON-NLS-1$
- " #temp1.e2 AS pm1g1e2, " + //$NON-NLS-1$
- " pm2.g2.e2 AS pm2g2e2 " + //$NON-NLS-1$
- "FROM " + //$NON-NLS-1$
- " #temp1 " + //$NON-NLS-1$
- "LEFT OUTER JOIN pm2.g2 " + //$NON-NLS-1$
- " ON #temp1.e1 = pm2.g2.e1 " + //$NON-NLS-1$
- " AND pm2.g2.e2 = VARIABLES.myVar "; //$NON-NLS-1$
-
- proc += "CREATE VIRTUAL PROCEDURE " + //$NON-NLS-1$
- "BEGIN " + //$NON-NLS-1$
- " declare integer myVar = 5;" + //$NON-NLS-1$
- " SELECT * INTO #temp1 FROM pm1.g1;" + //$NON-NLS-1$
- " " + sql + ";" + //$NON-NLS-1$ //$NON-NLS-2$
- "END"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities() {
- public boolean supportsCapability(String capability) {
- return true;
- }
- public boolean supportsFunction(String functionName) {
- return true;
- }
- };
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
FakeMetadataFacade metadata = createProcedureMetadata(proc);
String userQuery = "SELECT * FROM (EXEC pm1.sq1()) as proc"; //$NON-NLS-1$
FakeDataManager dataMgr = exampleDataManager2(metadata);
- ProcessorPlan plan = getProcedurePlan(userQuery, metadata, capFinder);
+ ProcessorPlan plan = getProcedurePlan(userQuery, metadata, TestOptimizer.getGenericFinder());
List[] expected = new List[] {
Arrays.asList( new Object[] { "First", "First", new Integer(5), new Integer(5)} ), //$NON-NLS-1$ //$NON-NLS-2$
15 years, 5 months
teiid SVN: r1115 - in trunk/common-core/src: test/java/com/metamatrix/common/types and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-10 12:03:48 -0400 (Fri, 10 Jul 2009)
New Revision: 1115
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java
Log:
TEIID-712 correcting the type reported for SQLXML
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-07-08 22:09:17 UTC (rev 1114)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-07-10 16:03:48 UTC (rev 1115)
@@ -37,8 +37,8 @@
/**
* <p> This is a helper class used to obtain SQL type information for java types.
- * The SQL type infomation is obtained from java.sql.Types class. The integers and
- * strings retuned by methods in this class are based on constants in java.sql.Types.
+ * The SQL type information is obtained from java.sql.Types class. The integers and
+ * strings returned by methods in this class are based on constants in java.sql.Types.
*/
public final class MMJDBCSQLTypeInfo {
@@ -68,30 +68,6 @@
public static final String XML = DataTypeManager.DefaultDataTypes.XML;
public static final String NULL = DataTypeManager.DefaultDataTypes.NULL;
- private static Map<String, Integer> NAME_TO_TYPE_MAP = new HashMap<String, Integer>();
-
- static {
- NAME_TO_TYPE_MAP.put(STRING, Integer.valueOf(Types.VARCHAR));
- NAME_TO_TYPE_MAP.put(BOOLEAN, Integer.valueOf(Types.BIT));
- NAME_TO_TYPE_MAP.put(TIME, Integer.valueOf(Types.TIME));
- NAME_TO_TYPE_MAP.put(DATE, Integer.valueOf(Types.DATE));
- NAME_TO_TYPE_MAP.put(TIMESTAMP, Integer.valueOf(Types.TIMESTAMP));
- NAME_TO_TYPE_MAP.put(INTEGER, Integer.valueOf(Types.INTEGER));
- NAME_TO_TYPE_MAP.put(FLOAT, Integer.valueOf(Types.REAL));
- NAME_TO_TYPE_MAP.put(DOUBLE, Integer.valueOf(Types.DOUBLE));
- NAME_TO_TYPE_MAP.put(BIGDECIMAL, Integer.valueOf(Types.NUMERIC));
- NAME_TO_TYPE_MAP.put(BIGINTEGER, Integer.valueOf(Types.NUMERIC));
- NAME_TO_TYPE_MAP.put(BYTE, Integer.valueOf(Types.TINYINT));
- NAME_TO_TYPE_MAP.put(SHORT, Integer.valueOf(Types.SMALLINT));
- NAME_TO_TYPE_MAP.put(LONG, Integer.valueOf(Types.BIGINT));
- NAME_TO_TYPE_MAP.put(CHAR, Integer.valueOf(Types.CHAR));
- NAME_TO_TYPE_MAP.put(OBJECT, Integer.valueOf(Types.JAVA_OBJECT));
- NAME_TO_TYPE_MAP.put(CLOB, Integer.valueOf(Types.CLOB));
- NAME_TO_TYPE_MAP.put(BLOB, Integer.valueOf(Types.BLOB));
- NAME_TO_TYPE_MAP.put(XML, Integer.valueOf(Types.JAVA_OBJECT));
- NAME_TO_TYPE_MAP.put(NULL, Integer.valueOf(Types.NULL));
- }
-
//java class names
public static final String STRING_CLASS = DataTypeManager.DefaultDataClasses.STRING.getName();
public static final String BOOLEAN_CLASS = DataTypeManager.DefaultDataClasses.BOOLEAN.getName();
@@ -112,40 +88,63 @@
public static final String BLOB_CLASS = Blob.class.getName();
//## JDBC4.0-begin ##
public static final String XML_CLASS = SQLXML.class.getName();
- //## JDBC4.0-begin ##
+ //## JDBC4.0-end ##
/*## JDBC3.0-JDK1.5-begin ##
public static final String XML_CLASS = DataTypeManager.DefaultDataClasses.OBJECT.getName();
## JDBC3.0-JDK1.5-end ##*/
- private static Map<String, Integer> CLASSNAME_TO_TYPE_MAP = new HashMap<String, Integer>();
+ private static Map<String, Integer> NAME_TO_TYPE_MAP = new HashMap<String, Integer>();
+ private static Map<Integer, String> TYPE_TO_NAME_MAP = new HashMap<Integer, String>();
+ private static Map<String, String> NAME_TO_CLASSNAME = new HashMap<String, String>();
+ private static Map<String, String> CLASSNAME_TO_NAME = new HashMap<String, String>();
+
static {
- CLASSNAME_TO_TYPE_MAP.put(STRING_CLASS.toLowerCase(), Integer.valueOf(Types.VARCHAR));
- CLASSNAME_TO_TYPE_MAP.put(BOOLEAN_CLASS.toLowerCase(), Integer.valueOf(Types.BIT));
- CLASSNAME_TO_TYPE_MAP.put(TIME_CLASS.toLowerCase(), Integer.valueOf(Types.TIME));
- CLASSNAME_TO_TYPE_MAP.put(DATE_CLASS.toLowerCase(), Integer.valueOf(Types.DATE));
- CLASSNAME_TO_TYPE_MAP.put(TIMESTAMP_CLASS.toLowerCase(), Integer.valueOf(Types.TIMESTAMP));
- CLASSNAME_TO_TYPE_MAP.put(INTEGER_CLASS.toLowerCase(), Integer.valueOf(Types.INTEGER));
- CLASSNAME_TO_TYPE_MAP.put(FLOAT_CLASS.toLowerCase(), Integer.valueOf(Types.REAL));
- CLASSNAME_TO_TYPE_MAP.put(DOUBLE_CLASS.toLowerCase(), Integer.valueOf(Types.DOUBLE));
- CLASSNAME_TO_TYPE_MAP.put(BIGDECIMAL_CLASS.toLowerCase(), Integer.valueOf(Types.NUMERIC));
- CLASSNAME_TO_TYPE_MAP.put(BIGINTEGER_CLASS.toLowerCase(), Integer.valueOf(Types.NUMERIC));
- CLASSNAME_TO_TYPE_MAP.put(BYTE_CLASS.toLowerCase(), Integer.valueOf(Types.TINYINT));
- CLASSNAME_TO_TYPE_MAP.put(SHORT_CLASS.toLowerCase(), Integer.valueOf(Types.SMALLINT));
- CLASSNAME_TO_TYPE_MAP.put(LONG_CLASS.toLowerCase(), Integer.valueOf(Types.BIGINT));
- CLASSNAME_TO_TYPE_MAP.put(CHAR_CLASS.toLowerCase(), Integer.valueOf(Types.CHAR));
- CLASSNAME_TO_TYPE_MAP.put(OBJECT_CLASS.toLowerCase(), Integer.valueOf(Types.JAVA_OBJECT));
- CLASSNAME_TO_TYPE_MAP.put(CLOB_CLASS.toLowerCase(), Integer.valueOf(Types.CLOB));
- CLASSNAME_TO_TYPE_MAP.put(BLOB_CLASS.toLowerCase(), Integer.valueOf(Types.BLOB));
+ addTypeMapping(STRING, STRING_CLASS, Types.VARCHAR);
+ TYPE_TO_NAME_MAP.put(Types.LONGVARCHAR, STRING);
+ addTypeMapping(BOOLEAN, BOOLEAN_CLASS, Types.BIT);
+ addTypeMapping(TIME, TIME_CLASS, Types.TIME);
+ addTypeMapping(DATE, DATE_CLASS, Types.DATE);
+ addTypeMapping(TIMESTAMP, TIMESTAMP_CLASS, Types.TIMESTAMP);
+ addTypeMapping(INTEGER, INTEGER_CLASS, Types.INTEGER);
+ addTypeMapping(FLOAT, FLOAT_CLASS, Types.REAL);
+ addTypeMapping(DOUBLE, DOUBLE_CLASS, Types.DOUBLE);
+ TYPE_TO_NAME_MAP.put(Types.FLOAT, DOUBLE);
+ addTypeMapping(BIGDECIMAL, BIGDECIMAL_CLASS, Types.NUMERIC);
+ TYPE_TO_NAME_MAP.put(Types.DECIMAL, BIGDECIMAL);
+ NAME_TO_CLASSNAME.put(BIGINTEGER, BIGINTEGER_CLASS);
+ CLASSNAME_TO_NAME.put(BIGINTEGER_CLASS, BIGINTEGER);
+ NAME_TO_TYPE_MAP.put(BIGINTEGER, Types.NUMERIC);
+ addTypeMapping(BYTE, BYTE_CLASS, Types.TINYINT);
+ addTypeMapping(SHORT, SHORT_CLASS, Types.SMALLINT);
+ addTypeMapping(LONG, LONG_CLASS, Types.BIGINT);
+ addTypeMapping(CHAR, CHAR_CLASS, Types.CHAR);
+ addTypeMapping(OBJECT, OBJECT_CLASS, Types.JAVA_OBJECT);
+ addTypeMapping(CLOB, CLOB_CLASS, Types.CLOB);
+ addTypeMapping(BLOB, BLOB_CLASS, Types.BLOB);
- //## JDBC4.0-begin ##
- CLASSNAME_TO_TYPE_MAP.put(XML_CLASS.toLowerCase(), Integer.valueOf(Types.SQLXML));
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- CLASSNAME_TO_TYPE_MAP.put(XML_CLASS.toLowerCase(), Integer.valueOf(Types.JAVA_OBJECT));
- ## JDBC3.0-JDK1.5-end ##*/
+ addTypeMapping(NULL, null, Types.NUMERIC);
+ //## JDBC4.0-begin ##
+ addTypeMapping(XML, XML_CLASS, Types.SQLXML);
+ TYPE_TO_NAME_MAP.put(Types.NVARCHAR, STRING);
+ TYPE_TO_NAME_MAP.put(Types.LONGNVARCHAR, STRING);
+ TYPE_TO_NAME_MAP.put(Types.NCHAR, CHAR);
+ TYPE_TO_NAME_MAP.put(Types.NCLOB, CLOB);
+ //## JDBC4.0-end ##
+
+ /*## JDBC3.0-JDK1.5-begin ##
+ NAME_TO_CLASSNAME.put(XML, OBJECT_CLASS);
+ ## JDBC3.0-JDK1.5-end ##*/
}
+
+ private static void addTypeMapping(String typeName, String javaClass, int sqlType) {
+ NAME_TO_TYPE_MAP.put(typeName, sqlType);
+ TYPE_TO_NAME_MAP.put(sqlType, typeName);
+ if (javaClass != null) {
+ NAME_TO_CLASSNAME.put(typeName, javaClass);
+ CLASSNAME_TO_NAME.put(javaClass, typeName);
+ }
+ }
/**
* This method is used to obtain a short indicating JDBC SQL type for any object.
@@ -159,7 +158,7 @@
return Types.NULL;
}
- Integer sqlType = NAME_TO_TYPE_MAP.get(typeName.toLowerCase());
+ Integer sqlType = NAME_TO_TYPE_MAP.get(typeName);
if (sqlType == null) {
return Types.JAVA_OBJECT;
@@ -174,19 +173,19 @@
* @param typeName
* @return int
*/
- public static final int getSQLTypeFromClass(String typeName) {
+ public static final int getSQLTypeFromClass(String className) {
- if (typeName == null) {
+ if (className == null) {
return Types.NULL;
}
- Integer sqlType = CLASSNAME_TO_TYPE_MAP.get(typeName.toLowerCase());
+ String name = CLASSNAME_TO_NAME.get(className);
- if (sqlType == null) {
+ if (name == null) {
return Types.JAVA_OBJECT;
}
- return sqlType.intValue();
+ return getSQLType(name);
}
/**
@@ -194,9 +193,17 @@
* @param type
* @return
*/
- public static final int getSQLTypeFromRuntimeType(Class type) {
+ public static final int getSQLTypeFromRuntimeType(Class<?> type) {
+ if (type == null) {
+ return Types.NULL;
+ }
+
String name = DataTypeManager.getDataTypeName(type);
+ if (name == null) {
+ return Types.JAVA_OBJECT;
+ }
+
return getSQLType(name);
}
@@ -208,79 +215,24 @@
* @return A String representing the java class name for the given SQL Type.
*/
public static final String getJavaClassName(int jdbcSQLType) {
-
- String javaClassName;
-
- switch(jdbcSQLType) {
- case Types.VARCHAR:
- javaClassName = STRING_CLASS;
- break;
- case Types.LONGVARCHAR:
- javaClassName = STRING_CLASS;
- break;
- case Types.CHAR:
- javaClassName = CHAR_CLASS;
- break;
- case Types.BIT:
- javaClassName = BOOLEAN_CLASS;
- break;
- case Types.DATE:
- javaClassName = DATE_CLASS;
- break;
- case Types.TIME:
- javaClassName = TIME_CLASS;
- break;
- case Types.TIMESTAMP:
- javaClassName = TIMESTAMP_CLASS;
- break;
- case Types.INTEGER:
- javaClassName = INTEGER_CLASS;
- break;
- case Types.REAL:
- javaClassName = FLOAT_CLASS;
- break;
- case Types.FLOAT:
- javaClassName = DOUBLE_CLASS;
- break;
- case Types.DOUBLE:
- javaClassName = DOUBLE_CLASS;
- break;
- case Types.NUMERIC:
- javaClassName = BIGDECIMAL_CLASS;
- break;
- case Types.DECIMAL:
- javaClassName = BIGDECIMAL_CLASS;
- break;
- case Types.BIGINT:
- javaClassName = LONG_CLASS;
- break;
- case Types.TINYINT:
- javaClassName = BYTE_CLASS;
- break;
- case Types.SMALLINT:
- javaClassName = SHORT_CLASS;
- break;
- case Types.JAVA_OBJECT:
- javaClassName = OBJECT_CLASS;
- break;
- case Types.CLOB:
- javaClassName = CLOB_CLASS;
- break;
- case Types.BLOB:
- javaClassName = BLOB_CLASS;
- break;
- //## JDBC4.0-begin ##
- case Types.SQLXML:
- javaClassName = XML_CLASS;
- break;
- //## JDBC4.0-end ##
- default:
- javaClassName = null;
- break;
- }
-
- return javaClassName; // return java class name
+ String className = NAME_TO_CLASSNAME.get(getTypeName(jdbcSQLType));
+
+ if (className == null) {
+ return OBJECT_CLASS;
+ }
+
+ return className;
}
+
+ public static final String getTypeName(int sqlType) {
+ String name = TYPE_TO_NAME_MAP.get(sqlType);
+
+ if (name == null) {
+ return OBJECT;
+ }
+
+ return name;
+ }
public static String[] getMMTypeNames() {
return new String[] {
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java 2009-07-08 22:09:17 UTC (rev 1114)
+++ trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java 2009-07-10 16:03:48 UTC (rev 1115)
@@ -186,6 +186,7 @@
}
assertEquals(MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.TIMESTAMP), Types.TIMESTAMP);
+ assertEquals(MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.XML), Types.SQLXML);
}
public void testRuntimeTypeConversion() throws Exception {
15 years, 5 months
teiid SVN: r1114 - trunk/build/kit-embedded/bin.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-08 18:09:17 -0400 (Wed, 08 Jul 2009)
New Revision: 1114
Modified:
trunk/build/kit-embedded/bin/run.sh
Log:
TEIID-702
Modified: trunk/build/kit-embedded/bin/run.sh
===================================================================
--- trunk/build/kit-embedded/bin/run.sh 2009-07-08 20:37:22 UTC (rev 1113)
+++ trunk/build/kit-embedded/bin/run.sh 2009-07-08 22:09:17 UTC (rev 1114)
@@ -67,8 +67,8 @@
fi
# generate teiid.keystore if does not exist.
-KEYSTORE_FILE = $TEIID_HOME/deploy/teiid.keystore
-if [ ! -f $KEYSTORE_FILE ]
+KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
+if [ ! -f $KEYSTORE_FILE ]; then
"$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
echo "A new key with keystore generated at $KEYSTORE_FILE"
fi
15 years, 5 months
teiid SVN: r1113 - trunk/engine/src/test/java/com/metamatrix/query/processor/proc.
by teiid-commits@lists.jboss.org
Author: loleary
Date: 2009-07-08 16:37:22 -0400 (Wed, 08 Jul 2009)
New Revision: 1113
Modified:
trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
Log:
TEIID-696: Add unit test coverage for use of a procedure variable as non-join criteria
Reviewed by: shawkins
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-07-08 18:01:15 UTC (rev 1112)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-07-08 20:37:22 UTC (rev 1113)
@@ -53,7 +53,10 @@
import com.metamatrix.query.mapping.relational.QueryNode;
import com.metamatrix.query.metadata.TempMetadataID;
import com.metamatrix.query.optimizer.QueryOptimizer;
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
+import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.DefaultCapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.parser.QueryParser;
import com.metamatrix.query.processor.FakeDataManager;
import com.metamatrix.query.processor.ProcessorDataManager;
@@ -83,7 +86,10 @@
}
public static ProcessorPlan getProcedurePlan(String userQuery, FakeMetadataFacade metadata) throws Exception {
-
+ return getProcedurePlan(userQuery, metadata, /*capabilitiesFinder*/null);
+ }
+
+ public static ProcessorPlan getProcedurePlan(String userQuery, FakeMetadataFacade metadata, CapabilitiesFinder capabilitiesFinder) throws Exception {
Command userCommand = QueryParser.getQueryParser().parseCommand(userQuery);
QueryResolver.resolveCommand(userCommand, metadata);
ValidatorReport report = Validator.validate(userCommand, metadata);
@@ -96,7 +102,8 @@
AnalysisRecord analysisRecord = new AnalysisRecord(false, false, DEBUG);
try {
- ProcessorPlan plan = QueryOptimizer.optimizePlan(userCommand, metadata, null, new DefaultCapabilitiesFinder(), analysisRecord, null);
+ if ( capabilitiesFinder == null ) capabilitiesFinder = new DefaultCapabilitiesFinder();
+ ProcessorPlan plan = QueryOptimizer.optimizePlan(userCommand, metadata, null, capabilitiesFinder, analysisRecord, null);
// verify we can get child plans for any plan with no problem
plan.getChildPlans();
@@ -249,6 +256,68 @@
return dataMgr;
}
+ private FakeDataManager exampleDataManager2(FakeMetadataFacade metadata) throws QueryMetadataException, MetaMatrixComponentException {
+ FakeDataManager dataMgr = new FakeDataManager();
+
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
+ List elementIDs = metadata.getElementIDsInGroupID(groupID);
+ List elementSymbols = createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList( new Object[] { "First", new Integer(5), new Boolean(true), new Double(1.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Second", new Integer(15), new Boolean(true), new Double(2.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", new Integer(51), new Boolean(true), new Double(3.003)} ) //$NON-NLS-1$
+ } );
+
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g2"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList( new Object[] { "First", new Integer(5), new Boolean(true), new Double(1.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Second", new Integer(15), new Boolean(true), new Double(2.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", new Integer(51), new Boolean(true), new Double(3.003)} ) //$NON-NLS-1$
+ } );
+
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList( new Object[] { "First", new Integer(5), new Boolean(true), new Double(1.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Second", new Integer(15), new Boolean(true), new Double(2.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", new Integer(51), new Boolean(true), new Double(3.003)} ) //$NON-NLS-1$
+ } );
+
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g2"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList( new Object[] { "First", new Integer(5), new Boolean(true), new Double(1.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Second", new Integer(15), new Boolean(true), new Double(2.003)} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", new Integer(51), new Boolean(true), new Double(3.003)} ) //$NON-NLS-1$
+ } );
+
+ return dataMgr;
+ }
+
private FakeDataManager exampleDataManagerPm5(FakeMetadataFacade metadata) throws QueryMetadataException, MetaMatrixComponentException {
FakeDataManager dataMgr = new FakeDataManager();
@@ -2632,6 +2701,162 @@
ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
helpTestProcess(plan, 8, dataMgr);
}
+
+ /**
+ * Test the use of a procedure variable in the criteria of a LEFT OUTER
+ * JOIN which will be optimized out as non-JOIN criteria.
+ * <p>
+ * This test case verifies that the procedure variable will not be pushed
+ * to the data manager when a federated source JOIN is performed.
+ *
+ * @throws Exception
+ */
+ public void testRomvalOfNonJoinCritWithReference() throws Exception {
+ String proc = ""; //$NON-NLS-1$
+
+ String sql = ""; //$NON-NLS-1$
+ sql += "SELECT " + //$NON-NLS-1$
+ " pm1.g1.e1 AS pm1g1e1, " + //$NON-NLS-1$
+ " pm2.g2.e1 AS pm2g2e1, " + //$NON-NLS-1$
+ " pm1.g1.e2 AS pm1g1e2, " + //$NON-NLS-1$
+ " pm2.g2.e2 AS pm2g2e2 " + //$NON-NLS-1$
+ "FROM " + //$NON-NLS-1$
+ " pm1.g1 " + //$NON-NLS-1$
+ "LEFT OUTER JOIN pm2.g2 " + //$NON-NLS-1$
+ " ON pm1.g1.e1 = pm2.g2.e1 " + //$NON-NLS-1$
+ " AND pm2.g2.e2 = VARIABLES.myVar "; //$NON-NLS-1$
+ proc += "CREATE VIRTUAL PROCEDURE " + //$NON-NLS-1$
+ "BEGIN " + //$NON-NLS-1$
+ " declare integer myVar = 5;" + //$NON-NLS-1$
+ " " + sql + ";" + //$NON-NLS-1$ //$NON-NLS-2$
+ "END"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = createProcedureMetadata(proc);
+ String userQuery = "SELECT * FROM (EXEC pm1.sq1()) as proc"; //$NON-NLS-1$
+ FakeDataManager dataMgr = exampleDataManager2(metadata);
+ ProcessorPlan plan = getProcedurePlan(userQuery, metadata);
+
+ List[] expected = new List[] {
+ Arrays.asList( new Object[] { "First", "First", new Integer(5), new Integer(5)} ), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList( new Object[] { "Second", null, new Integer(15), null} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", null, new Integer(51), null} ) //$NON-NLS-1$
+ };
+ helpTestProcess(plan, expected, dataMgr);
+ }
+
+ /**
+ * Test the use of a procedure variable in the criteria of a LEFT OUTER
+ * JOIN which will be optimized out as non-JOIN criteria.
+ * <p>
+ * This test case verifies that the procedure variable will not be pushed
+ * to the data manager when a federated source JOIN is performed and the
+ * physical source supports all capabilities.
+ *
+ * @throws Exception
+ */
+ public void testRomvalOfNonJoinCritWithReference2() throws Exception {
+ String proc = ""; //$NON-NLS-1$
+
+ String sql = ""; //$NON-NLS-1$
+ sql += "SELECT " + //$NON-NLS-1$
+ " pm1.g1.e1 AS pm1g1e1, " + //$NON-NLS-1$
+ " pm2.g2.e1 AS pm2g2e1, " + //$NON-NLS-1$
+ " pm1.g1.e2 AS pm1g1e2, " + //$NON-NLS-1$
+ " pm2.g2.e2 AS pm2g2e2 " + //$NON-NLS-1$
+ "FROM " + //$NON-NLS-1$
+ " pm1.g1 " + //$NON-NLS-1$
+ "LEFT OUTER JOIN pm2.g2 " + //$NON-NLS-1$
+ " ON pm1.g1.e1 = pm2.g2.e1 " + //$NON-NLS-1$
+ " AND pm2.g2.e2 = VARIABLES.myVar "; //$NON-NLS-1$
+
+ proc += "CREATE VIRTUAL PROCEDURE " + //$NON-NLS-1$
+ "BEGIN " + //$NON-NLS-1$
+ " declare integer myVar = 5;" + //$NON-NLS-1$
+ " " + sql + ";" + //$NON-NLS-1$ //$NON-NLS-2$
+ "END"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities() {
+ public boolean supportsCapability(String capability) {
+ return true;
+ }
+ public boolean supportsFunction(String functionName) {
+ return true;
+ }
+ };
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = createProcedureMetadata(proc);
+ String userQuery = "SELECT * FROM (EXEC pm1.sq1()) as proc"; //$NON-NLS-1$
+ FakeDataManager dataMgr = exampleDataManager2(metadata);
+ ProcessorPlan plan = getProcedurePlan(userQuery, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList( new Object[] { "First", "First", new Integer(5), new Integer(5)} ), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList( new Object[] { "Second", null, new Integer(15), null} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", null, new Integer(51), null} ) //$NON-NLS-1$
+ };
+ helpTestProcess(plan, expected, dataMgr);
+ }
+
+ /**
+ * Test the use of a procedure variable in the criteria of a LEFT OUTER
+ * JOIN which will be optimized out as non-JOIN criteria.
+ * <p>
+ * This test case verifies that the procedure variable will not be pushed
+ * to the data manager when a JOIN of a temporary table and source are
+ * performed and the physical source supports all capabilities.
+ *
+ * @throws Exception
+ */
+ public void testRomvalOfNonJoinCritWithReference3() throws Exception {
+ String proc = ""; //$NON-NLS-1$
+
+ String sql = ""; //$NON-NLS-1$
+ sql += "SELECT " + //$NON-NLS-1$
+ " #temp1.e1 AS pm1g1e1, " + //$NON-NLS-1$
+ " pm2.g2.e1 AS pm2g2e1, " + //$NON-NLS-1$
+ " #temp1.e2 AS pm1g1e2, " + //$NON-NLS-1$
+ " pm2.g2.e2 AS pm2g2e2 " + //$NON-NLS-1$
+ "FROM " + //$NON-NLS-1$
+ " #temp1 " + //$NON-NLS-1$
+ "LEFT OUTER JOIN pm2.g2 " + //$NON-NLS-1$
+ " ON #temp1.e1 = pm2.g2.e1 " + //$NON-NLS-1$
+ " AND pm2.g2.e2 = VARIABLES.myVar "; //$NON-NLS-1$
+
+ proc += "CREATE VIRTUAL PROCEDURE " + //$NON-NLS-1$
+ "BEGIN " + //$NON-NLS-1$
+ " declare integer myVar = 5;" + //$NON-NLS-1$
+ " SELECT * INTO #temp1 FROM pm1.g1;" + //$NON-NLS-1$
+ " " + sql + ";" + //$NON-NLS-1$ //$NON-NLS-2$
+ "END"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities() {
+ public boolean supportsCapability(String capability) {
+ return true;
+ }
+ public boolean supportsFunction(String functionName) {
+ return true;
+ }
+ };
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = createProcedureMetadata(proc);
+ String userQuery = "SELECT * FROM (EXEC pm1.sq1()) as proc"; //$NON-NLS-1$
+ FakeDataManager dataMgr = exampleDataManager2(metadata);
+ ProcessorPlan plan = getProcedurePlan(userQuery, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList( new Object[] { "First", "First", new Integer(5), new Integer(5)} ), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList( new Object[] { "Second", null, new Integer(15), null} ), //$NON-NLS-1$
+ Arrays.asList( new Object[] { "Third", null, new Integer(51), null} ) //$NON-NLS-1$
+ };
+ helpTestProcess(plan, expected, dataMgr);
+ }
+
private static final boolean DEBUG = false;
}
15 years, 5 months
teiid SVN: r1112 - in trunk/metadata/src/test/java/com/metamatrix: dqp and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-08 14:01:15 -0400 (Wed, 08 Jul 2009)
New Revision: 1112
Removed:
trunk/metadata/src/test/java/com/metamatrix/dqp/service/
Modified:
trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java
Log:
TEIID-705 fix for post process application of case insensitive match
Modified: trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java 2009-07-08 17:53:27 UTC (rev 1111)
+++ trunk/metadata/src/test/java/com/metamatrix/connector/metadata/index/TestMetadataResultsPostProcessor.java 2009-07-08 18:01:15 UTC (rev 1112)
@@ -92,8 +92,26 @@
Object filteredRecord = processor.filterBySearchCriteria(modelRecord, criteria);
assertNotNull(filteredRecord);
- }
+ }
+ public void testFilterWildCardMatch1() {
+ String modelName = "PartsSupplier"; //$NON-NLS-1$
+
+ MetadataLiteralCriteria literalcriteria = new MetadataLiteralCriteria(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD, "*SUPPLIE?"); //$NON-NLS-1$
+ literalcriteria.setFieldFunction("UCASE"); //$NON-NLS-1$
+
+ Map criteria = new HashMap();
+ criteria.put(AbstractMetadataRecord.MetadataFieldNames.FULL_NAME_FIELD.toUpperCase(), literalcriteria);
+
+ ModelRecordImpl modelRecord = new ModelRecordImpl();
+ modelRecord.setFullName(modelName);
+
+ MetadataResultsPostProcessor processor = helpGetProcessor();
+ Object filteredRecord = processor.filterBySearchCriteria(modelRecord, criteria);
+
+ assertNotNull(filteredRecord);
+ }
+
public void testFilterNullMatch() {
String uuid = null;
15 years, 5 months
teiid SVN: r1111 - trunk/adminshell.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-08 13:53:27 -0400 (Wed, 08 Jul 2009)
New Revision: 1111
Modified:
trunk/adminshell/
Log:
adding a ignore
Property changes on: trunk/adminshell
___________________________________________________________________
Name: svn:ignore
- target
.project
.settings
.classpath
+ target
.project
.settings
.classpath
log
15 years, 5 months
teiid SVN: r1110 - in trunk: common-core/src/main/java/com/metamatrix/common/util/crypto and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-08 13:51:32 -0400 (Wed, 08 Jul 2009)
New Revision: 1110
Added:
trunk/build/kit-embedded/bin/encrypt.bat
trunk/build/kit-embedded/bin/encrypt.sh
Modified:
trunk/build/kit-embedded/bin/run.bat
trunk/build/kit-embedded/bin/run.sh
trunk/common-core/src/main/java/com/metamatrix/common/util/crypto/CryptoUtil.java
Log:
TEIID-702: providing scripts to encrypt passwords
Added: trunk/build/kit-embedded/bin/encrypt.bat
===================================================================
--- trunk/build/kit-embedded/bin/encrypt.bat (rev 0)
+++ trunk/build/kit-embedded/bin/encrypt.bat 2009-07-08 17:51:32 UTC (rev 1110)
@@ -0,0 +1,45 @@
+@echo off
+rem
+rem This script file encrypts the passed in clear text and spits out encypted form
+rem
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+ set "DIRNAME=%~dp0%"
+) else (
+ set DIRNAME=.\
+)
+
+pushd %DIRNAME%..
+if "x%TEIID_HOME%" == "x" (
+ set "TEIID_HOME=%CD%"
+)
+popd
+
+set DIRNAME=
+
+if "x%JAVA_HOME%" == "x" (
+ set JAVA=java
+ echo JAVA_HOME is not set. Unexpected results may occur.
+ echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
+) else (
+ set "JAVA=%JAVA_HOME%\bin\java"
+ if exist "%JAVA_HOME%\lib\tools.jar" (
+ set "JAVAC_JAR=%JAVA_HOME%\lib\tools.jar"
+ )
+)
+
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\deploy;%TEIID_HOME%\client\*;%TEIID_HOME%\lib\*;
+set KEYSTORE_FILE=%TEIID_HOME%\deploy\teiid.keystore
+if not exist %KEYSTORE_FILE (
+ %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
+ echo A new key with keystore generated at %KEYSTORE_FILE%
+)
+
+if "x%1%" == "x"(
+ echo Provide text phrase to encrypt.
+) else (
+ %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -key %KEYSTORE_FILE% -encrypt %1%
+)
Added: trunk/build/kit-embedded/bin/encrypt.sh
===================================================================
--- trunk/build/kit-embedded/bin/encrypt.sh (rev 0)
+++ trunk/build/kit-embedded/bin/encrypt.sh 2009-07-08 17:51:32 UTC (rev 1110)
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+DIRNAME=`dirname $0`
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+linux=false;
+case "`uname`" in
+ CYGWIN*)
+ cygwin=true
+ ;;
+
+ Linux)
+ linux=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$TEIID_HOME" ] &&
+ TEIID_HOME=`cygpath --unix "$TEIID_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Setup TEIID_HOME
+if [ "x$TEIID_HOME" = "x" ]; then
+ # get the full path (without any relative bits)
+ TEIID_HOME=`cd $DIRNAME/..; pwd`
+fi
+export TEIID_HOME
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+ if [ "x$JAVA_HOME" != "x" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA="java"
+ fi
+fi
+
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/deploy:$TEIID_HOME/client/*:$TEIID_HOME/lib/*"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ TEIID_HOME=`cygpath --path --windows "$TEIID_HOME"`
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ TEIID_CLASSPATH=`cygpath --path --windows "$TEIID_CLASSPATH"`
+fi
+
+# generate teiid.keystore if does not exist.
+KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
+if [ ! -f $KEYSTORE_FILE ]; then
+ "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
+ echo "A new key with keystore generated at $KEYSTORE_FILE"
+fi
+
+if [ "x$1" = "x" ]; then
+ echo "Provide text phrase to encrypt."
+else
+ "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -key $KEYSTORE_FILE -encrypt $1
+fi
\ No newline at end of file
Modified: trunk/build/kit-embedded/bin/run.bat
===================================================================
--- trunk/build/kit-embedded/bin/run.bat 2009-07-08 15:37:10 UTC (rev 1109)
+++ trunk/build/kit-embedded/bin/run.bat 2009-07-08 17:51:32 UTC (rev 1110)
@@ -47,6 +47,13 @@
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+rem Generate teiid.keystore file
+set KEYSTORE_FILE = %TEIID_HOME%\deploy\teiid.keystore
+if not exist %KEYSTORE_FILE% (
+ %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
+ echo A new key with keystore generated at %KEYSTORE_FILE%
+)
+
echo ===============================================================================
echo.
echo Teiid Bootstrap Environment
Modified: trunk/build/kit-embedded/bin/run.sh
===================================================================
--- trunk/build/kit-embedded/bin/run.sh 2009-07-08 15:37:10 UTC (rev 1109)
+++ trunk/build/kit-embedded/bin/run.sh 2009-07-08 17:51:32 UTC (rev 1110)
@@ -66,6 +66,13 @@
TEIID_CLASSPATH=`cygpath --path --windows "$TEIID_CLASSPATH"`
fi
+# generate teiid.keystore if does not exist.
+KEYSTORE_FILE = $TEIID_HOME/deploy/teiid.keystore
+if [ ! -f $KEYSTORE_FILE ]
+ "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
+ echo "A new key with keystore generated at $KEYSTORE_FILE"
+fi
+
# Display our environment
echo "========================================================================="
echo ""
Modified: trunk/common-core/src/main/java/com/metamatrix/common/util/crypto/CryptoUtil.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/util/crypto/CryptoUtil.java 2009-07-08 15:37:10 UTC (rev 1109)
+++ trunk/common-core/src/main/java/com/metamatrix/common/util/crypto/CryptoUtil.java 2009-07-08 17:51:32 UTC (rev 1110)
@@ -22,6 +22,7 @@
package com.metamatrix.common.util.crypto;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
@@ -366,5 +367,53 @@
public static synchronized boolean isInitialized() {
return CRYPTOR == null;
}
-
+
+ public static void main(String[] args) throws Exception {
+ if (args.length < 1) {
+ printUsage();
+ }
+
+ int i = 0;
+ if (args.length == 2 && args[i].equals("-genkey")) { //$NON-NLS-1$
+ String keyName = args[++i];
+ if (keyName == null) {
+ printUsage();
+ }
+ SymmetricCryptor.generateAndSaveKey(keyName);
+ return;
+ }
+ else if (args.length == 4 && args[i].equals("-key")) { //$NON-NLS-1$
+ String keyFile = args[++i];
+ if (keyFile == null) {
+ printUsage();
+ }
+
+ File key = new File(keyFile);
+ if (!key.exists()) {
+ System.out.println("Key file does not exist at "+keyFile); //$NON-NLS-1$
+ }
+ else {
+ CryptoUtil.init(key.toURI().toURL());
+ }
+
+ ++i;
+ if (args[i].equals("-encrypt")) { //$NON-NLS-1$
+ String clearText = args[++i];
+ if (clearText == null) {
+ printUsage();
+ }
+ System.out.println("Encypted Text:"+stringEncrypt(clearText)); //$NON-NLS-1$
+ return;
+ }
+ }
+ printUsage();
+ }
+
+ private static void printUsage() {
+ System.out.println("java CryptoUtil <option>"); //$NON-NLS-1$
+ System.out.println("options:"); //$NON-NLS-1$
+ System.out.println("\t-genkey <filename> # Generates password key file"); //$NON-NLS-1$
+ System.out.println("\t-key <keyfile> -encrypt <cleartext> # Encrypts the given clear text string"); //$NON-NLS-1$
+ System.exit(0);
+ }
}
15 years, 5 months
Build failed in Hudson: Teiid-NightlyBuild » Metadata #504
by jboss-qa-internal@redhat.com
See http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$...
------------------------------------------
[...truncated 6 lines...]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 113 source files to http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$...
[HUDSON] Archiving http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... to /home/hudson/hudson_workspace/jobs/Teiid-NightlyBuild/modules/org.jboss.teiid$teiid-metadata/builds/2009-07-08_01-09-27/archive/org.jboss.teiid/teiid-metadata/6.2.0-SNAPSHOT/pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[43,40] cannot find symbol
symbol : class IndexFile
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[44,40] cannot find symbol
symbol : class MetadataConnectorConstants
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[45,40] cannot find symbol
symbol : class MultiObjectSource
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[46,40] cannot find symbol
symbol : class PropertyFileObjectSource
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[61,38] cannot find symbol
symbol : class RuntimeMetadataPlugin
location: package com.metamatrix.metadata.runtime
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[38,40] cannot find symbol
symbol : class FileRecordImpl
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[39,40] cannot find symbol
symbol : class MetadataConnectorConstants
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[40,40] cannot find symbol
symbol : class RuntimeVdbRecord
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[38,40] cannot find symbol
symbol : class FileRecordImpl
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[171,63] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataResultsPostProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[171,12] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataResultsPostProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[28,40] cannot find symbol
symbol : class MetadataConnectorConstants
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[45,40] cannot find symbol
symbol : class FileRecordImpl
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[895,18] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.dqp.service.metadata.RecordFactory
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[56,38] cannot find symbol
symbol : class RuntimeMetadataPlugin
location: package com.metamatrix.metadata.runtime
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[39,38] cannot find symbol
symbol : class RuntimeMetadataPlugin
location: package com.metamatrix.metadata.runtime
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[31,40] cannot find symbol
symbol : class MetadataConnectorConstants
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[32,40] cannot find symbol
symbol : class ResultsIterator
location: package com.metamatrix.connector.metadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[47,60] package ResultsIterator does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[56,11] cannot find symbol
symbol : class ResultsIterator
location: class com.metamatrix.connector.metadata.internal.ObjectQueryProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[123,32] cannot find symbol
symbol : class IndexFile
location: class com.metamatrix.dqp.service.metadata.QueryMetadataCache
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[125,2] cannot find symbol
symbol : class PropertyFileObjectSource
location: class com.metamatrix.dqp.service.metadata.QueryMetadataCache
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[125,52] cannot find symbol
symbol : class PropertyFileObjectSource
location: class com.metamatrix.dqp.service.metadata.QueryMetadataCache
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[126,40] cannot find symbol
symbol : class MultiObjectSource
location: class com.metamatrix.dqp.service.metadata.QueryMetadataCache
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[126,69] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.dqp.service.metadata.QueryMetadataCache
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[221,62] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[472,75] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[82,50] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.index.MetadataConnectorMetadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[125,34] cannot find symbol
symbol : class RuntimeVdbRecord
location: class com.metamatrix.connector.metadata.index.MetadataConnectorMetadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[275,123] package FileRecordImpl.MetadataMethodNames does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[283,12] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataConnectorMetadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[283,40] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataConnectorMetadata
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[104,34] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataResultsPostProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[105,16] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataResultsPostProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[105,75] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.connector.metadata.index.MetadataResultsPostProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[55,35] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.internal.ReflectionWrapper
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[88,35] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.internal.ReflectionWrapper
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[898,14] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.dqp.service.metadata.RecordFactory
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[898,40] cannot find symbol
symbol : class FileRecordImpl
location: class com.metamatrix.dqp.service.metadata.RecordFactory
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[86,94] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[343,66] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[367,66] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[379,63] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[391,66] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[405,77] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[405,92] operator + cannot be applied to RuntimeMetadataPlugin.Util.getString,int
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[405,22] reference to UnsupportedOperationException is ambiguous, both method UnsupportedOperationException(java.lang.String) in java.lang.UnsupportedOperationException and method UnsupportedOperationException(java.lang.Throwable) in java.lang.UnsupportedOperationException match
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[421,77] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[421,92] operator + cannot be applied to RuntimeMetadataPlugin.Util.getString,int
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[421,22] reference to UnsupportedOperationException is ambiguous, both method UnsupportedOperationException(java.lang.String) in java.lang.UnsupportedOperationException and method UnsupportedOperationException(java.lang.Throwable) in java.lang.UnsupportedOperationException match
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[463,81] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[463,96] operator + cannot be applied to RuntimeMetadataPlugin.Util.getString,int
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[463,26] reference to UnsupportedOperationException is ambiguous, both method UnsupportedOperationException(java.lang.String) in java.lang.UnsupportedOperationException and method UnsupportedOperationException(java.lang.Throwable) in java.lang.UnsupportedOperationException match
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[499,81] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[499,96] operator + cannot be applied to RuntimeMetadataPlugin.Util.getString,int
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[499,26] reference to UnsupportedOperationException is ambiguous, both method UnsupportedOperationException(java.lang.String) in java.lang.UnsupportedOperationException and method UnsupportedOperationException(java.lang.Throwable) in java.lang.UnsupportedOperationException match
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[508,65] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[666,59] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[670,65] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[682,79] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[743,58] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[747,64] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[767,70] package RuntimeMetadataPlugin does not exist
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[216,35] cannot find symbol
symbol : variable RuntimeMetadataPlugin
location: class com.metamatrix.modeler.internal.core.index.ModelFileUtil
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[250,35] cannot find symbol
symbol : variable RuntimeMetadataPlugin
location: class com.metamatrix.modeler.internal.core.index.ModelFileUtil
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[252,35] cannot find symbol
symbol : variable RuntimeMetadataPlugin
location: class com.metamatrix.modeler.internal.core.index.ModelFileUtil
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[309,31] cannot find symbol
symbol : variable RuntimeMetadataPlugin
location: class com.metamatrix.modeler.internal.core.index.ModelFileUtil
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[324,38] cannot find symbol
symbol : variable RuntimeMetadataPlugin
location: class com.metamatrix.modeler.internal.core.index.ModelFileUtil
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[60,72] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.internal.ObjectQueryProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[62,74] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.internal.ObjectQueryProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[73,19] cannot find symbol
symbol : class ResultsIterator
location: class com.metamatrix.connector.metadata.internal.ObjectQueryProcessor
http://hudson.qa.jboss.com/hudson/job/Teiid-NightlyBuild/org.jboss.teiid$... :[111,75] cannot find symbol
symbol : variable MetadataConnectorConstants
location: class com.metamatrix.connector.metadata.internal.ObjectQueryProcessor
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 35 seconds
[INFO] Finished at: Wed Jul 08 01:12:06 EDT 2009
[INFO] Final Memory: 123M/878M
[INFO] ------------------------------------------------------------------------
15 years, 5 months
teiid SVN: r1109 - in trunk/engine/src: test/java/com/metamatrix/query/processor/relational and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-08 11:37:10 -0400 (Wed, 08 Jul 2009)
New Revision: 1109
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java
Log:
TEIID-709 fix for loosing partial patches with dup remove
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2009-07-08 05:16:59 UTC (rev 1108)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2009-07-08 15:37:10 UTC (rev 1109)
@@ -360,9 +360,8 @@
} catch (MetaMatrixProcessingException e) {
throw new MetaMatrixComponentException(e);
}
- } catch (BlockedOnMemoryException e) {
+ } finally {
tc.saveBatch();
- throw e;
}
outTs = null;
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java 2009-07-08 05:16:59 UTC (rev 1108)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestSortNode.java 2009-07-08 15:37:10 UTC (rev 1109)
@@ -32,12 +32,19 @@
import java.util.Set;
import org.junit.Test;
+import org.mockito.Mockito;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
+import com.metamatrix.common.buffer.BlockedException;
import com.metamatrix.common.buffer.BlockedOnMemoryException;
import com.metamatrix.common.buffer.BufferManager;
+import com.metamatrix.common.buffer.BufferManagerFactory;
import com.metamatrix.common.buffer.TupleBatch;
+import com.metamatrix.common.buffer.TupleSource;
+import com.metamatrix.common.buffer.TupleSourceID;
+import com.metamatrix.common.buffer.BufferManager.TupleSourceStatus;
+import com.metamatrix.common.buffer.BufferManager.TupleSourceType;
import com.metamatrix.common.buffer.impl.SizeUtility;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.query.processor.relational.NodeTestUtil.TestableBufferManagerImpl;
@@ -314,4 +321,25 @@
helpTestBiggerSort(5, 2);
}
+ @Test public void testDupRemove() throws Exception {
+ ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
+ es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
+ TupleSourceID tsid = bm.createTupleSource(Arrays.asList(es1), new String[] {DataTypeManager.DefaultDataTypes.INTEGER}, "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$
+ bm.addTupleBatch(tsid, new TupleBatch(1, new List[] {Arrays.asList(1)}));
+ SortUtility su = new SortUtility(tsid, Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.DUP_REMOVE, bm, "test", true); //$NON-NLS-1$
+ TupleSourceID out = su.sort();
+ TupleSource ts = bm.getTupleSource(out);
+ assertEquals(Arrays.asList(1), ts.nextTuple());
+ try {
+ ts.nextTuple();
+ fail();
+ } catch (BlockedException e) {
+
+ }
+ bm.addTupleBatch(tsid, new TupleBatch(2, new List[] {Arrays.asList(2)}));
+ su.sort();
+ assertEquals(Arrays.asList(2), ts.nextTuple());
+ }
+
}
15 years, 5 months