[teiid-commits] teiid SVN: r4253 - in trunk: test-integration/common/src/test/java/org/teiid/jdbc and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Jul 20 16:11:07 EDT 2012


Author: shawkins
Date: 2012-07-20 16:11:06 -0400 (Fri, 20 Jul 2012)
New Revision: 4253

Modified:
   trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
   trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java
Log:
correcting a testing issue where the wrong vdb may be referenced by the VFS

Modified: trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
===================================================================
--- trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java	2012-07-20 19:20:16 UTC (rev 4252)
+++ trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java	2012-07-20 20:11:06 UTC (rev 4253)
@@ -39,6 +39,7 @@
 import org.teiid.core.TeiidRuntimeException;
 import org.teiid.core.util.FileUtils;
 import org.teiid.core.util.LRUCache;
+import org.teiid.core.util.PropertiesUtils;
 import org.teiid.metadata.FunctionMethod;
 import org.teiid.query.function.FunctionTree;
 import org.teiid.query.function.SystemFunctionManager;
@@ -91,9 +92,10 @@
     }
 
 	public static IndexMetadataStore loadMetadata(String vdbName, URL url) throws IOException, MalformedURLException, URISyntaxException {
-		VirtualFile root = VFS.getChild(vdbName);
+		String fileName = PropertiesUtils.toHex(url.toExternalForm().getBytes());
+		VirtualFile root = VFS.getChild(fileName);
     	if (!root.exists()) {
-    		VFS.mountZip(url.openStream(), vdbName, root, TempFileProvider.create("vdbs", Executors.newScheduledThreadPool(2)));
+    		VFS.mountZip(url.openStream(), fileName, root, TempFileProvider.create("vdbs", Executors.newScheduledThreadPool(2)));
     		// once done this mount should be closed, since this class is only used testing
     		// it is hard to event when the test is done, otherwise we need to elevate the VFS to top
     	}

Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java	2012-07-20 19:20:16 UTC (rev 4252)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java	2012-07-20 20:11:06 UTC (rev 4253)
@@ -109,7 +109,7 @@
     	importProperties.setProperty("importer.excludeTables", "VDB\\.SYS\\..*");
     	importProperties.setProperty("importer.excludeProcedures", "VDB\\..*");
     	MetadataFactory mf = getMetadata(importProperties, conn);
-    	assertEquals(String.valueOf(mf.asMetadataStore().getSchemas().get("TEST").getTables()), 17, mf.asMetadataStore().getSchemas().get("TEST").getTables().size());
+    	assertEquals(String.valueOf(mf.asMetadataStore().getSchemas().get("TEST").getTables()), 18, mf.asMetadataStore().getSchemas().get("TEST").getTables().size());
     	assertEquals(0, mf.asMetadataStore().getSchemas().get("TEST").getProcedures().size());
     }
         



More information about the teiid-commits mailing list