[jboss-cvs] JBossAS SVN: r95239 - projects/jboss-deployers/branches/vfs3/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 20 23:09:20 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-10-20 23:09:20 -0400 (Tue, 20 Oct 2009)
New Revision: 95239

Modified:
   projects/jboss-deployers/branches/vfs3/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
Log:
Some minor cleanup

Modified: projects/jboss-deployers/branches/vfs3/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
===================================================================
--- projects/jboss-deployers/branches/vfs3/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2009-10-21 02:36:44 UTC (rev 95238)
+++ projects/jboss-deployers/branches/vfs3/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2009-10-21 03:09:20 UTC (rev 95239)
@@ -104,9 +104,8 @@
             return false;
 
          context = createContext(structureContext, "META-INF");
-
-         VirtualFile applicationProps = getMetaDataFile(file, "META-INF/application.properties");
-         VirtualFile jbossProps = getMetaDataFile(file, "META-INF/jboss-application.properties");
+         VirtualFile applicationProps = file.getChild("META-INF/application.properties");
+         VirtualFile jbossProps = file.getChild("META-INF/jboss-application.properties");
          boolean scan = true;
          List<EarModule> modules = new ArrayList<EarModule>();
          if (applicationProps != null)
@@ -146,28 +145,19 @@
             String fileName = mod.getFileName();
             if (fileName != null && (fileName = fileName.trim()).length() > 0)
             {
-               try
+               VirtualFile module = file.getChild(fileName);
+               if (module == null)
                {
-                  VirtualFile module = file.getChild(fileName);
-                  if (module == null)
-                  {
-                     throw new RuntimeException(fileName
-                           + " module listed in application.xml does not exist within .ear "
-                           + file.getName());
-                  }
-                  // Ask the deployers to analyze this
-                  if (structureContext.determineChildStructure(module) == false)
-                  {
-                     throw new RuntimeException(fileName
-                           + " module listed in application.xml is not a recognized deployment, .ear: "
-                           + file.getName());
-                  }
+                  throw new RuntimeException(fileName
+                        + " module listed in application.xml does not exist within .ear "
+                        + file.getName());
                }
-               catch (IOException e)
+               // Ask the deployers to analyze this
+               if (structureContext.determineChildStructure(module) == false)
                {
                   throw new RuntimeException(fileName
-                        + " module listed in application.xml does not exist within .ear "
-                        + file.getName(), e);
+                        + " module listed in application.xml is not a recognized deployment, .ear: "
+                        + file.getName());
                }
             }
          }
@@ -296,10 +286,10 @@
       else if (path.endsWith(".jar"))
       {
          // Look for a META-INF/application-client.xml
-         VirtualFile mfFile = getMetaDataFile(archive, "META-INF/MANIFEST.MF");
-         VirtualFile clientXml = getMetaDataFile(archive, "META-INF/application-client.xml");
-         VirtualFile ejbXml = getMetaDataFile(archive, "META-INF/ejb-jar.xml");
-         VirtualFile jbossXml = getMetaDataFile(archive, "META-INF/jboss.xml");
+         VirtualFile mfFile = archive.getChild("META-INF/MANIFEST.MF");
+         VirtualFile clientXml = archive.getChild("META-INF/application-client.xml");
+         VirtualFile ejbXml = archive.getChild("META-INF/ejb-jar.xml");
+         VirtualFile jbossXml = archive.getChild("META-INF/jboss.xml");
          //VirtualFile seamXml = getMetaDataFile(archive, "META-INF/components.xml");
 
          if (clientXml != null)
@@ -344,19 +334,6 @@
       return tmp.toString();
    }
 
-   private VirtualFile getMetaDataFile(VirtualFile file, String path)
-   {
-      VirtualFile metaFile = null;
-      try
-      {
-         metaFile = file.getChild(path);
-      }
-      catch (IOException ignored)
-      {
-      }
-      return metaFile;
-   }
-
    private static class EarCandidateAnnotationsCallback implements CandidateAnnotationsCallback
    {
       private static final Logger log = Logger.getLogger(EarCandidateAnnotationsCallback.class);




More information about the jboss-cvs-commits mailing list