geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment EARConfigBuilderTest.java
Date Mon, 06 Sep 2004 02:06:09 GMT
dain        2004/09/05 19:06:09

  Modified:    modules/j2ee project.properties
               modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment
                        EARConfigBuilderTest.java
  Log:
  Tests in the j2ee module no longer require forking
  
  Revision  Changes    Path
  1.3       +1 -2      incubator-geronimo/modules/j2ee/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties	5 Sep 2004 06:09:11 -0000	1.2
  +++ project.properties	6 Sep 2004 02:06:09 -0000	1.3
  @@ -4,4 +4,3 @@
   
   # Include the generated xmlbean classes in the eclipse classpath
   maven.eclipse.classpath.include=target/xmlbeans
  -maven.junit.fork=true
  
  
  
  1.10      +22 -34    incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
  
  Index: EARConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EARConfigBuilderTest.java	9 Aug 2004 04:19:35 -0000	1.9
  +++ EARConfigBuilderTest.java	6 Sep 2004 02:06:09 -0000	1.10
  @@ -20,13 +20,12 @@
   import java.io.File;
   import java.net.URI;
   import java.net.URL;
  -
   import javax.management.ObjectName;
   
  -import junit.framework.TestCase;
  +import junit.extensions.TestSetup;
   import junit.framework.Test;
  +import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import junit.extensions.TestSetup;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.kernel.jmx.JMXUtil;
   import org.apache.xmlbeans.XmlObject;
  @@ -35,9 +34,11 @@
    * @version $Revision$ $Date$
    */
   public class EARConfigBuilderTest extends TestCase {
  +    private static final File basedir = new File(System.getProperty("basedir", System.getProperty("user.dir")));
   
  -    private static String EAR_BASE_DIR;
  -    private static String EAR_PATH;
  +//    private static String EAR_BASE_DIR;
  +//    private static String EAR_PATH;
  +    private static File earFile;
       private static MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
       private static MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
       private static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  @@ -53,8 +54,7 @@
           TestSuite inner = new TestSuite(EARConfigBuilderTest.class);
           TestSetup setup14 = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-ear14";
  -                EAR_PATH = "test-ear.ear";
  +                earFile = new File(basedir,  "target/test-ear14/test-ear.ear");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  @@ -66,8 +66,7 @@
           };
           TestSetup setupNaked14 = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-ear14";
  -                EAR_PATH = "test-naked-ear.ear";
  +                earFile = new File(basedir,  "target/test-ear14/test-naked-ear.ear");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  @@ -79,8 +78,7 @@
           };
           TestSetup setup13 = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-ear13";
  -                EAR_PATH = "test-ear.ear";
  +                earFile = new File(basedir,  "target/test-ear13/test-ear.ear");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  @@ -92,8 +90,7 @@
           };
           TestSetup setupNaked13 = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-ear13";
  -                EAR_PATH = "test-naked-ear.ear";
  +                earFile = new File(basedir, "target/test-ear13/test-naked-ear.ear");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  @@ -105,8 +102,7 @@
           };
           TestSetup setupUnpacked = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-unpacked-ear";
  -                EAR_PATH = "full/";
  +                earFile = new File(basedir,  "target/test-unpacked-ear/full/");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war/", URI.create("test-war/"),
"test");
  @@ -118,8 +114,7 @@
           };
           TestSetup setupUnpackedNaked = new TestSetup(inner) {
               protected void setUp() {
  -                EAR_BASE_DIR = "target/test-unpacked-ear";
  -                EAR_PATH = "naked/";
  +                earFile = new File(basedir,  "target/test-unpacked-ear/naked/");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war/", URI.create("test-war/"),
"test");
  @@ -131,19 +126,17 @@
           };
           TestSetup setupUnpackedAltDD = new TestSetup(inner) {
               protected void setUp() throws Exception {
  -                EAR_BASE_DIR = "target/test-unpacked-ear";
  -                EAR_PATH = "alt-dd/";
  +                earFile = new File(basedir,  "target/test-unpacked-ear/alt-dd/");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
  -                File baseDir = new File(EAR_BASE_DIR + "/" + EAR_PATH);
  -                ejbConfigBuilder.ejbModule.setAltSpecDD(new File(baseDir, "alt-ejb-jar.xml").toURL());
  -                ejbConfigBuilder.ejbModule.setAltVendorDD(new File(baseDir, "alt-ger-ejb-jar.xml").toURL());
  +                ejbConfigBuilder.ejbModule.setAltSpecDD(new File(earFile, "alt-ejb-jar.xml").toURL());
  +                ejbConfigBuilder.ejbModule.setAltVendorDD(new File(earFile, "alt-ger-ejb-jar.xml").toURL());
                   webConfigBuilder.contextRoot = "test";
                   webConfigBuilder.webModule = new WebModule("test-war/", URI.create("test-war/"),
"test");
  -                webConfigBuilder.webModule.setAltSpecDD(new File(baseDir, "alt-web.xml").toURL());
  -                webConfigBuilder.webModule.setAltVendorDD(new File(baseDir, "alt-ger-war.xml").toURL());
  +                webConfigBuilder.webModule.setAltSpecDD(new File(earFile, "alt-web.xml").toURL());
  +                webConfigBuilder.webModule.setAltVendorDD(new File(earFile, "alt-ger-war.xml").toURL());
                   connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  -                connectorConfigBuilder.connectorModule.setAltSpecDD(new File(baseDir, "alt-ra.xml").toURL());
  -                connectorConfigBuilder.connectorModule.setAltVendorDD(new File(baseDir,
"alt-ger-ra.xml").toURL());
  +                connectorConfigBuilder.connectorModule.setAltSpecDD(new File(earFile, "alt-ra.xml").toURL());
  +                connectorConfigBuilder.connectorModule.setAltVendorDD(new File(earFile,
"alt-ger-ra.xml").toURL());
               }
   
               protected void tearDown() {
  @@ -151,10 +144,9 @@
           };
           TestSetup setupPackedAltDD = new TestSetup(inner) {
               protected void setUp() throws Exception {
  -                EAR_BASE_DIR = "target/test-unpacked-ear";
  -                EAR_PATH = "alt-dd.ear";
  +                earFile = new File(basedir,  "target/test-unpacked-ear/alt-dd.ear");
                   ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
  -                String baseURI = "jar:" + new File(EAR_BASE_DIR + "/" + EAR_PATH).toURL()
+ "!/";
  +                String baseURI = "jar:" + earFile.toURL() + "!/";
                   ejbConfigBuilder.ejbModule.setAltSpecDD(new URL(baseURI + "alt-ejb-jar.xml"));
                   ejbConfigBuilder.ejbModule.setAltVendorDD(new URL(baseURI + "alt-ger-ejb-jar.xml"));
                   webConfigBuilder.contextRoot = "test";
  @@ -184,7 +176,6 @@
   
       public void testBuildConfiguration() throws Exception {
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  @@ -197,7 +188,6 @@
   
       public void testNoEJBDeployer() throws Exception {
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, null, webConfigBuilder, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  @@ -213,7 +203,6 @@
   
       public void testNoWARDeployer() throws Exception {
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, null, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  @@ -229,7 +218,6 @@
   
       public void testNoConnectorDeployer() throws Exception {
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, null, null);
  -        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  
  
  

Mime
View raw message