[jboss-cvs] JBossAS SVN: r102105 - in projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata: serviceref and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 8 23:33:22 EST 2010


Author: bstansberry at jboss.com
Date: 2010-03-08 23:33:22 -0500 (Mon, 08 Mar 2010)
New Revision: 102105

Added:
   projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata/serviceref/
Modified:
   projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata/serviceref/VFSAdaptorUnitTestCase.java
Log:
[JBMETA-266] Move VFSAdaptorUnitTest case to same metdata subproject as the class its testing (Note that it's currently failing)

Copied: projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata/serviceref (from rev 102103, projects/metadata/ejb/trunk/src/test/java/org/jboss/test/metadata/serviceref)

Modified: projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata/serviceref/VFSAdaptorUnitTestCase.java
===================================================================
--- projects/metadata/ejb/trunk/src/test/java/org/jboss/test/metadata/serviceref/VFSAdaptorUnitTestCase.java	2010-03-09 03:18:49 UTC (rev 102103)
+++ projects/metadata/common/trunk/src/test/java/org/jboss/test/metadata/serviceref/VFSAdaptorUnitTestCase.java	2010-03-09 04:33:22 UTC (rev 102105)
@@ -28,8 +28,9 @@
 import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.test.AbstractTestCaseWithSetup;
 import org.jboss.test.AbstractTestDelegate;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.test.metadata.javaee.JBossXBTestDelegate;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
 import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
 
 /**
@@ -46,20 +47,25 @@
 
    public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
    {
-      return new AbstractTestDelegate(clazz);
+      // This has nothing to do with this test, but adding it results in 
+      // JBossXBTestDelegate.init() being called, which must be done or
+      // the other tests in this testsuite fail with
+      // java.lang.Error: factory already defined
+      // at java.net.URL.setURLStreamHandlerFactory(URL.java:1077)
+      // at org.jboss.test.metadata.javaee.JBossXBTestDelegate.init(...)
+      return new JBossXBTestDelegate(clazz);
    }
 
-   @SuppressWarnings( { "deprecation" })
    public void testVirtualFileAdaptor() throws Exception
    {
       URL url = getResource("/org/jboss/test/metadata");
-      VirtualFile root = VFS.getRoot(url);
-      VirtualFile jpa = root.findChild("jpa");
+      VirtualFile root = VFS.getChild(url);
+      VirtualFile jpa = root.getChild("javaee");
       // direct vfs file
       VirtualFileAdaptor adaptor = new VirtualFileAdaptor(jpa);
       testVFSAdaptor(adaptor);
       // url + path
-      adaptor = new VirtualFileAdaptor(url, "jpa");
+      adaptor = new VirtualFileAdaptor(url, "javaee");
       testVFSAdaptor(adaptor);
    }
 
@@ -67,7 +73,7 @@
    {
       byte[] bytes = serialize(adaptor);
       adaptor = (VirtualFileAdaptor)deserialize(bytes);
-      UnifiedVirtualFile file = adaptor.findChild("PersistenceMD_testDefaultMetaData.xml");
+      UnifiedVirtualFile file = adaptor.findChild("DisplayName_testDefaultLanguage.xml");
       assertNotNull(file);
       assertNotNull(adaptor.findChild("../"));
 
@@ -85,7 +91,7 @@
          VirtualFileAdaptor newUvf = (VirtualFileAdaptor)deserialize(b);
          childrenNames.add(newUvf.getName());
       }
-      assertTrue(childrenNames.contains("PersistenceMD_testDefaultMetaData.xml"));
+      assertTrue(childrenNames.contains("DisplayName_testDefaultLanguage.xml"));
    }
 
 }




More information about the jboss-cvs-commits mailing list