[jboss-cvs] JBossAS SVN: r85789 - in projects/ejb3/trunk/installer: src and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 12 14:30:28 EDT 2009


Author: ALRubinger
Date: 2009-03-12 14:30:28 -0400 (Thu, 12 Mar 2009)
New Revision: 85789

Added:
   projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/manifest/
   projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/manifest/ManifestEditor.java
   projects/ejb3/trunk/installer/src/test/
   projects/ejb3/trunk/installer/src/test/java/
   projects/ejb3/trunk/installer/src/test/java/org/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/manifest/
   projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/manifest/ManifestEditorTestCase.java
   projects/ejb3/trunk/installer/src/test/resources/
   projects/ejb3/trunk/installer/src/test/resources/log4j.xml
   projects/ejb3/trunk/installer/src/test/resources/manifest_template
Modified:
   projects/ejb3/trunk/installer/pom.xml
   projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/Installer.java
Log:
[EJBTHREE-1768] Make a ManifestEditor to add/remove CP entries

Modified: projects/ejb3/trunk/installer/pom.xml
===================================================================
--- projects/ejb3/trunk/installer/pom.xml	2009-03-12 17:32:05 UTC (rev 85788)
+++ projects/ejb3/trunk/installer/pom.xml	2009-03-12 18:30:28 UTC (rev 85789)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <!-- Define Parent -->
   <parent>
@@ -25,7 +26,7 @@
 
   <!-- Dependencies -->
   <dependencies>
-  
+
     <!-- Ant Contrib -->
     <dependency>
       <groupId>ant-contrib</groupId>
@@ -40,6 +41,27 @@
       <version>1.0.0</version>
       <scope>provided</scope>
     </dependency>
-    
+
+    <!-- JUnit -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <!-- JBoss Logging -->
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-log4j</artifactId>
+      <version>2.0.5.GA</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-spi</artifactId>
+      <version>2.0.5.GA</version>
+      <optional>true</optional>
+    </dependency>
+
   </dependencies>
 </project>

Modified: projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/Installer.java
===================================================================
--- projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/Installer.java	2009-03-12 17:32:05 UTC (rev 85788)
+++ projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/Installer.java	2009-03-12 18:30:28 UTC (rev 85789)
@@ -134,6 +134,12 @@
     */
    private JarFile installerJarFile;
    
+   
+   /*
+    * Pointer to jbossall-client.jar
+    */
+   private JarFile jbossallClientJarFile;
+   
    private boolean cleanup;
 
    // Main
@@ -278,6 +284,18 @@
 
       return this.installerJarFile;
    }
+   
+   private JarFile getJBossallClientJarFile()
+   {
+      // If not already specified
+      if(this.jbossallClientJarFile==null)
+      {
+         
+      }
+      
+      // Return
+      return jbossallClientJarFile;
+   }
 
    // Internal Helper Methods
 

Added: projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/manifest/ManifestEditor.java
===================================================================
--- projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/manifest/ManifestEditor.java	                        (rev 0)
+++ projects/ejb3/trunk/installer/src/main/java/org/jboss/ejb3/installer/manifest/ManifestEditor.java	2009-03-12 18:30:28 UTC (rev 85789)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.installer.manifest;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.jboss.logging.Logger;
+
+/**
+ * ManifestEditor
+ * 
+ * Configurable utility to alter the manifest of a given JAR
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ManifestEditor
+{
+   //------------------------------------------------------------------------||
+   // Class Members ---------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   private static final Logger log = Logger.getLogger(ManifestEditor.class);
+
+   private static final String ENTRY_NAME_CLASS_PATH = "Class-Path";
+
+   private static final String DELIMITER_CLASS_PATH_ENTRIES = " ";
+
+   //------------------------------------------------------------------------||
+   // Instance Members ------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   private Manifest manifest;
+
+   //------------------------------------------------------------------------||
+   // Constructors ----------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   public ManifestEditor(final JarFile jar)
+   {
+      // Precondition check
+      assert jar != null : "JAR must be specified";
+
+      // Get the manifest for the JAR
+      Manifest manifest = null;
+      try
+      {
+         manifest = jar.getManifest();
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException("Could not get manifest from JAR: " + jar, e);
+      }
+
+      // If there is not Manifest, make a new one
+      if (manifest == null)
+      {
+         log.debug("Created new empty manifest for JAR: " + jar);
+         manifest = new Manifest();
+      }
+
+      // Set state
+      this.setManifest(manifest);
+   }
+
+   //------------------------------------------------------------------------||
+   // Functional Methods ----------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   /**
+    * Adds the specified entries to the Class-Path of the manifest, 
+    * additionally creating "Class-Path" if it does not exist
+    */
+   public void addEntriesToClassPath(final Set<String> entriesToAdd)
+   {
+      // Get the Manifest
+      final Manifest manifest = this.getManifest();
+
+      // Get the Class-Path
+      final String classPath = manifest.getMainAttributes().getValue(ENTRY_NAME_CLASS_PATH);
+
+      // Get the Class-Path entries
+      final String[] classPathEntries = classPath == null ? new String[]
+      {} : classPath.trim().split(DELIMITER_CLASS_PATH_ENTRIES);
+
+      // Add existing entries to the ones we'll add (and strip out duplicates)
+      for (String classPathEntry : classPathEntries)
+      {
+         entriesToAdd.add(classPathEntry);
+      }
+
+      // Get the new CP
+      final String newCp = this.flattenClassPathEntries(entriesToAdd);
+      log.info("Setting the " + ENTRY_NAME_CLASS_PATH + " to: " + newCp);
+      manifest.getMainAttributes().putValue(ENTRY_NAME_CLASS_PATH, newCp);
+   }
+
+   /**
+    * Removes, if they exist, attributes from a Class-Path entry 
+    */
+   public void removeEntriesFromClassPath(final Set<String> entriesToRemove)
+   {
+      // Get the Manifest
+      final Manifest manifest = this.getManifest();
+
+      // Get the Class-Path
+      final String classPath = manifest.getMainAttributes().getValue(ENTRY_NAME_CLASS_PATH);
+
+      // If not supplied, there's nothing to remove, so quit
+      if (classPath == null || classPath.length() == 0)
+      {
+         return;
+      }
+
+      // Split
+      final String[] classPathEntries = classPath.trim().split(DELIMITER_CLASS_PATH_ENTRIES);
+
+      // Filter out exclusions from a new Collection
+      final Collection<String> newClassPathEntries = new ArrayList<String>();
+      for (final String classPathEntry : classPathEntries)
+      {
+         if (!entriesToRemove.contains((classPathEntry)))
+         {
+            newClassPathEntries.add(classPathEntry);
+         }
+         else
+         {
+            log.info("Removing from " + ENTRY_NAME_CLASS_PATH + ": " + classPathEntry);
+         }
+      }
+
+      // Re-set the Class-Path
+      final String newCp = this.flattenClassPathEntries(newClassPathEntries);
+      log.info("Setting the " + ENTRY_NAME_CLASS_PATH + " to: " + newCp);
+      manifest.getMainAttributes().putValue(ENTRY_NAME_CLASS_PATH, newCp);
+   }
+
+   //------------------------------------------------------------------------||
+   // Internal Helper Methods -----------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   private String flattenClassPathEntries(Collection<String> classPathEntries)
+   {
+      // Flatten
+      final StringBuffer sb = new StringBuffer();
+      for (final String newEntry : classPathEntries)
+      {
+         sb.append(newEntry.trim());
+         sb.append(DELIMITER_CLASS_PATH_ENTRIES);
+      }
+
+      // Re-set the Class-Path
+      final String newCp = sb.toString().trim();
+
+      // Return
+      return newCp;
+   }
+
+   //------------------------------------------------------------------------||
+   // Accessors / Mutators --------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   public Manifest getManifest()
+   {
+      return manifest;
+   }
+
+   private void setManifest(final Manifest manifest)
+   {
+      this.manifest = manifest;
+   }
+
+}

Added: projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/manifest/ManifestEditorTestCase.java
===================================================================
--- projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/manifest/ManifestEditorTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/installer/src/test/java/org/jboss/ejb3/test/installer/manifest/ManifestEditorTestCase.java	2009-03-12 18:30:28 UTC (rev 85789)
@@ -0,0 +1,330 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.installer.manifest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.ejb3.installer.manifest.ManifestEditor;
+import org.jboss.logging.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * ManifestEditorTestCase
+ * 
+ * Test Cases for the ManifestEditor
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ManifestEditorTestCase
+{
+
+   //------------------------------------------------------------------------||
+   // Class Members ---------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   private static final Logger log = Logger.getLogger(ManifestEditorTestCase.class);
+
+   private static final String FILE_NAME_JAR_PARENT = "target/test";
+
+   private static final String FILE_NAME_JAR_FILE = "ManifestEditorTest.jar";
+
+   private static final String FILE_NAME_MANIFEST_TEMPLATE = "manifest_template";
+
+   private static final String MANIFEST_ENTRY_CLASS_PATH = "Class-Path";
+
+   private static final String DELIMTER_CLASS_PATH = " ";
+
+   private static final String CLASSPATH_ENTRY_1 = "default1.jar";
+
+   private static final String CLASSPATH_ENTRY_2 = "default2.jar";
+
+   private static final String CLASSPATH_ENTRY_3 = "default3.jar";
+
+   private static final String NEW_CLASSPATH_ENTRY_1 = "added1.jar";
+
+   private static final String NEW_CLASSPATH_ENTRY_2 = "added2.jar";
+
+   //------------------------------------------------------------------------||
+   // Instance Members ------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   private JarFile jarFile;
+
+   //------------------------------------------------------------------------||
+   // Lifecycle Methods -----------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   @Before
+   public void beforeTest() throws Throwable
+   {
+      /*
+       * Create a new JAR file for testing
+       */
+
+      // Make the parent directory
+      File parent = new File(FILE_NAME_JAR_PARENT);
+      assert parent.mkdir() || parent.exists() : "Could not create " + FILE_NAME_JAR_PARENT;
+
+      // Create the new ZIP file
+      File newFile = new File(FILE_NAME_JAR_PARENT, FILE_NAME_JAR_FILE);
+      createZipWithManifest(newFile, FILE_NAME_MANIFEST_TEMPLATE);
+
+      // Set the JAR File
+      this.jarFile = new JarFile(newFile);
+   }
+
+   @After
+   public void afterTest() throws Throwable
+   {
+      this.jarFile = null;
+   }
+
+   //------------------------------------------------------------------------||
+   // Internal Helper Methods -----------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   /**
+    * Creates a new ZIP file with a manifest, using contents from the specified
+    * manifest template
+    */
+   private static void createZipWithManifest(File file, String manifestTemplateFilename) throws Throwable
+   {
+      // Initialize
+      OutputStream fos = null;
+      ZipOutputStream zos = null;
+
+      try
+      {
+         // Log
+         log.info("Writing new Manifest-only JAR: " + file.getAbsolutePath());
+
+         // Open up the Streams
+         fos = new FileOutputStream(file);
+         zos = new ZipOutputStream(fos);
+
+         // Put a new Manifest entry in
+         String manifestTarget = "META-INF/MANIFEST.MF";
+         final ZipEntry empty = new ZipEntry(manifestTarget);
+         zos.putNextEntry(empty);
+         log.info("Put manifest: " + manifestTarget);
+
+         // Get the template manifest
+         final URL manifestTemplateUrl = Thread.currentThread().getContextClassLoader().getResource(
+               manifestTemplateFilename);
+         final File manifestTemplate = new File(manifestTemplateUrl.toURI());
+         final InputStream fis = new FileInputStream(manifestTemplate);
+
+         // Write to the manifest entry from the template
+         int len;
+         byte[] buf = new byte[1024];
+         while ((len = fis.read(buf)) > 0)
+         {
+            zos.write(buf, 0, len);
+         }
+
+         // Close the entry
+         zos.closeEntry();
+
+         // Log
+         log.info("Wrote " + manifestTarget + " from template " + manifestTemplateFilename);
+
+      }
+      catch (IOException ioe)
+      {
+         log.error("Error in creating new JAR File w/ Manifest", ioe);
+         throw ioe;
+      }
+      /*
+       * Close up everything
+       */
+      finally
+      {
+         try
+         {
+            if (zos != null)
+            {
+               zos.close();
+            }
+         }
+         catch (IOException ioe)
+         {
+            // Swallow
+         }
+         try
+         {
+            if (fos != null)
+            {
+               fos.close();
+            }
+         }
+         catch (IOException ioe)
+         {
+            // Swallow
+         }
+      }
+   }
+
+   //------------------------------------------------------------------------||
+   // Tests -----------------------------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   /**
+    * The control test.  Ensures that the Class-Path element of the JAR
+    * has expected values
+    */
+   @Test
+   public void testJarManifestControl() throws Throwable
+   {
+      // Read the Class-Path out 
+      final Collection<String> classPathEntries = this.getClassPathFromManifest();
+
+      // Ensure all entries are there
+      TestCase.assertEquals("CP Entries in control was not expected size", 3, classPathEntries.size());
+      String errorNotContainsExpected = "CP Entries in control does not contain all expected elements";
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_1));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_2));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_3));
+   }
+
+   /**
+    * Ensures that entries may be removed from the Manifest CP 
+    * 
+    * @throws Throwable
+    */
+   @Test
+   public void testEntriesRemovedFromClassPath() throws Throwable
+   {
+      // Get the JAR
+      JarFile jar = jarFile;
+
+      // Make an editor
+      ManifestEditor editor = new ManifestEditor(jar);
+
+      // Declare elements to remove
+      Set<String> elementsToRemove = new HashSet<String>();
+      elementsToRemove.add(CLASSPATH_ENTRY_1);
+      elementsToRemove.add(CLASSPATH_ENTRY_3);
+
+      // Remove
+      editor.removeEntriesFromClassPath(elementsToRemove);
+
+      // Read the Class-Path out 
+      final Collection<String> classPathEntries = this.getClassPathFromManifest();
+
+      // Ensure all entries are there
+      TestCase.assertEquals("CP Entries after removal was not expected size", 1, classPathEntries.size());
+      TestCase.assertTrue("CP Entries after removal did not contain " + CLASSPATH_ENTRY_2, classPathEntries
+            .contains(CLASSPATH_ENTRY_2));
+   }
+
+   /**
+    * Ensures that entries may be added to the manifest CP
+    * 
+    * @throws Throwable
+    */
+   @Test
+   public void testEntriesAddedToClassPath() throws Throwable
+   {
+      // Get the JAR
+      JarFile jar = jarFile;
+
+      // Make an editor
+      ManifestEditor editor = new ManifestEditor(jar);
+
+      // Declare elements to add
+      Set<String> elementsToAdd = new HashSet<String>();
+      elementsToAdd.add(NEW_CLASSPATH_ENTRY_1);
+      elementsToAdd.add(NEW_CLASSPATH_ENTRY_2);
+
+      // Remove
+      editor.addEntriesToClassPath(elementsToAdd);
+
+      // Read the Class-Path out 
+      final Collection<String> classPathEntries = this.getClassPathFromManifest();
+
+      // Ensure all entries are there
+      TestCase.assertEquals("CP Entries after insertions was not expected size", 5, classPathEntries.size());
+      String errorNotContainsExpected = "CP Entries after insertions does not contain all expected elements";
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(NEW_CLASSPATH_ENTRY_1));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(NEW_CLASSPATH_ENTRY_2));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_1));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_2));
+      TestCase.assertTrue(errorNotContainsExpected, classPathEntries.contains(CLASSPATH_ENTRY_3));
+   }
+
+   //------------------------------------------------------------------------||
+   // Internal Helper Methods -----------------------------------------------||
+   //------------------------------------------------------------------------||
+
+   /**
+    * Obtains an array of the CP entries from the Manifest
+    */
+   private Collection<String> getClassPathFromManifest() throws Throwable
+   {
+      // Get the JAR
+      final JarFile jar = this.jarFile;
+
+      // Get the Manifest
+      final Manifest manifest = jar.getManifest();
+      TestCase.assertNotNull("The manifest in the test JAR could not be found", manifest);
+
+      // Read the Class-Path out 
+      final Attributes attributes = manifest.getMainAttributes();
+      final String classPath = attributes.getValue(MANIFEST_ENTRY_CLASS_PATH);
+      TestCase.assertNotNull(classPath);
+      log.info("Got " + MANIFEST_ENTRY_CLASS_PATH + ": " + classPath);
+
+      // Split
+      final String[] classPathEntries = classPath.trim().split(DELIMTER_CLASS_PATH);
+
+      // Add to new Collection
+      Collection<String> cp = new ArrayList<String>();
+      for (String classPathEntry : classPathEntries)
+      {
+         cp.add(classPathEntry);
+      }
+
+      // Return
+      return cp;
+   }
+
+}

Added: projects/ejb3/trunk/installer/src/test/resources/log4j.xml
===================================================================
--- projects/ejb3/trunk/installer/src/test/resources/log4j.xml	                        (rev 0)
+++ projects/ejb3/trunk/installer/src/test/resources/log4j.xml	2009-03-12 18:30:28 UTC (rev 85789)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 68671 2008-01-08 10:04:25Z wolfc $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ================================= -->
+  <!-- Preserve messages in a local file -->
+  <!-- ================================= -->
+
+  <!-- A time/date based rolling appender -->
+  <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+    <param name="File" value="target/test.log"/>
+    <param name="Threshold" value="INFO"/>
+    <param name="Append" value="false"/>
+
+    <!-- Rollover at midnight each day -->
+    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+    <!-- Rollover at the top of each hour
+    <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+    -->
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+      <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+      <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+       -->
+    </layout>     
+  </appender>
+
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+    </layout>
+  </appender>
+
+
+  <!-- ================ -->
+  <!-- Limit categories -->
+  <!-- ================ -->
+  
+  <category name="org.jboss">
+    <priority value="INFO"/>
+  </category>
+  
+  <category name="org.jboss.ejb3">
+    <priority value="ALL"/>
+  </category>
+  
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+
+  <root>
+    <appender-ref ref="CONSOLE"/>
+    <appender-ref ref="FILE"/>
+  </root>
+  
+</log4j:configuration>

Added: projects/ejb3/trunk/installer/src/test/resources/manifest_template
===================================================================
--- projects/ejb3/trunk/installer/src/test/resources/manifest_template	                        (rev 0)
+++ projects/ejb3/trunk/installer/src/test/resources/manifest_template	2009-03-12 18:30:28 UTC (rev 85789)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.7.1
+Created-By: 1.5.0_15-b04 (Sun Microsystems Inc.)
+Specification-Title: JBossAS
+Specification-Version: 6.0.0.Alpha1
+Specification-Vendor: JBoss (http://www.jboss.org/)
+Implementation-Title: JBoss [Neo]
+Implementation-Version: 6.0.0.Alpha1 (build: SVNTag=JBoss_6_0_0_Alpha1 date=200902270718)
+Implementation-Vendor: JBoss.org
+Implementation-Vendor-Id: http://www.jboss.org/
+Class-Path: default1.jar default2.jar default3.jar




More information about the jboss-cvs-commits mailing list