[jboss-cvs] JBossAS SVN: r95247 - in projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src: test/java/org/jboss/test/classloading/vfs/policy/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 20 23:42:36 EDT 2009
Author: david.lloyd at jboss.com
Date: 2009-10-20 23:42:36 -0400 (Tue, 20 Oct 2009)
New Revision: 95247
Modified:
projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/main/java/org/jboss/classloading/spi/vfs/policy/VFSClassLoaderPolicy.java
projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/ExportAllUnitTestCase.java
projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/PackageInfoUnitTestCase.java
Log:
Fix file existence checks
Modified: projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/main/java/org/jboss/classloading/spi/vfs/policy/VFSClassLoaderPolicy.java
===================================================================
--- projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/main/java/org/jboss/classloading/spi/vfs/policy/VFSClassLoaderPolicy.java 2009-10-21 03:37:38 UTC (rev 95246)
+++ projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/main/java/org/jboss/classloading/spi/vfs/policy/VFSClassLoaderPolicy.java 2009-10-21 03:42:36 UTC (rev 95247)
@@ -522,7 +522,7 @@
try
{
VirtualFile child = root.getChild(name);
- if (child != null)
+ if (child.exists())
urls.add(child.toURL());
}
catch (Exception e)
Modified: projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/ExportAllUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/ExportAllUnitTestCase.java 2009-10-21 03:37:38 UTC (rev 95246)
+++ projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/ExportAllUnitTestCase.java 2009-10-21 03:42:36 UTC (rev 95247)
@@ -108,11 +108,11 @@
for (int i = 0; i < urls.length; ++i)
{
files[i] = base.getChild(urls[i]);
- if (files[i] == null && i > 0)
+ if (! files[i].exists() && i > 0)
{
files[i] = files[0].getChild(urls[i]);
}
- if (files[i] == null)
+ if (! files[i].exists())
fail("Can't find " + urls[i]);
}
@@ -123,11 +123,11 @@
for (int i = 0; i < excluded.length; ++i)
{
excludedFiles[i] = base.getChild(excluded[i]);
- if (excludedFiles[i] == null)
+ if (! excludedFiles[i].exists())
{
excludedFiles[i] = files[0].getChild(excluded[i]);
}
- if (excludedFiles[i] == null)
+ if (! excludedFiles[i].exists())
fail("Can't find " + excluded[i]);
}
}
@@ -150,7 +150,7 @@
{
if (i > 0)
files[i] = files[0].getChild(urls[i]);
- if (files[i] == null)
+ if (! files[i].exists())
fail("Expected to find resource: " + urlString);
}
}
@@ -170,7 +170,7 @@
else
{
excludedFiles[i] = files[0].getChild(excluded[i]);
- if (excludedFiles[i] == null)
+ if (! excludedFiles[i].exists())
fail("Expected to find resource: " + files[0].getName() + "/" + excluded[i]);
}
}
@@ -359,7 +359,7 @@
URL testjar3URL = getResource("/classloader/testjar3");
VirtualFile testjar3 = VFS.getChild(testjar3URL);
VirtualFile testjar3subjar = testjar3.getChild("subjar1.jar");
- assertNotNull(testjar3subjar);
+ assertTrue(testjar3subjar.exists());
VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(testjar3, testjar3subjar);
policy.setExportAll(ExportAll.NON_EMPTY);
Modified: projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/PackageInfoUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/PackageInfoUnitTestCase.java 2009-10-21 03:37:38 UTC (rev 95246)
+++ projects/jboss-cl/branches/Trunk_VFS3/classloading-vfs/src/test/java/org/jboss/test/classloading/vfs/policy/test/PackageInfoUnitTestCase.java 2009-10-21 03:42:36 UTC (rev 95247)
@@ -52,9 +52,9 @@
URL testear1xURL = getResource("/classloader/testear1x.ear");
VirtualFile testear1x = VFS.getChild(testear1xURL);
VirtualFile jar1 = testear1x.getChild("lib/jar1.jar");
- assertNotNull(jar1);
+ assertTrue(jar1.exists());
VirtualFile jar2 = testear1x.getChild("lib/jar2.jar");
- assertNotNull(jar2);
+ assertTrue(jar2.exists());
VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy("testCorrectPackage", testear1x, jar2, jar1);
policy.setExportAll(ExportAll.NON_EMPTY);
policy.setImportAll(true);
More information about the jboss-cvs-commits
mailing list