teiid SVN: r2049 - trunk/runtime/src/main/java/org/teiid/transport.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-11 21:49:40 -0400 (Sun, 11 Apr 2010)
New Revision: 2049
Modified:
trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java
trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
Log:
adding an explicit logoff in the event of a disconnected channel
Modified: trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java 2010-04-11 01:59:21 UTC (rev 2048)
+++ trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java 2010-04-12 01:49:40 UTC (rev 2049)
@@ -36,5 +36,7 @@
void exceptionOccurred(Throwable t);
+ void disconnected();
+
void onConnection() throws CommunicationException;
}
\ No newline at end of file
Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-04-11 01:59:21 UTC (rev 2048)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-04-12 01:49:40 UTC (rev 2049)
@@ -217,6 +217,7 @@
ChannelListener listener = this.listeners.remove(e.getChannel());
if (listener != null) {
LogManager.logDetail(LogConstants.CTX_TRANSPORT, NetPlugin.Util.getString("SSLAwareChannelHandler.channel_closed")); //$NON-NLS-1$
+ listener.disconnected();
}
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-04-11 01:59:21 UTC (rev 2048)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-04-12 01:49:40 UTC (rev 2049)
@@ -26,6 +26,7 @@
import java.net.InetSocketAddress;
import java.net.SocketAddress;
+import org.teiid.client.security.ILogon;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.net.CommunicationException;
import org.teiid.net.NetPlugin;
@@ -106,6 +107,22 @@
}
this.objectSocket.write(handshake);
}
+
+ @Override
+ public void disconnected() {
+ if (workContext.getSessionId() != -1) {
+ workContext.runInContext(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ csr.getClientService(ILogon.class).logoff();
+ } catch (Exception e) {
+ LogManager.logDetail(LogConstants.CTX_TRANSPORT, e, "Exception closing client instance"); //$NON-NLS-1$
+ }
+ }
+ });
+ }
+ }
private void receivedHahdshake(Handshake handshake) throws CommunicationException {
if (usingEncryption) {
14 years, 8 months
teiid SVN: r2048 - in trunk/connectors/connector-jdbc/src: test/java/org/teiid/connector/jdbc and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-10 21:59:21 -0400 (Sat, 10 Apr 2010)
New Revision: 2048
Added:
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCManagedConnectionFactory.java
Modified:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCConnector.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCSourceConnection.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCUpdateExecution.java
Log:
TEIID-833 renaming the method and adding a test of the getTranslator method
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -68,7 +68,7 @@
protected JDBCBaseExecution(Connection connection, ExecutionContext context, JDBCManagedConnectionFactory env) throws ConnectorException {
this.connection = connection;
- this.sqlTranslator = env.getExtensionTranslationClass();
+ this.sqlTranslator = env.getTranslator();
this.logger = env.getLogger();
this.context = context;
this.env = env;
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCConnector.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCConnector.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCConnector.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -65,7 +65,7 @@
throw new ConnectorException(JDBCPlugin.Util.getString("JDBCSourceConnectionFactory.Missing_JDBC_jndi_1")); //$NON-NLS-1$
}
- capabilities = config.getExtensionTranslationClass().getConnectorCapabilities();
+ capabilities = config.getTranslator().getConnectorCapabilities();
logger.logInfo(JDBCPlugin.Util.getString("JDBCConnector.JDBCConnector_started._4")); //$NON-NLS-1$
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -56,7 +56,7 @@
return extensionTranslationClassName;
}
- public Translator getExtensionTranslationClass() throws ConnectorException {
+ public Translator getTranslator() throws ConnectorException {
if (this.sqlTranslator == null) {
try {
String className = getExtensionTranslationClassName();
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCSourceConnection.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCSourceConnection.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCSourceConnection.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -54,7 +54,7 @@
public JDBCSourceConnection(java.sql.Connection connection, JDBCManagedConnectionFactory environment) throws ConnectorException {
this.physicalConnection = connection;
this.environment = environment;
- this.sqlTranslator = environment.getExtensionTranslationClass();
+ this.sqlTranslator = environment.getTranslator();
this.sqlTranslator.afterConnectionCreation(connection);
}
Added: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCManagedConnectionFactory.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCManagedConnectionFactory.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -0,0 +1,43 @@
+/*
+ * 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.connector.jdbc;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.teiid.connector.jdbc.sqlserver.SQLServerSQLTranslator;
+import org.teiid.connector.jdbc.translator.Translator;
+public class TestJDBCManagedConnectionFactory {
+
+ @Test public void testGetExtensionTranslationClassDefault() throws Exception {
+ JDBCManagedConnectionFactory mcf = new JDBCManagedConnectionFactory();
+ assertSame(Translator.class, mcf.getTranslator().getClass());
+ }
+
+ @Test public void testGetExtensionTranslationClass() throws Exception {
+ JDBCManagedConnectionFactory mcf = new JDBCManagedConnectionFactory();
+ mcf.setExtensionTranslationClassName(SQLServerSQLTranslator.class.getName());
+ assertSame(SQLServerSQLTranslator.class, mcf.getTranslator().getClass());
+ }
+
+}
Property changes on: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCManagedConnectionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -48,7 +48,7 @@
Translator sqlTranslator = new Translator();
JDBCManagedConnectionFactory config = Mockito.mock(JDBCManagedConnectionFactory.class);
- Mockito.stub(config.getExtensionTranslationClass()).toReturn(sqlTranslator);
+ Mockito.stub(config.getTranslator()).toReturn(sqlTranslator);
Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
@@ -66,7 +66,7 @@
Translator sqlTranslator = new Translator();
JDBCManagedConnectionFactory config = Mockito.mock(JDBCManagedConnectionFactory.class);
- Mockito.stub(config.getExtensionTranslationClass()).toReturn(sqlTranslator);
+ Mockito.stub(config.getTranslator()).toReturn(sqlTranslator);
Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config );
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCUpdateExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCUpdateExecution.java 2010-04-11 01:56:24 UTC (rev 2047)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCUpdateExecution.java 2010-04-11 01:59:21 UTC (rev 2048)
@@ -54,7 +54,7 @@
Mockito.stub(connection.prepareStatement("INSERT INTO SmallA (IntKey, IntNum) VALUES (?, ?)")).toReturn(p); //$NON-NLS-1$
JDBCManagedConnectionFactory config = Mockito.mock(JDBCManagedConnectionFactory.class);
- Mockito.stub(config.getExtensionTranslationClass()).toReturn(new Translator());
+ Mockito.stub(config.getTranslator()).toReturn(new Translator());
Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
JDBCUpdateExecution updateExecution = new JDBCUpdateExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
14 years, 8 months
teiid SVN: r2047 - in trunk/connector-api/src/main: resources/org/teiid/connector and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-10 21:56:24 -0400 (Sat, 10 Apr 2010)
New Revision: 2047
Modified:
trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnection.java
trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnection.java
trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnector.java
trunk/connector-api/src/main/resources/org/teiid/connector/i18n.properties
Log:
TEIID-833 adding connection validation to teiid managedconnections
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnection.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnection.java 2010-04-11 01:03:23 UTC (rev 2046)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnection.java 2010-04-11 01:56:24 UTC (rev 2047)
@@ -136,4 +136,8 @@
l.connectionClosed(ce);
}
}
+
+ public boolean isValid() {
+ return this.conn.isAlive();
+ }
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java 2010-04-11 01:03:23 UTC (rev 2046)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java 2010-04-11 01:56:24 UTC (rev 2047)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
@@ -34,6 +35,7 @@
import javax.resource.spi.ManagedConnectionFactory;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.ResourceAdapterAssociation;
+import javax.resource.spi.ValidatingManagedConnectionFactory;
import javax.security.auth.Subject;
import org.teiid.connector.api.Connector;
@@ -46,7 +48,7 @@
import com.metamatrix.core.MetaMatrixCoreException;
import com.metamatrix.core.util.ReflectionHelper;
-public class BasicManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation, ConnectorEnvironment {
+public class BasicManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation, ConnectorEnvironment, ValidatingManagedConnectionFactory {
private static final long serialVersionUID = -7302713800883776790L;
private static final TypeFacility TYPE_FACILITY = new TypeFacilityImpl();
@@ -210,5 +212,19 @@
} catch(InstantiationException e) {
throw new ConnectorException(e);
}
- }
+ }
+
+ @Override
+ public Set<BasicManagedConnection> getInvalidConnections(Set arg0) throws ResourceException {
+ HashSet<BasicManagedConnection> result = new HashSet<BasicManagedConnection>();
+ for (Object object : arg0) {
+ if (object instanceof BasicManagedConnection) {
+ BasicManagedConnection bmc = (BasicManagedConnection)object;
+ if (!bmc.isValid()) {
+ result.add(bmc);
+ }
+ }
+ }
+ return result;
+ }
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnection.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnection.java 2010-04-11 01:03:23 UTC (rev 2046)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnection.java 2010-04-11 01:56:24 UTC (rev 2047)
@@ -26,6 +26,7 @@
import javax.resource.spi.LocalTransaction;
import javax.transaction.xa.XAResource;
+import org.teiid.connector.DataPlugin;
import org.teiid.connector.api.Connection;
import org.teiid.connector.api.ConnectorCapabilities;
import org.teiid.connector.api.ConnectorEnvironment;
@@ -70,11 +71,10 @@
@Override
public ConnectorCapabilities getCapabilities() throws ConnectorException {
if (this.caps == null) {
- ConnectorCapabilities caps = conn.getCapabilities();
+ this.caps = conn.getCapabilities();
if (caps != null && this.env.getOverrideCapabilities() != null) {
caps = (ConnectorCapabilities) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {ConnectorCapabilities.class}, new CapabilitesOverloader(caps, this.env.getOverrideCapabilities()));
}
- this.caps = caps;
}
return this.caps;
}
@@ -99,7 +99,7 @@
if (this.conn instanceof MetadataProvider) {
((MetadataProvider) this.conn).getConnectorMetadata(metadataFactory);
} else {
- throw new ConnectorException("Connector is not capable of providing metadata. Extend connector with MetadataProvider interface");
+ throw new ConnectorException(DataPlugin.Util.getString("WrappedConnection.no_metadata")); //$NON-NLS-1$
}
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnector.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnector.java 2010-04-11 01:03:23 UTC (rev 2046)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/WrappedConnector.java 2010-04-11 01:56:24 UTC (rev 2047)
@@ -76,9 +76,6 @@
if (this.caps == null) {
try {
Object o = ReflectionHelper.create(this.mcf.getCapabilitiesClass(), null, Thread.currentThread().getContextClassLoader());
- if(!(o instanceof ConnectorCapabilities)) {
- throw new ConnectorException("Invalid Connector Capabilities class specified="+this.mcf.getCapabilitiesClass());
- }
this.caps = (ConnectorCapabilities)o;
} catch (MetaMatrixCoreException e) {
throw new ConnectorException(e);
Modified: trunk/connector-api/src/main/resources/org/teiid/connector/i18n.properties
===================================================================
--- trunk/connector-api/src/main/resources/org/teiid/connector/i18n.properties 2010-04-11 01:03:23 UTC (rev 2046)
+++ trunk/connector-api/src/main/resources/org/teiid/connector/i18n.properties 2010-04-11 01:56:24 UTC (rev 2047)
@@ -66,4 +66,6 @@
MetadataFactory.unknown_datatype=Unknown datatype {0}
MetadataFactory.no_column_found=No column found with name {0}
MetadataFactory.duplicate_name="Non-uniquely named record detected ''{0}''
-MetadataFactory.invalid_name=Invalid column name ''{0}'', cannot contain the . character.
\ No newline at end of file
+MetadataFactory.invalid_name=Invalid column name ''{0}'', cannot contain the . character.
+
+WrappedConnection.no_metadata=Connector is not capable of providing metadata. Extend connector with MetadataProvider interface
\ No newline at end of file
14 years, 8 months
teiid SVN: r2046 - trunk/engine/src/main/java/com/metamatrix/common/buffer/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-10 21:03:23 -0400 (Sat, 10 Apr 2010)
New Revision: 2046
Modified:
trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java
Log:
TEIID-913 adding a fix for buffer manager read errors and adding more logging
Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java 2010-04-09 21:22:55 UTC (rev 2045)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java 2010-04-11 01:03:23 UTC (rev 2046)
@@ -51,6 +51,7 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.buffer.TupleBuffer;
import com.metamatrix.common.buffer.BatchManager.ManagedBatch;
+import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.common.types.InputStreamFactory;
@@ -60,7 +61,6 @@
import com.metamatrix.common.types.Streamable;
import com.metamatrix.common.types.XMLType;
import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.processor.xml.XMLUtil;
@@ -113,7 +113,7 @@
private int columnCount;
public ManagedBatchImpl(String id, FileStore store, TupleBatch batch) {
- LogManager.logTrace(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", batchAdded.incrementAndGet()); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", batchAdded.incrementAndGet()); //$NON-NLS-1$
this.id = id;
this.store = store;
this.activeBatch = batch;
@@ -150,7 +150,8 @@
@Override
public TupleBatch getBatch(boolean cache, String[] types) throws MetaMatrixComponentException {
- LogManager.logTrace(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, "Reading batch from disk", readAttempts.incrementAndGet(), "reference hits", referenceHit.get()); //$NON-NLS-1$ //$NON-NLS-2$
+ int reads = readAttempts.incrementAndGet();
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, id, "getting batch", reads, "reference hits", referenceHit.get()); //$NON-NLS-1$ //$NON-NLS-2$
synchronized (activeBatches) {
TupleBufferInfo tbi = activeBatches.remove(this.id);
if (tbi != null) {
@@ -186,7 +187,8 @@
return batch;
}
}
- LogManager.logTrace(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, "Reading batch from disk", readCount.incrementAndGet()); //$NON-NLS-1$
+ int count = readCount.incrementAndGet();
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, id, beginRow, "reading batch from disk, total reads:", count); //$NON-NLS-1$
try {
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(store.createInputStream(this.offset), IO_BUFFER_SIZE));
batch = new TupleBatch();
@@ -211,15 +213,16 @@
TupleBatch batch = activeBatch;
if (batch != null) {
if (!persistent) {
- LogManager.logTrace(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, "Writing batch to disk", writeCount.incrementAndGet()); //$NON-NLS-1$
+ int count = writeCount.incrementAndGet();
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, id, beginRow, "writing batch to disk, total writes: ", count); //$NON-NLS-1$
synchronized (store) {
offset = store.getLength();
OutputStream fsos = new BufferedOutputStream(store.createOutputStream(), IO_BUFFER_SIZE);
ObjectOutputStream oos = new ObjectOutputStream(fsos);
batch.writeExternal(oos);
- oos.flush();
oos.close();
}
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, id, beginRow, "batch written starting at:", offset); //$NON-NLS-1$
}
this.batchReference = new WeakReference<TupleBatch>(batch);
}
@@ -349,17 +352,13 @@
}
};
TupleBuffer tupleBuffer = new TupleBuffer(batchManager, newID, elements, getProcessorBatchSize());
- if (LogManager.isMessageToBeRecorded(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
- LogManager.logDetail(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, new Object[]{"Creating TupleBuffer:", newID, "of type "+tupleSourceType}); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Creating TupleBuffer:", newID, "of type ", tupleSourceType); //$NON-NLS-1$ //$NON-NLS-2$
return tupleBuffer;
}
@Override
public FileStore createFileStore(String name) {
- if (LogManager.isMessageToBeRecorded(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
- LogManager.logDetail(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, "Creating FileStore:", name); //$NON-NLS-1$
- }
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Creating FileStore:", name); //$NON-NLS-1$
return this.diskMgr.createFileStore(name);
}
@@ -461,7 +460,7 @@
try {
mb.persist();
} catch (MetaMatrixComponentException e) {
- LogManager.logDetail(com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR, e, "Error persisting batch, attempts to read that batch later will result in an exception"); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, e, "Error persisting batch, attempts to read that batch later will result in an exception"); //$NON-NLS-1$
}
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java 2010-04-09 21:22:55 UTC (rev 2045)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java 2010-04-11 01:03:23 UTC (rev 2046)
@@ -140,17 +140,19 @@
storageFiles.put(fileOffset, newFileInfo);
fileInfo = newFileInfo;
}
- try {
- RandomAccessFile fileAccess = fileInfo.open();
- long pointer = fileAccess.length();
- fileAccess.setLength(pointer + length);
- fileAccess.seek(pointer);
- fileAccess.write(bytes, offset, length);
- } catch(IOException e) {
- throw new MetaMatrixComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
- } finally {
- fileInfo.close();
- }
+ synchronized (fileInfo) {
+ try {
+ RandomAccessFile fileAccess = fileInfo.open();
+ long pointer = fileAccess.length();
+ fileAccess.setLength(pointer + length);
+ fileAccess.seek(pointer);
+ fileAccess.write(bytes, offset, length);
+ } catch(IOException e) {
+ throw new MetaMatrixComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
+ } finally {
+ fileInfo.close();
+ }
+ }
}
public synchronized void removeDirect() {
14 years, 8 months
teiid SVN: r2045 - in trunk/jboss-integration/src: test/java/org/teiid/templates/connector and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-09 17:22:55 -0400 (Fri, 09 Apr 2010)
New Revision: 2045
Modified:
trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java
trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java
Log:
TEIID-861: allowing support for blank properties
Modified: trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java 2010-04-09 19:44:15 UTC (rev 2044)
+++ trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java 2010-04-09 21:22:55 UTC (rev 2045)
@@ -70,6 +70,9 @@
if (inQuotesStart+1 != index) {
values.add(encodedData.substring(inQuotesStart+1, index));
}
+ else {
+ values.add("");
+ }
inQuotesStart = -1;
}
}
Modified: trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java
===================================================================
--- trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java 2010-04-09 19:44:15 UTC (rev 2044)
+++ trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java 2010-04-09 21:22:55 UTC (rev 2045)
@@ -74,4 +74,21 @@
Assert.assertEquals(true , metadata.isEditable());
Assert.assertEquals(allowed , metadata.getAllowed());
}
+
+ @Test
+ public void testBlankProperties() {
+ ArrayList<String> allowed = new ArrayList<String>();
+ allowed.add("get");
+ allowed.add("post");
+
+ ExtendedPropertyMetadata metadata = new ExtendedPropertyMetadata("{$display:\"Is Immutable\",$description:\"\",$allowed:[\"get\",\"post\"], $required:\"true\",$advanced:\"true\"}");
+
+ Assert.assertEquals("Is Immutable", metadata.getDisplayName());
+ Assert.assertEquals("", metadata.getDescription());
+ Assert.assertEquals(true, metadata.isAdvanced());
+ Assert.assertEquals(true, metadata.isRequired());
+ Assert.assertEquals(false, metadata.isMasked());
+ Assert.assertEquals(true , metadata.isEditable());
+ Assert.assertEquals(allowed , metadata.getAllowed());
+ }
}
14 years, 8 months
teiid SVN: r2044 - in trunk: build/kit-jboss-container/deploy/teiid and 10 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-09 15:44:15 -0400 (Fri, 09 Apr 2010)
New Revision: 2044
Added:
trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
trunk/runtime/src/main/java/org/teiid/deployers/MetadataStoreGroup.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java
Modified:
trunk/adminshell/src/main/resources/scripts/adminapi.bsh
trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestCase3473.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestPartsDatabaseMetadata.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestResultSetMetadata.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
trunk/test-integration/common/src/test/resources/system/expected/Schemas.txt
Log:
TEIID-1039: Providing a admin method to merge two VDBs. This can be used by the Designer for preview functionality.
Modified: trunk/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-09 19:44:15 UTC (rev 2044)
@@ -49,6 +49,20 @@
}
/**
+ * Merge the Source VDB into Target VDB. Both Source and Target VDBs must be present for this method to
+ * succeed. The changes will not be persistent between server restarts.
+ * @param sourceVDBName
+ * @param sourceVDBVersion
+ * @param targetVDBName
+ * @param targetVDBVersion
+ */
+void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) {
+ debug("Merging VDB " + sourceVDBName+"."+sourceVDBVersion + " into " + targetVDBName+"."+targetVDBVersion);
+ checkAdmin();
+ internalAdmin.mergeVDBs(sourceVDBName, sourceVDBVersion, targetVDBName, targetVDBVersion);
+}
+
+/**
* Deploy a {@link ConnectionFactory} to Configuration
*
* @param deployedName Connection Factory name that will be added to Configuration
Modified: trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-04-09 19:44:15 UTC (rev 2044)
@@ -71,6 +71,7 @@
<property name="bufferService"><inject bean="BufferService"/></property>
<property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
<property name="securityHelper"><inject bean="SecurityHelper"/></property>
+ <property name="VDBRepository"><inject bean="VDBRepository"/></property>
<!-- Name of the process that uniquely identifies this process -->
<property name="processName">localhost</property>
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -373,14 +373,14 @@
void removeRoleFromDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
-// /**
-// * Merge the Source VDB into Target VDB. Both Source and Target VDBs must be present for this method to
-// * succeed. The changes will not be persistent between server restarts.
-// * @param sourceVDBName
-// * @param sourceVDBVersion
-// * @param targetVDBName
-// * @param targetVDBVersion
-// */
-// void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException;
+ /**
+ * Merge the Source VDB into Target VDB. Both Source and Target VDBs must be present for this method to
+ * succeed. The changes will not be persistent between server restarts.
+ * @param sourceVDBName
+ * @param sourceVDBVersion
+ * @param targetVDBName
+ * @param targetVDBVersion
+ */
+ void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -39,4 +39,5 @@
int getActiveSessionsCount() throws AdminException;
Collection<org.teiid.adminapi.Transaction> getTransactions();
void terminateTransaction(String xid) throws AdminException ;
+ void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -150,6 +150,10 @@
this.modelType = modelType.name();
}
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
public String toString() {
return getName() + this.sources;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -263,4 +263,8 @@
public DataPolicyMetadata getDataPolicy(String policyName) {
return this.dataPolicies.getMap().get(policyName);
}
+
+ public boolean isPreview() {
+ return Boolean.valueOf(getPropertyValue("preview")); //$NON-NLS-1$
+ }
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -540,7 +540,7 @@
ModelMetaData model = new ModelMetaData();
model.setName(ManagedUtil.getSimpleValue(managedModel, "name", String.class));//$NON-NLS-1$
model.setVisible(ManagedUtil.getSimpleValue(managedModel, "visible", Boolean.class));//$NON-NLS-1$
- model.setModelType(Model.Type.valueOf(ManagedUtil.getSimpleValue(managedModel, "modelType", String.class)));//$NON-NLS-1$
+ model.setModelType(ManagedUtil.getSimpleValue(managedModel, "modelType", String.class));//$NON-NLS-1$
ManagedProperty prop = managedModel.getProperty("JAXBProperties"); //$NON-NLS-1$
List<ManagedObject> properties = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(prop.getValue());
@@ -1060,17 +1060,17 @@
manageRoleToDataPolicy(vdbName, vdbVersion, policyName, role, false);
}
-// @Override
-// public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException {
-// try {
-// ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);
-// ManagedUtil.executeOperation(mc, "mergeVDBs",
-// SimpleValueSupport.wrap(sourceVDBName),
-// SimpleValueSupport.wrap(sourceVDBVersion),
-// SimpleValueSupport.wrap(targetVDBName),
-// SimpleValueSupport.wrap(targetVDBVersion));//$NON-NLS-1$
-// } catch (Exception e) {
-// throw new AdminComponentException(e.getMessage(), e);
-// }
-// }
+ @Override
+ public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException {
+ try {
+ ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);
+ ManagedUtil.executeOperation(mc, "mergeVDBs",
+ SimpleValueSupport.wrap(sourceVDBName),
+ SimpleValueSupport.wrap(sourceVDBVersion),
+ SimpleValueSupport.wrap(targetVDBName),
+ SimpleValueSupport.wrap(targetVDBVersion));//$NON-NLS-1$
+ } catch (Exception e) {
+ throw new AdminComponentException(e.getMessage(), e);
+ }
+ }
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -154,9 +154,10 @@
public void connectorAdded(String connectorName) {
for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
- if (vdb.getStatus() == VDB.Status.ACTIVE) {
+ if (vdb.getStatus() == VDB.Status.ACTIVE || vdb.isPreview()) {
continue;
}
+
for (Model m:vdb.getModels()) {
ModelMetaData model = (ModelMetaData)m;
if (model.getErrors().isEmpty()) {
@@ -206,6 +207,9 @@
public void connectorRemoved(String connectorName) {
for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
+ if (vdb.isPreview()) {
+ continue;
+ }
for (Model m:vdb.getModels()) {
ModelMetaData model = (ModelMetaData)m;
for (String sourceName:model.getSourceNames()) {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -52,6 +52,7 @@
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
import org.teiid.dqp.internal.process.DQPConfiguration;
import org.teiid.dqp.internal.process.DQPCore;
@@ -93,6 +94,7 @@
private transient ILogon logon;
private transient Admin admin;
private transient ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();
+ private transient VDBRepository vdbRepository;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -230,6 +232,10 @@
this.csr.setSecurityHelper(helper);
}
+ public void setVDBRepository(VDBRepository repo) {
+ this.vdbRepository = repo;
+ }
+
@Override
@ManagementOperation(description="Requests for perticular session", impact=Impact.ReadOnly,params={@ManagementParameter(name="sessionId",description="The session Identifier")})
public List<RequestMetadata> getRequestsForSession(long sessionId) {
@@ -313,5 +319,12 @@
@ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
public void terminateTransaction(String xid) throws AdminException {
this.dqpCore.terminateTransaction(xid);
+ }
+
+ @Override
+ @ManagementOperation(description="Merge Two VDBs",params={@ManagementParameter(name="sourceVDBName"),@ManagementParameter(name="sourceVDBName"), @ManagementParameter(name="targetVDBName"), @ManagementParameter(name="targetVDBVersion")})
+ public void mergeVDBs(String sourceVDBName, int sourceVDBVersion,
+ String targetVDBName, int targetVDBVersion) throws AdminException {
+ this.vdbRepository.mergeVDBs(sourceVDBName, sourceVDBVersion, targetVDBName, targetVDBVersion);
}
}
Modified: trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
===================================================================
--- trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -56,6 +56,15 @@
}
}
+ public static MetadataStore getSystemVDBMetadataStore() {
+ try {
+ IndexMetadataFactory imf = loadMetadata(Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB));
+ return imf.getMetadataStore();
+ } catch (Exception e) {
+ throw new MetaMatrixRuntimeException("System VDB not found");
+ }
+ }
+
public static TransformationMetadata getVDBMetadata(URL vdbURL, URL udfFile) throws IOException {
TransformationMetadata vdbmetadata = VDB_CACHE.get(vdbURL);
if (vdbmetadata != null) {
@@ -78,7 +87,7 @@
}
}
- private static IndexMetadataFactory loadMetadata(URL vdbURL)
+ public static IndexMetadataFactory loadMetadata(URL vdbURL)
throws IOException, MalformedURLException, URISyntaxException {
//vfs has a problem with vdbs embedded in jars in the classpath, so we'll create a temp version
if (vdbURL.getProtocol().equals("jar")) {
Added: trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java (rev 0)
+++ trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -0,0 +1,187 @@
+/*
+ * 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;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+
+import org.teiid.adminapi.DataPolicy;
+import org.teiid.adminapi.Model;
+import org.teiid.adminapi.impl.DataPolicyMetadata;
+import org.teiid.adminapi.impl.ModelMetaData;
+import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.connector.metadata.runtime.MetadataStore;
+import org.teiid.metadata.CompositeMetadataStore;
+import org.teiid.metadata.TransformationMetadata;
+import org.teiid.metadata.TransformationMetadata.Resource;
+
+import com.metamatrix.query.function.metadata.FunctionMethod;
+import com.metamatrix.query.metadata.QueryMetadataInterface;
+import com.metamatrix.vdb.runtime.VDBKey;
+
+
+public class CompositeVDB {
+ private VDBMetaData vdb;
+ private MetadataStoreGroup stores;
+ private LinkedHashMap<String, Resource> visibilityMap;
+ private UDFMetaData udf;
+ private LinkedHashMap<VDBKey, CompositeVDB> children;
+ private MetadataStore systemStore;
+
+ // used as cached item to avoid rebuilding
+ private VDBMetaData mergedVDB;
+
+ public CompositeVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, MetadataStore systemStore) {
+ this.vdb = vdb;
+ this.stores = stores;
+ this.visibilityMap = visibilityMap;
+ this.udf = udf;
+ this.systemStore = systemStore;
+ update(this.vdb);
+ }
+
+ public void addChild(CompositeVDB child) {
+ if (this.children == null) {
+ this.children = new LinkedHashMap<VDBKey, CompositeVDB>();
+ }
+ VDBMetaData childVDB = child.getVDB();
+ this.children.put(new VDBKey(childVDB.getName(), childVDB.getVersion()), child);
+ this.mergedVDB = null;
+ }
+
+ public void removeChild(VDBKey child) {
+ if (this.children != null) {
+ this.children.remove(child);
+ }
+ this.mergedVDB = null;
+ }
+
+ private void update(VDBMetaData vdbMetadata) {
+ TransformationMetadata metadata = buildTransformationMetaData(vdbMetadata, getVisibilityMap(), getMetadataStores(), getUDF());
+ vdbMetadata.addAttchment(QueryMetadataInterface.class, metadata);
+ vdbMetadata.addAttchment(TransformationMetadata.class, metadata);
+ }
+
+ private TransformationMetadata buildTransformationMetaData(VDBMetaData vdb, LinkedHashMap<String, Resource> visibilityMap, MetadataStoreGroup stores, UDFMetaData udf) {
+ Collection <FunctionMethod> methods = null;
+ if (udf != null) {
+ methods = udf.getFunctions();
+ }
+
+ CompositeMetadataStore compositeStore = new CompositeMetadataStore(stores.getStores());
+ compositeStore.addMetadataStore(this.systemStore);
+
+ TransformationMetadata metadata = new TransformationMetadata(vdb, compositeStore, visibilityMap, methods);
+
+ return metadata;
+ }
+
+ public VDBMetaData getVDB() {
+ if (this.children == null || this.children.isEmpty()) {
+ return vdb;
+ }
+ if (this.mergedVDB == null) {
+ this.mergedVDB = buildVDB();
+ update(mergedVDB);
+ }
+ return this.mergedVDB;
+ }
+
+
+ private VDBMetaData buildVDB() {
+ VDBMetaData mergedVDB = new VDBMetaData();
+ mergedVDB.setName(this.vdb.getName());
+ mergedVDB.setVersion(this.vdb.getVersion());
+ mergedVDB.setModels(this.vdb.getModels());
+ mergedVDB.setDataPolicies(this.vdb.getDataPolicies());
+ mergedVDB.setDescription(this.vdb.getDescription());
+ mergedVDB.setStatus(this.vdb.getStatus());
+ mergedVDB.setJAXBProperties(this.vdb.getJAXBProperties());
+
+ for (CompositeVDB child:this.children.values()) {
+
+ // add models
+ for (Model m:child.getVDB().getModels()) {
+ mergedVDB.addModel((ModelMetaData)m);
+ }
+
+ for (DataPolicy p:child.getVDB().getDataPolicies()) {
+ mergedVDB.addDataPolicy((DataPolicyMetadata)p);
+ }
+ }
+ return mergedVDB;
+ }
+
+ private UDFMetaData getUDF() {
+ if (this.children == null || this.children.isEmpty()) {
+ return this.udf;
+ }
+
+ UDFMetaData mergedUDF = new UDFMetaData();
+ if (this.udf != null) {
+ mergedUDF.addFunctions(this.udf.getFunctions());
+ }
+ for (CompositeVDB child:this.children.values()) {
+ UDFMetaData funcs = child.getUDF();
+ if (funcs != null) {
+ mergedUDF.addFunctions(funcs.getFunctions());
+ }
+ }
+ return mergedUDF;
+ }
+
+ private LinkedHashMap<String, Resource> getVisibilityMap() {
+ if (this.children == null || this.children.isEmpty()) {
+ return this.visibilityMap;
+ }
+
+ LinkedHashMap<String, Resource> mergedvisibilityMap = new LinkedHashMap<String, Resource>();
+ if (this.visibilityMap != null) {
+ mergedvisibilityMap.putAll(this.visibilityMap);
+ }
+ for (CompositeVDB child:this.children.values()) {
+ LinkedHashMap<String, Resource> vm = child.getVisibilityMap();
+ if ( vm != null) {
+ mergedvisibilityMap.putAll(vm);
+ }
+ }
+ return mergedvisibilityMap;
+ }
+
+ private MetadataStoreGroup getMetadataStores() {
+ if (this.children == null || this.children.isEmpty()) {
+ return this.stores;
+ }
+
+ MetadataStoreGroup mergedStores = new MetadataStoreGroup();
+ if (this.stores != null) {
+ mergedStores.addStores(this.stores.getStores());
+ }
+ for (CompositeVDB child:this.children.values()) {
+ MetadataStoreGroup stores = child.getMetadataStores();
+ if ( stores != null) {
+ mergedStores.addStores(stores.getStores());
+ }
+ }
+ return mergedStores;
+ }
+}
Property changes on: trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/runtime/src/main/java/org/teiid/deployers/MetadataStoreGroup.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/MetadataStoreGroup.java (rev 0)
+++ trunk/runtime/src/main/java/org/teiid/deployers/MetadataStoreGroup.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.connector.metadata.runtime.MetadataStore;
+
+public class MetadataStoreGroup implements Serializable{
+ private static final long serialVersionUID = -3702321839716725121L;
+
+ List<MetadataStore> stores = new ArrayList<MetadataStore>();
+
+ public void addStores(List<MetadataStore> stores) {
+ this.stores.addAll(stores);
+ }
+
+ public void addStore(MetadataStore store) {
+ this.stores.add(store);
+ }
+
+ public List<MetadataStore> getStores(){
+ return this.stores;
+ }
+}
Property changes on: trunk/runtime/src/main/java/org/teiid/deployers/MetadataStoreGroup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -25,8 +25,6 @@
import java.net.URISyntaxException;
import java.net.URL;
-import org.teiid.adminapi.impl.ModelMetaData;
-import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.metadata.index.RuntimeMetadataPlugin;
import org.teiid.runtime.RuntimePlugin;
@@ -39,21 +37,12 @@
public void start() {
- ModelMetaData model = new ModelMetaData();
- model.setName(CoreConstants.SYSTEM_MODEL);
- model.setVisible(true);
-
- VDBMetaData deployment = new VDBMetaData();
- deployment.setName(CoreConstants.SYSTEM_VDB);
-
- deployment.addModel(model);
-
try {
URL url = Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB);
if (url == null) {
throw new MetaMatrixRuntimeException(RuntimeMetadataPlugin.Util.getString("system_vdb_not_found")); //$NON-NLS-1$
}
- this.vdbRepository.addMetadataStore(deployment, new IndexMetadataFactory(url).getMetadataStore());
+ this.vdbRepository.setSystemStore(new IndexMetadataFactory(url).getMetadataStore());
} catch (URISyntaxException e) {
throw new MetaMatrixRuntimeException(e, RuntimePlugin.Util.getString("failed_to_deployed", CoreConstants.SYSTEM_VDB)); //$NON-NLS-1$
} catch (IOException e) {
@@ -61,10 +50,6 @@
}
}
- public void stop() {
- this.vdbRepository.removeVDB(CoreConstants.SYSTEM_VDB, 1);
- }
-
public void setVDBRepository(VDBRepository repo) {
this.vdbRepository = repo;
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -57,4 +57,8 @@
public Collection <FunctionMethod> getFunctions(){
return this.methods;
}
+
+ public void addFunctions(Collection <FunctionMethod> funcs){
+ this.methods.addAll(funcs);
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -23,8 +23,6 @@
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
@@ -45,8 +43,6 @@
import org.teiid.dqp.internal.cache.DQPContextCache;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
-import org.teiid.metadata.CompositeMetadataStore;
-import org.teiid.metadata.TransformationMetadata;
import org.teiid.metadata.TransformationMetadata.Resource;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.runtime.RuntimePlugin;
@@ -55,8 +51,6 @@
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.CoreConstants;
import com.metamatrix.core.util.FileUtils;
-import com.metamatrix.query.function.metadata.FunctionMethod;
-import com.metamatrix.query.metadata.QueryMetadataInterface;
public class VDBDeployer extends AbstractSimpleRealDeployer<VDBMetaData> {
private VDBRepository vdbRepository;
@@ -77,25 +71,28 @@
LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("redeploying_vdb", deployment)); //$NON-NLS-1$
}
- List<String> errors = deployment.getValidityErrors();
- if (errors != null && !errors.isEmpty()) {
- throw new DeploymentException(RuntimePlugin.Util.getString("validity_errors_in_vdb", deployment)); //$NON-NLS-1$
+ boolean preview = deployment.isPreview();
+
+ if (!preview) {
+ List<String> errors = deployment.getValidityErrors();
+ if (errors != null && !errors.isEmpty()) {
+ throw new DeploymentException(RuntimePlugin.Util.getString("validity_errors_in_vdb", deployment)); //$NON-NLS-1$
+ }
}
// get the metadata store of the VDB (this is build in parse stage)
- CompositeMetadataStore store = unit.getAttachment(CompositeMetadataStore.class);
+ MetadataStoreGroup store = unit.getAttachment(MetadataStoreGroup.class);
// if store is null and vdb dynamic vdb then try to get the metadata
if (store == null && deployment.isDynamic()) {
- ArrayList<MetadataStore> stores = new ArrayList<MetadataStore>();
+ MetadataStoreGroup dynamicStore = new MetadataStoreGroup();
for (Model model:deployment.getModels()) {
if (model.getName().equals(CoreConstants.SYSTEM_MODEL)){
continue;
}
- stores.add(buildDynamicMetadataStore((VFSDeploymentUnit)unit, deployment, (ModelMetaData)model));
+ dynamicStore.addStore(buildDynamicMetadataStore((VFSDeploymentUnit)unit, deployment, (ModelMetaData)model));
}
- store = new CompositeMetadataStore(stores);
- unit.addAttachment(CompositeMetadataStore.class, store);
+ store = dynamicStore;
}
if (store == null) {
@@ -103,42 +100,40 @@
}
// check if this is a VDB with index files, if there are then build the TransformationMetadata
- TransformationMetadata metadata = null;
- IndexMetadataFactory indexFactory = unit.getAttachment(IndexMetadataFactory.class);
UDFMetaData udf = unit.getAttachment(UDFMetaData.class);
+
+ LinkedHashMap<String, Resource> visibilityMap = null;
+ IndexMetadataFactory indexFactory = unit.getAttachment(IndexMetadataFactory.class);
if (indexFactory != null) {
- LinkedHashMap<String, Resource> visibilityMap = indexFactory.getEntriesPlusVisibilities();
- metadata = buildTransformationMetaData(deployment, visibilityMap, store, udf);
+ visibilityMap = indexFactory.getEntriesPlusVisibilities();
}
- else {
- // this dynamic VDB
- metadata = buildTransformationMetaData(deployment, null, store, udf);
- }
// add the metadata objects as attachments
deployment.removeAttachment(IndexMetadataFactory.class);
deployment.removeAttachment(UDFMetaData.class);
- deployment.addAttchment(QueryMetadataInterface.class, metadata);
- deployment.addAttchment(TransformationMetadata.class, metadata);
// add transformation metadata to the repository.
- this.vdbRepository.addMetadata(deployment, metadata);
- this.vdbRepository.addMetadataStore(deployment, store);
- this.vdbRepository.addVDB(deployment);
+ this.vdbRepository.addVDB(deployment, store, visibilityMap, udf);
try {
- saveMetadataStore((VFSDeploymentUnit)unit, deployment, metadata.getMetadataStore());
+ saveMetadataStore((VFSDeploymentUnit)unit, deployment, store);
} catch (IOException e1) {
LogManager.logWarning(LogConstants.CTX_RUNTIME, e1, RuntimePlugin.Util.getString("vdb_save_failed", deployment.getName()+"."+deployment.getVersion())); //$NON-NLS-1$ //$NON-NLS-2$
}
- boolean valid = validateSources(deployment);
-
- // Check if the VDB is fully configured.
- if (valid) {
+ boolean valid = true;
+ if (!preview) {
+ valid = validateSources(deployment);
+
+ // Check if the VDB is fully configured.
+ if (valid) {
+ deployment.setStatus(VDB.Status.ACTIVE);
+ } else {
+ deployment.setStatus(VDB.Status.INACTIVE);
+ }
+ }
+ else {
deployment.setStatus(VDB.Status.ACTIVE);
- } else {
- deployment.setStatus(VDB.Status.INACTIVE);
}
LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_deployed",deployment, valid?"active":"inactive")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -166,28 +161,6 @@
return valid;
}
-
- // does this need to be synchronized?
- private TransformationMetadata buildTransformationMetaData(VDBMetaData vdb, LinkedHashMap<String, Resource> visibilityMap, CompositeMetadataStore store, UDFMetaData udf) throws DeploymentException {
-
- // get the system VDB metadata store
- MetadataStore systemStore = this.vdbRepository.getMetadataStore(CoreConstants.SYSTEM_VDB, 1);
- if (systemStore == null) {
- throw new DeploymentException(RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
- }
-
- store.addMetadataStore(systemStore);
-
- Collection <FunctionMethod> methods = null;
- if (udf != null) {
- methods = udf.getFunctions();
- }
-
- TransformationMetadata metadata = new TransformationMetadata(vdb, store, visibilityMap, methods);
-
- return metadata;
- }
-
public void setVDBRepository(VDBRepository repo) {
this.vdbRepository = repo;
}
@@ -226,7 +199,7 @@
this.connectorManagerRepository = repo;
}
- private void saveMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, CompositeMetadataStore store) throws IOException {
+ private void saveMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, MetadataStoreGroup store) throws IOException {
File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
if (!cacheFileName.exists()) {
this.serializer.saveAttachment(cacheFileName,store);
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -44,7 +44,6 @@
import org.teiid.adminapi.Model;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.metadata.CompositeMetadataStore;
import org.teiid.metadata.index.IndexConstants;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.runtime.RuntimePlugin;
@@ -141,15 +140,16 @@
unit.addAttachment(IndexMetadataFactory.class, imf);
// add the cached store.
- CompositeMetadataStore store = null;
+ MetadataStoreGroup stores = null;
File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
if (cacheFileName.exists()) {
- store = this.serializer.loadAttachment(cacheFileName, CompositeMetadataStore.class);
+ stores = this.serializer.loadAttachment(cacheFileName, MetadataStoreGroup.class);
}
else {
- store = new CompositeMetadataStore(imf.getMetadataStore());
+ stores = new MetadataStoreGroup();
+ stores.addStore(imf.getMetadataStore());
}
- unit.addAttachment(CompositeMetadataStore.class, store);
+ unit.addAttachment(MetadataStoreGroup.class, stores);
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -24,22 +24,23 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jboss.deployers.spi.DeploymentException;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.connector.metadata.runtime.Datatype;
import org.teiid.connector.metadata.runtime.MetadataStore;
-import org.teiid.metadata.TransformationMetadata;
+import org.teiid.metadata.TransformationMetadata.Resource;
import org.teiid.runtime.RuntimePlugin;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.core.CoreConstants;
import com.metamatrix.vdb.runtime.VDBKey;
/**
@@ -48,24 +49,36 @@
public class VDBRepository implements Serializable{
private static final long serialVersionUID = 312177538191772674L;
- private Map<VDBKey, VDBMetaData> vdbRepo = new ConcurrentHashMap<VDBKey, VDBMetaData>();
- private Map<VDBKey, MetadataStore> metadataStoreRepo = new ConcurrentHashMap<VDBKey, MetadataStore>();
- private Map<VDBKey, TransformationMetadata> vdbToQueryMetadata = Collections.synchronizedMap(new HashMap<VDBKey, TransformationMetadata>());
+ private Map<VDBKey, CompositeVDB> vdbRepo = new ConcurrentHashMap<VDBKey, CompositeVDB>();
+ private MetadataStore systemStore;
-
- public void addVDB(VDBMetaData vdb) throws DeploymentException {
+ public void addVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf) throws DeploymentException {
if (getVDB(vdb.getName(), vdb.getVersion()) != null) {
throw new DeploymentException(RuntimePlugin.Util.getString("duplicate_vdb", vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
}
- this.vdbRepo.put(vdbId(vdb), vdb);
+
+ // get the system VDB metadata store
+ if (this.systemStore == null) {
+ throw new DeploymentException(RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
+ }
+
+ this.vdbRepo.put(vdbId(vdb), new CompositeVDB(vdb, stores, visibilityMap, udf, this.systemStore));
}
public VDBMetaData getVDB(String name, int version) {
- return this.vdbRepo.get(new VDBKey(name, version));
+ CompositeVDB v = this.vdbRepo.get(new VDBKey(name, version));
+ if (v != null) {
+ return v.getVDB();
+ }
+ return null;
}
public List<VDBMetaData> getVDBs(){
- return new ArrayList(this.vdbRepo.values());
+ ArrayList<VDBMetaData> vdbs = new ArrayList<VDBMetaData>();
+ for(CompositeVDB cVDB:this.vdbRepo.values()) {
+ vdbs.add(cVDB.getVDB());
+ }
+ return vdbs;
}
protected VDBKey vdbId(VDBMetaData vdb) {
@@ -76,7 +89,7 @@
int latestVersion = 0;
for (VDBKey key:this.vdbRepo.keySet()) {
if(key.getName().equalsIgnoreCase(vdbName)) {
- VDBMetaData vdb = this.vdbRepo.get(key);
+ VDBMetaData vdb = this.vdbRepo.get(key).getVDB();
if (vdb.getStatus() == VDB.Status.ACTIVE_DEFAULT) {
latestVersion = vdb.getVersion();
break;
@@ -96,32 +109,22 @@
throw new VirtualDatabaseException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, latestVersion)); //$NON-NLS-1$
}
-
- public TransformationMetadata getMetadata(String vdbName, int vdbVersion) {
- return this.vdbToQueryMetadata.get(new VDBKey(vdbName, vdbVersion));
+ public void setSystemStore(MetadataStore store) {
+ this.systemStore = store;
}
- public void addMetadata(VDBMetaData vdb, TransformationMetadata metadata) {
- this.vdbToQueryMetadata.put(vdbId(vdb), metadata);
- }
-
- public void addMetadataStore(VDBMetaData vdb, MetadataStore store) {
- this.metadataStoreRepo.put(vdbId(vdb), store);
- }
-
- public MetadataStore getMetadataStore(String vdbName, int vdbVersion) {
- return this.metadataStoreRepo.get(new VDBKey(vdbName, vdbVersion));
- }
-
public synchronized void removeVDB(String vdbName, int vdbVersion) {
VDBKey key = new VDBKey(vdbName, vdbVersion);
this.vdbRepo.remove(key);
- this.metadataStoreRepo.remove(key);
- this.vdbToQueryMetadata.remove(key);
+
+ // if this VDB was part of another VDB; then remove them.
+ for (CompositeVDB other:this.vdbRepo.values()) {
+ other.removeChild(key);
+ }
}
public Map<String, Datatype> getBuiltinDatatypes() {
- Collection<Datatype> datatypes = getMetadataStore(CoreConstants.SYSTEM_VDB, 1).getDatatypes();
+ Collection<Datatype> datatypes = this.systemStore.getDatatypes();
Map<String, Datatype> datatypeMap = new HashMap<String, Datatype>();
for (Class<?> typeClass : DataTypeManager.getAllDataTypeClasses()) {
for (Datatype datatypeRecordImpl : datatypes) {
@@ -133,4 +136,19 @@
}
return datatypeMap;
}
+
+ public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException{
+ CompositeVDB source = this.vdbRepo.get(new VDBKey(sourceVDBName, sourceVDBVersion));
+ if (source == null) {
+ throw new AdminProcessingException(RuntimePlugin.Util.getString("vdb_not_found", sourceVDBName, sourceVDBVersion));
+ }
+
+ CompositeVDB target = this.vdbRepo.get(new VDBKey(targetVDBName, targetVDBVersion));
+ if (target == null) {
+ throw new AdminProcessingException(RuntimePlugin.Util.getString("vdb_not_found", sourceVDBName, sourceVDBVersion));
+ }
+
+ // merge them
+ target.addChild(source);
+ }
}
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-04-09 19:44:15 UTC (rev 2044)
@@ -293,4 +293,5 @@
system_vdb_not_found=System.vdb not found in classpath
failed_to_deployed=Failed to deploy {0}
invalid_udf_file=No "path" information found to load the FUNCTION model {0}; FUNCTION model must have path information.
-failed_matadata_load=Failed to load metadata for VDB {0}.{1}
\ No newline at end of file
+failed_matadata_load=Failed to load metadata for VDB {0}.{1}
+vdb_not_found=VDB {0}.{1} not found deployed.
\ No newline at end of file
Added: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -0,0 +1,147 @@
+/*
+ * 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 java.io.File;
+import java.util.Properties;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.mockito.Mockito;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.impl.ModelMetaData;
+import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.DQP;
+import org.teiid.client.security.ILogon;
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.metadata.runtime.MetadataStore;
+import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.deployers.MetadataStoreGroup;
+import org.teiid.deployers.VDBRepository;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
+import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
+import org.teiid.dqp.internal.process.DQPConfiguration;
+import org.teiid.dqp.internal.process.DQPCore;
+import org.teiid.metadata.index.IndexMetadataFactory;
+import org.teiid.metadata.index.VDBMetadataFactory;
+import org.teiid.services.SessionServiceImpl;
+import org.teiid.transport.ClientServiceRegistry;
+import org.teiid.transport.ClientServiceRegistryImpl;
+import org.teiid.transport.LocalServerConnection;
+import org.teiid.transport.LogonImpl;
+
+import com.metamatrix.common.queue.FakeWorkManager;
+import com.metamatrix.dqp.service.FakeBufferService;
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
+
+public class FakeServer extends ClientServiceRegistryImpl {
+
+ SessionServiceImpl sessionService = new SessionServiceImpl();
+ LogonImpl logon;
+ DQPCore dqp = new DQPCore();
+ VDBRepository repo = new VDBRepository();
+ MetadataStore systemStore;
+
+ public FakeServer() {
+ this.logon = new LogonImpl(sessionService, null);
+
+ systemStore = VDBMetadataFactory.getSystemVDBMetadataStore();
+ this.repo.setSystemStore(systemStore);
+
+ this.sessionService.setVDBRepository(repo);
+ this.dqp.setWorkManager(new FakeWorkManager());
+ this.dqp.setBufferService(new FakeBufferService());
+ this.dqp.setTransactionService(new FakeTransactionService());
+
+ ConnectorManagerRepository cmr = Mockito.mock(ConnectorManagerRepository.class);
+ Mockito.stub(cmr.getConnectorManager("jndi:source")).toReturn(new ConnectorManager("x") {
+ @Override
+ public SourceCapabilities getCapabilities()
+ throws ConnectorException {
+ return new BasicSourceCapabilities();
+ }
+ });
+
+ this.dqp.setConnectorManagerRepository(cmr);
+ this.dqp.start(new DQPConfiguration());
+ this.sessionService.setDqp(this.dqp);
+
+ registerClientService(ILogon.class, logon, null);
+ registerClientService(DQP.class, dqp, null);
+ }
+
+ public void deployVDB(String vdbName, String vdbPath) throws Exception {
+
+ IndexMetadataFactory imf = VDBMetadataFactory.loadMetadata(new File(vdbPath).toURI().toURL());
+ MetadataStore metadata = imf.getMetadataStore();
+
+ VDBMetaData vdbMetaData = new VDBMetaData();
+ vdbMetaData.setName(vdbName);
+ vdbMetaData.setStatus(VDB.Status.ACTIVE);
+
+ for (Schema schema : systemStore.getSchemas().values()) {
+ ModelMetaData model = new ModelMetaData();
+ model.setName(schema.getName());
+ vdbMetaData.addModel(model);
+ model.addSourceMapping("source", "jndi:source");
+ }
+
+ for (Schema schema : metadata.getSchemas().values()) {
+ ModelMetaData model = new ModelMetaData();
+ model.setName(schema.getName());
+ vdbMetaData.addModel(model);
+ model.addSourceMapping("source", "jndi:source");
+ }
+
+ try {
+ MetadataStoreGroup stores = new MetadataStoreGroup();
+ stores.addStore(metadata);
+ this.repo.addVDB(vdbMetaData, stores, imf.getEntriesPlusVisibilities(), null);
+ } catch (DeploymentException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void undeployVDB(String vdbName) {
+ this.repo.removeVDB(vdbName, 1);
+ }
+
+ public void mergeVDBS(String sourceVDB, String targetVDB) throws AdminException {
+ this.repo.mergeVDBs(sourceVDB, 1, targetVDB, 1);
+ }
+
+ public ConnectionImpl createConnection(String embeddedURL) throws Exception {
+ final Properties p = new Properties();
+ EmbeddedProfile.parseURL(embeddedURL, p);
+
+ return new ConnectionImpl(new LocalServerConnection(p) {
+ @Override
+ protected ClientServiceRegistry getClientServiceRegistry() {
+ return FakeServer.this;
+ }
+ }, p, embeddedURL);
+ }
+
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestCase3473.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestCase3473.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestCase3473.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -40,7 +40,9 @@
////////////////////Query Related Methods///////////////////////////
@Before public void setUp() throws Exception {
- Connection conn = TestMMDatabaseMetaData.createConnection("jdbc:teiid:test", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeServer server = new FakeServer();
+ server.deployVDB("test", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb");
+ Connection conn = server.createConnection("jdbc:teiid:test"); //$NON-NLS-1$ //$NON-NLS-2$
dbmd = conn.getMetaData();
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -22,7 +22,8 @@
package org.teiid.jdbc;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import java.io.BufferedReader;
import java.io.File;
@@ -55,7 +56,9 @@
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.metadata.runtime.MetadataStore;
import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.deployers.MetadataStoreGroup;
import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
@@ -63,7 +66,6 @@
import org.teiid.dqp.internal.process.DQPConfiguration;
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.jdbc.util.ResultSetUtil;
-import org.teiid.metadata.TransformationMetadata;
import org.teiid.metadata.index.VDBMetadataFactory;
import org.teiid.net.TeiidURL;
import org.teiid.services.SessionServiceImpl;
@@ -77,7 +79,6 @@
import com.metamatrix.core.CoreConstants;
import com.metamatrix.core.util.UnitTestUtil;
import com.metamatrix.dqp.service.FakeBufferService;
-import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
@@ -86,56 +87,7 @@
@SuppressWarnings("nls")
public class TestMMDatabaseMetaData {
- public static ConnectionImpl createConnection(String embeddedURL, final String vdbPath) throws Exception {
- final Properties p = new Properties();
- EmbeddedProfile.parseURL(embeddedURL, p);
- return new ConnectionImpl(new LocalServerConnection(p) {
- @Override
- protected ClientServiceRegistry getClientServiceRegistry() {
- ClientServiceRegistryImpl impl = new ClientServiceRegistryImpl();
- SessionServiceImpl sessionService = new SessionServiceImpl();
- LogonImpl logon = new LogonImpl(sessionService, null);
- impl.registerClientService(ILogon.class, logon, null);
- DQPCore dqp = new DQPCore();
- sessionService.setDqp(dqp);
- TransformationMetadata metadata = VDBMetadataFactory.getVDBMetadata(vdbPath);
- VDBRepository repo = new VDBRepository();
- VDBMetaData vdbMetaData = new VDBMetaData();
- vdbMetaData.setName(p.getProperty(TeiidURL.JDBC.VDB_NAME));
- vdbMetaData.addAttchment(QueryMetadataInterface.class, metadata);
- vdbMetaData.addAttchment(TransformationMetadata.class, metadata);
- vdbMetaData.setStatus(VDB.Status.ACTIVE);
- repo.addMetadata(vdbMetaData, metadata);
- for (Schema schema : metadata.getMetadataStore().getSchemas().values()) {
- ModelMetaData model = new ModelMetaData();
- model.setName(schema.getName());
- vdbMetaData.addModel(model);
- model.addSourceMapping("source", "jndi:source");
- }
- ConnectorManagerRepository cmr = Mockito.mock(ConnectorManagerRepository.class);
- Mockito.stub(cmr.getConnectorManager("jndi:source")).toReturn(new ConnectorManager("x") {
- @Override
- public SourceCapabilities getCapabilities()
- throws ConnectorException {
- return new BasicSourceCapabilities();
- }
- });
- try {
- repo.addVDB(vdbMetaData);
- } catch (DeploymentException e) {
- throw new RuntimeException(e);
- }
- sessionService.setVDBRepository(repo);
- dqp.setWorkManager(new FakeWorkManager());
- dqp.setBufferService(new FakeBufferService());
- dqp.setTransactionService(new FakeTransactionService());
- dqp.setConnectorManagerRepository(cmr);
- dqp.start(new DQPConfiguration());
- impl.registerClientService(DQP.class, dqp, null);
- return impl;
- }
- }, p, embeddedURL);
- }
+
private static final boolean REPLACE_EXPECTED = false;
private static final boolean WRITE_ACTUAL_RESULTS_TO_FILE = false;
@@ -226,7 +178,9 @@
@BeforeClass
public static void oneTimeSetUp() throws Exception {
- conn = createConnection("jdbc:teiid:QT_Ora9DS", UnitTestUtil.getTestDataPath()+"/QT_Ora9DS_1.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeServer server = new FakeServer();
+ server.deployVDB("QT_Ora9DS", UnitTestUtil.getTestDataPath()+"/QT_Ora9DS_1.vdb");
+ conn = server.createConnection("jdbc:teiid:QT_Ora9DS"); //$NON-NLS-1$ //$NON-NLS-2$
}
/** Test all the non-query methods */
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -39,7 +39,9 @@
private Connection conn;
@Before public void setUp() throws Exception {
- conn = TestMMDatabaseMetaData.createConnection("jdbc:teiid:test", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeServer server = new FakeServer();
+ server.deployVDB("test", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb");
+ conn = server.createConnection("jdbc:teiid:test"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testNoExec() throws Exception {
Added: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -0,0 +1,73 @@
+package org.teiid.jdbc;
+
+import org.junit.Test;
+
+import com.metamatrix.core.util.UnitTestUtil;
+
+@SuppressWarnings("nls")
+public class TestVDBMerge extends AbstractMMQueryTestCase {
+
+ private static final String VDB1 = "PartsSupplier"; //$NON-NLS-1$
+ private static final String VDB2 = "QT_Ora9DS"; //$NON-NLS-1$
+ FakeServer server = new FakeServer();
+
+ @Test
+ public void testMerge() throws Throwable {
+
+ server.deployVDB(VDB1, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ this.internalConnection = server.createConnection("jdbc:teiid:"+VDB1);
+
+ String[] expected = {
+ "VDBName[string] SchemaName[string] Name[string] Type[string] NameInSource[string] IsPhysical[boolean] SupportsUpdates[boolean] UID[string] Cardinality[integer] Description[string] IsSystem[boolean] IsMaterialized[boolean]",
+ "PartsSupplier PartsSupplier PARTSSUPPLIER.PARTS Table PARTS true true mmuuid:f6276601-73fe-1edc-a81c-ecf397b10590 16 null false false",
+ "PartsSupplier PartsSupplier PARTSSUPPLIER.SHIP_VIA Table SHIP_VIA true true mmuuid:0f4e9b80-73ff-1edc-a81c-ecf397b10590 4 null false false",
+ "PartsSupplier PartsSupplier PARTSSUPPLIER.STATUS Table STATUS true true mmuuid:1f297200-73ff-1edc-a81c-ecf397b10590 3 null false false",
+ "PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS Table SUPPLIER_PARTS true true mmuuid:3deafb00-73ff-1edc-a81c-ecf397b10590 227 null false false",
+ "PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER Table SUPPLIER true true mmuuid:2c371ec0-73ff-1edc-a81c-ecf397b10590 16 null false false"
+ };
+ executeTest("select * from tables where schemaname ='PartsSupplier'", expected); //$NON-NLS-1$
+
+ String[] expectedBefore = {
+ "VDBName[string] SchemaName[string] Name[string] Type[string] NameInSource[string] IsPhysical[boolean] SupportsUpdates[boolean] UID[string] Cardinality[integer] Description[string] IsSystem[boolean] IsMaterialized[boolean]",
+ };
+ String[] expectedAfter = {
+ "VDBName[string] SchemaName[string] Name[string] Type[string] NameInSource[string] IsPhysical[boolean] SupportsUpdates[boolean] UID[string] Cardinality[integer] Description[string] IsSystem[boolean] IsMaterialized[boolean]",
+ "PartsSupplier BQT1 HugeA Table null true false mmuuid:7c66fc80-33d2-1dfa-9931-e83d04ce10a0 500000 null false false",
+ "PartsSupplier BQT1 HugeB Table null true false mmuuid:b0369400-33f8-1dfa-9931-e83d04ce10a0 500000 null false false",
+ "PartsSupplier BQT1 LargeA Table null true false mmuuid:3976a800-33b2-1dfa-9931-e83d04ce10a0 10000 null false false",
+ "PartsSupplier BQT1 LargeB Table null true false mmuuid:5fb40600-33c3-1dfa-9931-e83d04ce10a0 10000 null false false",
+ "PartsSupplier BQT1 MediumA Table null true false mmuuid:61074980-338d-1dfa-9931-e83d04ce10a0 1000 null false false",
+ "PartsSupplier BQT1 MediumB Table null true false mmuuid:e24bd1c0-33a4-1dfa-9931-e83d04ce10a0 1000 null false false",
+ "PartsSupplier BQT1 SmallA Table null true false mmuuid:0968424f-e6a0-1df9-ac06-b890ff96f710 50 null false false",
+ "PartsSupplier BQT1 SmallB Table null true false mmuuid:06fb8980-3377-1dfa-9931-e83d04ce10a0 50 null false false"
+ };
+
+ executeTest("select * from tables where schemaname='BQT1'", expectedBefore); //$NON-NLS-1$
+
+ this.internalConnection.close();
+
+ server.deployVDB(VDB2, UnitTestUtil.getTestDataPath()+"/QT_Ora9DS_1.vdb");
+
+ server.mergeVDBS(VDB2, VDB1);
+
+ this.internalConnection = server.createConnection("jdbc:teiid:"+VDB1);
+ executeTest("select * from tables where schemaname='BQT1'", expectedAfter); //$NON-NLS-1$
+
+ server.undeployVDB(VDB2);
+
+ // since the connection is not closed; need to behave as if still merged
+ executeTest("select * from tables where schemaname='BQT1'", expectedAfter); //$NON-NLS-1$
+
+ // re-connect should behave as the original
+ this.internalConnection.close();
+ this.internalConnection = server.createConnection("jdbc:teiid:"+VDB1);
+
+ executeTest("select * from tables where schemaname='BQT1'", expectedBefore); //$NON-NLS-1$
+ executeTest("select * from tables where schemaname ='PartsSupplier'", expected); //$NON-NLS-1$
+ }
+
+ private void executeTest(String sql, String[] expected){
+ execute(sql);
+ assertResults(expected);
+ }
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestPartsDatabaseMetadata.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestPartsDatabaseMetadata.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestPartsDatabaseMetadata.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -29,6 +29,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.teiid.jdbc.FakeServer;
import org.teiid.jdbc.TestMMDatabaseMetaData;
import com.metamatrix.core.util.UnitTestUtil;
@@ -45,7 +46,9 @@
static final String VDB = "PartsSupplier";
@Before public void setUp() throws Exception {
- connection = TestMMDatabaseMetaData.createConnection("jdbc:teiid:" + VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ FakeServer server = new FakeServer();
+ server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ connection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$
dbMetadata = connection.getMetaData();
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestResultSetMetadata.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestResultSetMetadata.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestResultSetMetadata.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -28,7 +28,7 @@
import org.junit.Before;
import org.junit.Test;
import org.teiid.jdbc.AbstractMMQueryTestCase;
-import org.teiid.jdbc.TestMMDatabaseMetaData;
+import org.teiid.jdbc.FakeServer;
import com.metamatrix.core.util.UnitTestUtil;
@@ -44,7 +44,9 @@
}
@Before public void setUp() throws Exception {
- this.internalConnection = TestMMDatabaseMetaData.createConnection("jdbc:teiid:" + VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ FakeServer server = new FakeServer();
+ server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$
}
@After public void tearDown() throws SQLException {
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -26,7 +26,7 @@
import org.junit.Ignore;
import org.junit.Test;
import org.teiid.jdbc.AbstractMMQueryTestCase;
-import org.teiid.jdbc.TestMMDatabaseMetaData;
+import org.teiid.jdbc.FakeServer;
import com.metamatrix.core.util.UnitTestUtil;
@@ -44,8 +44,10 @@
}
@Before public void setUp() throws Exception {
- this.internalConnection = TestMMDatabaseMetaData.createConnection("jdbc:teiid:" + VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
- }
+ FakeServer server = new FakeServer();
+ server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$
+ }
@Ignore("ODBC support to be readded")
@Test public void testDefect23534() {
@@ -68,7 +70,7 @@
}
@Test public void testModels() throws Exception {
- checkResult("testSchemas", "select* from SYS.Schemas"); //$NON-NLS-1$ //$NON-NLS-2$
+ checkResult("testSchemas", "select* from SYS.Schemas order by Name"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testKeys() throws Exception {
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2010-04-09 19:44:15 UTC (rev 2044)
@@ -26,7 +26,7 @@
import org.junit.Before;
import org.junit.Test;
import org.teiid.jdbc.AbstractMMQueryTestCase;
-import org.teiid.jdbc.TestMMDatabaseMetaData;
+import org.teiid.jdbc.FakeServer;
import com.metamatrix.core.util.UnitTestUtil;
@@ -46,7 +46,9 @@
}
@Before public void setUp() throws Exception {
- this.internalConnection = TestMMDatabaseMetaData.createConnection("jdbc:teiid:" + VDB, UnitTestUtil.getTestDataPath() + "/xml-vp/xmlvp_1.vdb");
+ FakeServer server = new FakeServer();
+ server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/xml-vp/xmlvp_1.vdb");
+ this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$
}
@After public void tearDown() {
Modified: trunk/test-integration/common/src/test/resources/system/expected/Schemas.txt
===================================================================
--- trunk/test-integration/common/src/test/resources/system/expected/Schemas.txt 2010-04-09 19:29:27 UTC (rev 2043)
+++ trunk/test-integration/common/src/test/resources/system/expected/Schemas.txt 2010-04-09 19:44:15 UTC (rev 2044)
@@ -1,3 +1,3 @@
VDBName[string] Name[string] IsPhysical[boolean] UID[string] Description[string] PrimaryMetamodelURI[string]
+PartsSupplier PartsSupplier true mmuuid:19c7f380-73d8-1edc-a81c-ecf397b10590 null http://www.metamatrix.com/metamodels/Relational
PartsSupplier SYS true mmuuid:49b9c0f9-2c4c-42d3-9409-2d847d29a1de System http://www.metamatrix.com/metamodels/Relational
-PartsSupplier PartsSupplier true mmuuid:19c7f380-73d8-1edc-a81c-ecf397b10590 null http://www.metamatrix.com/metamodels/Relational
14 years, 8 months
teiid SVN: r2043 - in trunk/test-integration/db: src/assembly and 1 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-04-09 15:29:27 -0400 (Fri, 09 Apr 2010)
New Revision: 2043
Modified:
trunk/test-integration/db/pom.xml
trunk/test-integration/db/runclienttest.sh
trunk/test-integration/db/src/assembly/binaries.xml
trunk/test-integration/db/src/main/resources/ctc_tests/ctc-test.properties
trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
Log:
Teiid-773 - changes package the ctc kit, needed to add the version specific ant dependencies, otherwise it was pulling ant 1.6 (instead of 1.7)
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2010-04-09 17:39:12 UTC (rev 2042)
+++ trunk/test-integration/db/pom.xml 2010-04-09 19:29:27 UTC (rev 2043)
@@ -49,6 +49,8 @@
<type>test-jar</type>
<scope>compile</scope>
</dependency>
+
+
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -66,15 +68,21 @@
</dependency>
<dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>cpptasks</artifactId>
- <version>1.0b3</version>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.7.0</version>
</dependency>
+
<dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
- <exclusions>
+ <exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
@@ -83,6 +91,19 @@
</dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>cpptasks</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
<!-- DBUnit dependencies -->
<dependency>
@@ -417,8 +438,7 @@
<!-- optional properties -->
<property name="config.file" value="${config.file}"></property>
<property name="query.scenario.classname" value="${query.scenario.classname}"></property>
- <property name="third.party.jars.dir" value="${third.party.jars.dir}"></property>
- <property name="proj.dir" value="${project.basedir}" />
+ <property name="proj.dir" value="${project.basedir}/target/" />
<property name="usedatasources" value="${usedatasources}"></property>
<property name="datasourceloc" value="${datasourceloc}"></property>
Modified: trunk/test-integration/db/runclienttest.sh
===================================================================
--- trunk/test-integration/db/runclienttest.sh 2010-04-09 17:39:12 UTC (rev 2042)
+++ trunk/test-integration/db/runclienttest.sh 2010-04-09 19:29:27 UTC (rev 2043)
@@ -1,27 +1,168 @@
#!/bin/sh
-# This script will run the client tests based on the
-# below project scenarios.
+# This script will run the client tests
-# The scenario
+#============================
+# REQUIRED PROPERTIES
+#
+# - USEDATASOURCES - indicates the datasource(s) (common separated) to use, this is the directory located inside directory datasourceloc
+$
-SC_DIR=./src/main/resources/ctc_tests/scenarios
-QS_DIR=./src/main/resources/ctc_tests/queries
-# VDB_DIR=./src/main/resources/ctc_tests/vdbs
+#============================
+# 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)
-VDB_DIR=./src/main/resources/transactions
+######################################################
+# DEBUGGING OPTION
+#
+# JBEDSP_DEBUG - uncomment to enable the output of debug messages.
+#
+# JBEDSP_DEBUG=true
+#
+# the property that defines which datasources to use. these names must exist as directories within the datasource loc.
+if [ -z "$USEDATASOURCES" ]
+ then
+
+ echo ""
+ echo "Property <USEDATASOURCES> must be specified"
+ echo "Exit"
+ exit
+fi
-if [ -z "${datasourceloc}" ]
+
+
+#if [ -z "${vdb.artifacts.dir}" ]
+# then
+#
+# vdb.artifacts.dir='./src/main/resources/transactions'
+#
+#fi
+
+if [ -z "${QUERYSETDIR}" ]
then
- datasourceloc='./src/main/resources/datasources'
+ QUERYSETDIR='./src/main/resources/ctc_tests/queries'
+
fi
-echo "Use Datasources: ${DS1} and ${DS2} loc: ${datasourceloc}"
+if [ -z "${SCENARIODIR}" ]
+ then
+
+ SCENARIODIR='./src/main/resources/ctc_tests/scenarios'
+
+fi
-mvn integration-test -Dusedatasources=${DS1},${DS2} -Ddatasourceloc=${datasourceloc} -Dscenario.dir=$SC_DIR -Dqueryset.artifacts.dir=$QS_DIR -Dvdb.artifacts.dir=$VDB_DIR -Prunclienttests
+if [ -z "${DATASOURCEDIR}" ]
+ then
+
+ DATASOURCEDIR='./src/main/resources/datasources'
+fi
+echo "Use Datasources: ${USEDATASOURCES} loc: ${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=" -Dusedatasources=${USEDATASOURCES} "
+ANT_ARGS="${ANT_ARGS} -Ddatasourceloc=${DATASOURCEDIR}"
+ANT_ARGS="${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}"
+
+
+
+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}
+
+
+
+
+
+
Modified: trunk/test-integration/db/src/assembly/binaries.xml
===================================================================
--- trunk/test-integration/db/src/assembly/binaries.xml 2010-04-09 17:39:12 UTC (rev 2042)
+++ trunk/test-integration/db/src/assembly/binaries.xml 2010-04-09 19:29:27 UTC (rev 2043)
@@ -10,8 +10,63 @@
<format>zip</format>
</formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>server</baseDirectory>
+
+ <dependencySets>
+
+ <dependencySet>
+ <outputDirectory>/ant</outputDirectory>
+
+ <useProjectArtifact>false</useProjectArtifact>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <includes>
+ <include>org.apache.ant:ant</include>
+ <include>org.apache.ant:ant-launcher</include>
+ <include>ant-contrib:cpptasks</include>
+ <include>ant-contrib:ant-contrib</include>
+ </includes>
+
+ </dependencySet>
+
+
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+
+ <useProjectArtifact>false</useProjectArtifact>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <includes>
+ <include>commons-collections:commons-collections</include>
+ <include>org.slf4j:slf4j-api</include>
+ <include>org.jboss.teiid:test-integration-common</include>
+ <include>org.jboss.teiid:teiid-common-core</include>
+ <include>org.jboss.teiid:teiid-adminshell</include>
+ <include>org.jboss.teiid:teiid-engine</include>
+ <include>log4j:log4j</include>
+ <include>junit:junit</include>
+ <include>jdom:jdom</include>
+ </includes>
+
+ </dependencySet>
+ </dependencySets>
+
<fileSets>
<fileSet>
+
+ <includes>
+ <include>runclienttest.*</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
<directory>src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
@@ -19,7 +74,7 @@
<fileSet>
<directory>${project.build.directory}</directory>
- <outputDirectory>ctc-client</outputDirectory>
+ <outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
@@ -27,4 +82,6 @@
</fileSets>
+
+
</assembly>
\ No newline at end of file
Modified: trunk/test-integration/db/src/main/resources/ctc_tests/ctc-test.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/ctc-test.properties 2010-04-09 17:39:12 UTC (rev 2042)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/ctc-test.properties 2010-04-09 19:29:27 UTC (rev 2043)
@@ -25,7 +25,7 @@
#
# where to find the vdb's, which is used to define the vdb.definition setting in the deploy.properties
-vdb.loc=${vdb.artifacts.dir}
+#vdb.loc=${vdb.artifacts.dir}
# turn off the configuration of the datastores (data refresh) and connector bindings (setting the datastore connection info)
#disable_datastore=true
@@ -58,7 +58,7 @@
# this is the deploy.properties file which will be used to run all the tests
# it will have these properties updated:
# 1 - vdb.definition (which will be based on vdb.loc)
-deployprops.loc=${project.loc}/target/classes/ctc_tests/deploy.properties
+#deployprops.loc=${project.loc}/target/classes/ctc_tests/deploy.properties
process-batch = 20
connector-batch = 20
@@ -70,18 +70,18 @@
##########################################
# properties for Teiid connection
##########################################
+connection-type=driver
+#connection-type=datasource
-connection-type=datasource
-
#driver=org.teiid.jdbc.TeiidDataSource
### driver and url for connecting in server mode
-#driver=org.teiid.jdbc.TeiidDriver
-#URL=jdbc:metamatrix:${vdb}@mm://localhost:31000;user=admin;password=teiid
+Driver=org.teiid.jdbc.TeiidDriver
+URL=jdbc:metamatrix:${vdb.name}@mm://localhost:31000;user=admin;password=teiid
### driver and url for running in embedded mode
-driver=com.metamatrix.jdbc.EmbeddedDataSource
-URL=jdbc:metamatrix:${vdb.name}@target/classes/ctc_tests/deploy.properties;version=1;user=admin;password=teiid
+#driver=com.metamatrix.jdbc.EmbeddedDataSource
+#URL=jdbc:metamatrix:${vdb.name}@target/classes/ctc_tests/deploy.properties;version=1;user=admin;password=teiid
User=admin
Password=teiid
Modified: trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-04-09 17:39:12 UTC (rev 2042)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml 2010-04-09 19:29:27 UTC (rev 2043)
@@ -10,6 +10,8 @@
<target name="main" depends="init, is.config.file, set.default.config.file, set.config.file"
if="" unless="" description="create all property files">
+ <echo>PROJECT DIRECTORY: ${proj_dir}</echo>
+
<antcall target="run.all.test" inheritall="true" />
<antcall target="run.single.test" inheritall="true" />
@@ -30,22 +32,12 @@
<available file="${queryset.artifacts.dir}" type="dir" property="queryset.dir.exist"/>
<fail unless="queryset.dir.exist" message="QuerySet directory ${queryset.artifacts.dir} does not exist or was not specified." />
- <available file="${vdb.artifacts.dir}" type="dir" property="vdb.dir.exist"/>
- <fail unless="vdb.dir.exist" message="VDB artifacts directory ${vdb.artifacts.dir} does not exist or was not specified." />
-
<condition property="single">
<available file="${scenario.dir}/${scenario.file}" />
</condition>
- <delete file="${ERROR_FILE}"/>
-
- <copy todir="${proj_dir}/lib" failonerror="false">
- <fileset dir="${third.party.jars.dir}"/>
- </copy>
-
-
+ <delete file="${ERROR_FILE}"/>
-
</target>
<target name="set.win"
@@ -57,13 +49,13 @@
<path location="${proj.dir}"/>
</pathconvert>
- <property name="root_output" value="${proj_dir}/target/bulk-query-tests" />
+ <property name="root_output" value="${proj_dir}/bulk-query-tests" />
</target>
<target name="set.linux"
if="UnixOS">
- <property name="root_output" value="${proj.dir}/target/bulk-query-tests" />
+ <property name="root_output" value="${proj.dir}/bulk-query-tests" />
<property name="proj_dir" value="${proj.dir}" />
</target>
@@ -82,7 +74,7 @@
<target name="set.default.config.file"
if="set.config.default">
- <property name="use.config.file" value="${proj_dir}/src/main/resources/ctc_tests/ctc-test.properties" />
+ <property name="use.config.file" value="${proj_dir}/resources/ctc_tests/ctc-test.properties" />
<echo>DEFAULT CONFIG: ${use.config.file}</echo>
</target>
@@ -164,10 +156,14 @@
<jvmarg value="-Dconfig=${use.config.file}" />
<jvmarg value="-Dscenariofile=${scenario_file}" />
<jvmarg value="-Dqueryset.artifacts.dir=${queryset_artifacts_dir}" />
- <jvmarg value="-Dvdb.artifacts.dir=${vdb_artifacts_dir}" />
<jvmarg value="-Dquery.scenario.classname=${query.scenario.classname}" />
<jvmarg value="-Dusedatasources=${usedatasources}" />
<jvmarg value="-Ddatasourceloc=${datasourceloc}" />
+ <jvmarg value="-Dproj.dir=${proj_dir}" />
+
+ <!--
+ <jvmarg value="-Dvdb.artifacts.dir=${vdb_artifacts_dir}" />
+ -->
</java>
@@ -178,11 +174,14 @@
<echo>Scenario property file ${scenario.file}</echo>
<echo>Config property file ${use.config.file}</echo>
<echo>Query Artifacts ${queryset.artifacts.dir}</echo>
+ <echo>Classpath ${proj_dir}/lib</echo>
-
+<!--
+<pathelement path="${maven.runtime.classpath}" />
+-->
<java classname="org.teiid.test.client.TestClient" fork="true" >
<classpath>
- <pathelement path="${maven.runtime.classpath}" />
+
<fileset dir="${proj_dir}/lib">
<include name="**/*.jar"/>
</fileset>
@@ -191,11 +190,15 @@
<jvmarg value="-Dconfig=${use.config.file}" />
<jvmarg value="-Dscenariofile=${scenario.file}" />
<jvmarg value="-Dqueryset.artifacts.dir=${queryset.artifacts.dir}" />
- <jvmarg value="-Dvdb.artifacts.dir=${vdb.artifacts.dir}" />
<jvmarg value="-Dquery.scenario.classname=${query.scenario.classname}" />
<jvmarg value="-Dusedatasources=${usedatasources}" />
- <jvmarg value="-Ddatasourceloc=${datasourceloc}" />
+ <jvmarg value="-Ddatasourceloc=${datasourceloc}" />
+ <jvmarg value="-Dproj.dir=${proj_dir}" />
+ <!--
+ <jvmarg value="-Dvdb.artifacts.dir=${vdb_artifacts_dir}" />
+ -->
+
</java>
<!--
14 years, 8 months
teiid SVN: r2042 - trunk/test-integration/db/src/main/java/org/teiid/test/client.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-04-09 13:39:12 -0400 (Fri, 09 Apr 2010)
New Revision: 2042
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/TestResultsSummary.java
Log:
Teiid-773 - changes to disable embedded type testing and fix the summary property and how it determines where to place the summary files
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-04-09 17:38:57 UTC (rev 2041)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/QueryScenario.java 2010-04-09 17:39:12 UTC (rev 2042)
@@ -30,6 +30,7 @@
import java.util.Properties;
import org.teiid.test.client.TestProperties.RESULT_MODES;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TestLogger;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -91,6 +92,7 @@
validateResultsMode(this.props);
+ // TODO: deployprops.loc not needed in remote testing
try {
setupVDBs(this.getProperties());
} catch (IOException e) {
@@ -106,6 +108,12 @@
// 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);
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TestResultsSummary.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TestResultsSummary.java 2010-04-09 17:38:57 UTC (rev 2041)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TestResultsSummary.java 2010-04-09 17:39:12 UTC (rev 2042)
@@ -118,7 +118,13 @@
throw new IOException(
"Summary file already exists: " + summaryFile.getName()); //$NON-NLS-1$
}
+ try {
summaryFile.createNewFile();
+ } catch (IOException ioe) {
+ TestLogger.log("Error creating new summary file: " + summaryFile.getAbsolutePath());
+ throw ioe;
+ }
+
OutputStream os = new FileOutputStream(summaryFile);
os = new BufferedOutputStream(os);
return new PrintStream(os);
@@ -390,20 +396,21 @@
}
public void printTotals(QueryScenario scenario ) throws Exception {
- String outputDir = scenario.getResultsGenerator().getOutputDir();
+// String outputDir = scenario.getResultsGenerator().getOutputDir();
String scenario_name = scenario.getQueryScenarioIdentifier();
String querysetname = scenario.getQuerySetName();
String summarydir = ConfigPropertyLoader.getInstance().getProperty(PROP_SUMMARY_PRT_DIR);
- if (summarydir != null) {
- outputDir = summarydir;
- }
+// if (summarydir != null) {
+// outputDir = summarydir;
+// }
PrintStream outputStream = null;
try {
- outputStream = getSummaryStream(outputDir, "Summary_" + querysetname + "_" + scenario_name, true); //$NON-NLS-1$
+ outputStream = getSummaryStream(summarydir, "Summary_" + querysetname + "_" + scenario_name, true); //$NON-NLS-1$
} catch (IOException e) {
+ e.printStackTrace();
// logError("Unable to get output stream for file: " + outputFileName); //$NON-NLS-1$
throw e;
}
14 years, 8 months
teiid SVN: r2041 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2010-04-09 13:38:57 -0400 (Fri, 09 Apr 2010)
New Revision: 2041
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
Log:
Teiid-773 - changes to disable embedded type testing and fix the summary property and how it determines where to place the summary files
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-04-08 21:31:35 UTC (rev 2040)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-04-09 17:38:57 UTC (rev 2041)
@@ -33,290 +33,311 @@
import com.metamatrix.common.util.PropertiesUtils;
+public abstract class ConnectionStrategy {
-public abstract class ConnectionStrategy {
-
-
private Properties env = null;
- private DataSourceFactory dsFactory;
- // the useProxy is used for non-teiid connections so that the sources are closed and reconnected all the time
+ // private DataSourceFactory dsFactory;
+ // the useProxy is used for non-teiid connections so that the sources are
+ // closed and reconnected all the time
private boolean useProxy = false;
-
public ConnectionStrategy(Properties props, DataSourceFactory dsf) {
this.env = PropertiesUtils.clone(props);
-
- this.dsFactory = dsf;
+
+ // this.dsFactory = dsf;
}
-
+
/*
- * Lifecycle methods for managing the connection
+ * Lifecycle methods for managing the connection
*/
-
+
/**
* Returns a connection
+ *
* @return Connection
*/
public abstract Connection getConnection() throws QueryTestFailedException;
-
+
public boolean useProxy() {
return this.useProxy;
}
-
+
void setUseProxy(boolean useproxy) {
this.useProxy = useproxy;
}
-
+
/**
* @since
*/
- public void shutdown() {
+ public void shutdown() {
}
-
- public Connection getAdminConnection() throws QueryTestFailedException{
- return null;
+
+ public Connection getAdminConnection() throws QueryTestFailedException {
+ return null;
}
-
+
private boolean autoCommit;
+
public boolean getAutocommit() {
- return autoCommit;
+ return autoCommit;
}
-
public XAConnection getXAConnection() throws QueryTestFailedException {
- return null;
+ return null;
}
-
+
/**
- * In certain testcases, the data that being provided is already preconfigured and should not
- * be touched by the {@link DataStore} processing.
+ * In certain testcases, the data that being provided is already
+ * preconfigured and should not be touched by the {@link DataStore}
+ * processing.
+ *
* @return
*/
public boolean isDataStoreDisabled() {
return ConfigPropertyLoader.getInstance().isDataStoreDisabled();
- }
-
+ }
-
-
public Properties getEnvironment() {
- return env;
+ return env;
}
public void setEnvironmentProperty(String key, String value) {
this.env.setProperty(key, value);
}
-
-
-
-
- void configure() throws QueryTestFailedException {
- if (this.isDataStoreDisabled()) {
- return;
- }
+ void configure() throws QueryTestFailedException {
- 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"));
+ 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
- java.sql.Connection conn = getConnection();
+ if (true)
+ return;
+ }
- if (!(conn instanceof ConnectionImpl)) {
- TestLogger.log("ConnectionStrategy configuration: connection is not of type MMConnection and therefore no vdb setup will be performed");
- 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"));
- setupVDBConnectorBindings(admin);
+ java.sql.Connection conn = getConnection();
- // 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 QueryTestFailedException {
-
- try {
-
- VDB vdb = null;
- Set<VDB> vdbs = api.getVDBs();
- if (vdbs == null || vdbs.isEmpty()) {
- throw new QueryTestFailedException(
- "AdminApi.GetVDBS returned no vdbs available");
+ 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);
- String urlString = this.env.getProperty(DriverConnection.DS_URL);
- JDBCURL url = new JDBCURL(urlString);
- TestLogger.logDebug("Trying to match VDB : " + url.getVDBName());
+ // admin.restart();
- for (Iterator<VDB> iterator = vdbs.iterator(); iterator.hasNext();) {
- VDB v = (VDB) iterator.next();
- if (v.getName().equalsIgnoreCase(url.getVDBName())) {
- vdb = v;
- }
+ int sleep = 5;
- }
- if (vdbs == null) {
- throw new QueryTestFailedException(
- "GetVDBS did not return a vdb that matched "
- + url.getVDBName());
- }
-
- List<Model> models = vdb.getModels();
- Iterator<Model> modelIt = models.iterator();
- while (modelIt.hasNext()) {
- Model m = modelIt.next();
+ TestLogger.log("Bouncing the system..(wait " + sleep + " seconds)"); //$NON-NLS-1$
+ Thread.sleep(1000 * sleep);
+ TestLogger.log("done."); //$NON-NLS-1$
- if (!m.isSource())
- continue;
+ } catch (Throwable e) {
+ e.printStackTrace();
- // get the mapping, if defined
- String mappedName = this.env.getProperty(m.getName());
+ throw new TransactionRuntimeException(e.getMessage());
+ } finally {
+ // need to close and flush the connection after restarting
+ // this.shutdown();
- String useName = m.getName();
- if (mappedName != null) {
- useName = mappedName;
- }
+ }
+ }
- org.teiid.test.framework.datasource.DataSource ds = this.dsFactory.getDatasource(useName, m.getName());
+ // protected void setupVDBConnectorBindings(Admin api) throws
+ // QueryTestFailedException {
+ //
+ // try {
+ //
+ // VDB vdb = null;
+ // Set<VDB> vdbs = api.getVDBs();
+ // if (vdbs == null || vdbs.isEmpty()) {
+ // throw new QueryTestFailedException(
+ // "AdminApi.GetVDBS returned no vdbs available");
+ // }
+ //
+ // String urlString = this.env.getProperty(DriverConnection.DS_URL);
+ // JDBCURL url = new JDBCURL(urlString);
+ // TestLogger.logDebug("Trying to match VDB : " + url.getVDBName());
+ //
+ // for (Iterator<VDB> iterator = vdbs.iterator(); iterator.hasNext();) {
+ // VDB v = (VDB) iterator.next();
+ // if (v.getName().equalsIgnoreCase(url.getVDBName())) {
+ // vdb = v;
+ // }
+ //
+ // }
+ // if (vdbs == null) {
+ // throw new QueryTestFailedException(
+ // "GetVDBS did not return a vdb that matched "
+ // + url.getVDBName());
+ // }
+ //
+ // List<Model> models = vdb.getModels();
+ // Iterator<Model> modelIt = models.iterator();
+ // while (modelIt.hasNext()) {
+ // Model m = modelIt.next();
+ //
+ // if (!m.isSource())
+ // continue;
+ //
+ // // get the mapping, if defined
+ // String mappedName = this.env.getProperty(m.getName());
+ //
+ // String useName = m.getName();
+ // if (mappedName != null) {
+ // useName = mappedName;
+ // }
+ //
+ // org.teiid.test.framework.datasource.DataSource ds =
+ // this.dsFactory.getDatasource(useName, m.getName());
+ //
+ // if (ds != null) {
+ //
+ // TestLogger.logInfo("Set up Connector Binding (model:mapping:type): " + m.getName() + ":" + useName + ":" + ds.getConnectorType()); //$NON-NLS-1$
+ //
+ // api.addConnectorBinding(ds.getName(),ds.getConnectorType(),
+ // ds.getProperties());
+ //
+ // api.assignBindingToModel(vdb.getName(), vdb.getVersion(), m.getName(),
+ // ds.getName(), ds.getProperty("jndi-name"));
+ //
+ // api.startConnectorBinding(api.getConnectorBinding(ds.getName()));
+ // } else {
+ // throw new QueryTestFailedException(
+ // "Error: Unable to create binding to map to model : "
+ // + m.getName() + ", the mapped name "
+ // + useName
+ // + " had no datasource properties defined");
+ // }
+ //
+ // }
+ //
+ // } catch (QueryTestFailedException qt) {
+ // throw qt;
+ // } catch (Exception t) {
+ // t.printStackTrace();
+ // throw new QueryTestFailedException(t);
+ // }
+ //
+ //
+ // }
- if (ds != null) {
+ public synchronized Connection createDriverConnection(String identifier)
+ throws QueryTestFailedException {
- TestLogger.logInfo("Set up Connector Binding (model:mapping:type): " + m.getName() + ":" + useName + ":" + ds.getConnectorType()); //$NON-NLS-1$
-
- api.addConnectionFactory(ds.getName(),ds.getConnectorType(), ds.getProperties());
-
- api.assignConnectionFactoryToModel(vdb.getName(), vdb.getVersion(), m.getName(), ds.getName(), ds.getProperty("jndi-name"));
-
- api.startConnectionFactory(ds.getName());
- } else {
- throw new QueryTestFailedException(
- "Error: Unable to create binding to map to model : "
- + m.getName() + ", the mapped name "
- + useName
- + " had no datasource properties defined");
- }
-
- }
-
- } catch (QueryTestFailedException qt) {
- throw qt;
- } catch (Exception t) {
- t.printStackTrace();
- throw new QueryTestFailedException(t);
- }
-
-
- }
-
- public synchronized Connection createDriverConnection(String identifier) throws QueryTestFailedException {
-
DataSource ds = null;
if (identifier != null) {
ds = DataSourceMgr.getInstance().getDataSource(identifier);
}
if (ds == null) {
- throw new TransactionRuntimeException(
- "Program Error: DataSource is not mapped to Identifier " + identifier);
+ throw new TransactionRuntimeException(
+ "Program Error: DataSource is not mapped to Identifier "
+ + identifier);
}
-
+
Connection conn = ds.getConnection();
-
- if (conn != null) return conn;
-
+
+ if (conn != null)
+ return conn;
+
ConnectionStrategy cs = null;
if (identifier == null) {
cs = new DriverConnection(ds.getProperties(), null);
-
- } else {
- cs = new DriverConnection(ds.getProperties(), null);
- }
-
+
+ } else {
+ cs = new DriverConnection(ds.getProperties(), null);
+ }
+
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(conn);
-
+
return conn;
-
-
+
}
-
- public synchronized XAConnection createDataSourceConnection(String identifier) throws QueryTestFailedException {
-
+ public synchronized XAConnection createDataSourceConnection(
+ String identifier) throws QueryTestFailedException {
+
DataSource ds = null;
if (identifier != null) {
ds = DataSourceMgr.getInstance().getDataSource(identifier);
}
if (ds == null) {
- throw new TransactionRuntimeException(
- "Program Error: DataSource is not mapped to Identifier " + identifier);
+ throw new TransactionRuntimeException(
+ "Program Error: DataSource is not mapped to Identifier "
+ + identifier);
}
-
+
XAConnection conn = ds.getXAConnection();
-
- if (conn != null) return conn;
-
+
+ if (conn != null)
+ return conn;
+
ConnectionStrategy cs = null;
if (identifier == null) {
cs = new DataSourceConnection(ds.getProperties(), null);
} else {
cs = new DataSourceConnection(ds.getProperties(), null);
}
-
+
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(conn);
-
+
return conn;
-
}
-
+
class CloseInterceptor implements InvocationHandler {
- Connection conn;
- XAConnection xaconn;
+ 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();
- }
- }
- }
-
+ 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();
+ }
+ }
+ }
+
}
14 years, 8 months
teiid SVN: r2040 - in trunk/connectors/connector-xml-http/src/main: rar/META-INF and 1 other directory.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2010-04-08 17:31:35 -0400 (Thu, 08 Apr 2010)
New Revision: 2040
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/DefaultTrustDeserializer.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequestor.java
trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml
Log:
Resolving blocking HTTP defects.
Modified: trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/DefaultTrustDeserializer.java
===================================================================
--- trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/DefaultTrustDeserializer.java 2010-04-08 21:30:30 UTC (rev 2039)
+++ trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/DefaultTrustDeserializer.java 2010-04-08 21:31:35 UTC (rev 2040)
@@ -60,6 +60,7 @@
@Override
public void processPayloads() throws Exception {
- throw new MetaMatrixRuntimeException("A custom trust payload processor needed based on the subject.");
+ // do nothing
+ //throw new MetaMatrixRuntimeException("A custom trust payload processor needed based on the subject.");
}
}
Modified: trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java
===================================================================
--- trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java 2010-04-08 21:30:30 UTC (rev 2039)
+++ trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java 2010-04-08 21:31:35 UTC (rev 2040)
@@ -172,7 +172,7 @@
Credentials defCred = new UsernamePasswordCredentials(this.config.getHttpBasicAuthUserName(), this.config.getHttpBasicAuthPassword());
client.getState().setCredentials(authScope, defCred);
} else {
- throw new ConnectorException(org.teiid.connector.xml.http.Messages.getString("HTTPExecutor.bad.security.configuration"));
+ //throw new ConnectorException(org.teiid.connector.xml.http.Messages.getString("HTTPExecutor.bad.security.configuration"));
}
}
@@ -292,17 +292,15 @@
}
} else if (accessMethod.equals(HTTPConnectorState.GET)){
method = requestor.generateMethod(bindingURI);
- if (pairs == null) {
- throw new ConnectorException(
- org.teiid.connector.xml.http.Messages
- .getString("HTTPExecutor.parameter.name.required.for.get")); //$NON-NLS-1$
- }
+ if (pairs != null) {
if(null != bindingQueryString){
NameValuePair[] bindingPairs = getPairsFromQueryString(xmlDoc, bindingQueryString);
pairs = combinePairArrays(pairs, bindingPairs);
}
addGetValues(pairs, method);
- attemptConditionalLog("XML Connector Framework: request paramters -\n " + generatePairString(pairs)); //$NON-NLS-1$
+ attemptConditionalLog("XML Connector Framework: request paramters -\n " + generatePairString(pairs)); //$NON-NLS-1$
+ }
+
}
request = method;
Modified: trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequestor.java
===================================================================
--- trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequestor.java 2010-04-08 21:30:30 UTC (rev 2039)
+++ trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequestor.java 2010-04-08 21:31:35 UTC (rev 2040)
@@ -116,7 +116,7 @@
final String cType = "text/xml; charset=utf-8"; //$NON-NLS-1$
final String userAgentHeader = "User-Agent"; //$NON-NLS-1$
- final String uAgent = "MetaMatrix Server"; //$NON-NLS-1$
+ final String uAgent = "Teiid Server"; //$NON-NLS-1$
Header contentType = new Header(contentTypeHeader, cType);
method.addRequestHeader(contentType);
Modified: trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml 2010-04-08 21:30:30 UTC (rev 2039)
+++ trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml 2010-04-08 21:31:35 UTC (rev 2040)
@@ -101,7 +101,7 @@
<description>{$display:"Request Timeout (in Milliseconds)",$required:"true"}</description>
<config-property-name>RequestTimeout</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>-1</config-property-value>
+ <config-property-value>10000</config-property-value>
</config-property>
<config-property>
14 years, 8 months