avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject svn commit: rev 20872 - in avalon/trunk/runtime/framework/impl: . src/test/org/apache/avalon/framework/configuration/test
Date Mon, 07 Jun 2004 16:14:41 GMT
Author: mcconnell
Date: Mon Jun  7 09:14:40 2004
New Revision: 20872

Modified:
   avalon/trunk/runtime/framework/impl/build.properties
   avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java
   avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java
Log:
Update testcases to work relative to basedir

Modified: avalon/trunk/runtime/framework/impl/build.properties
==============================================================================
--- avalon/trunk/runtime/framework/impl/build.properties	(original)
+++ avalon/trunk/runtime/framework/impl/build.properties	Mon Jun  7 09:14:40 2004
@@ -1,3 +1,3 @@
 project.name = avalon-framework-impl
-project.src.main = java
 project.home = ../../../central/system
+project.src.main = java

Modified: avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java
==============================================================================
--- avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java
(original)
+++ avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java
Mon Jun  7 09:14:40 2004
@@ -46,7 +46,7 @@
     private static final String NS_FILE_NAME = "config_namespaces.xml";
     private static final String EXTERNAL_FILE_NAME = "config_usingexternal.xml";
     private static final String INNER_FILE_NAME = "config_inner.xml";
-    private static final String TEST_PATH = "test/framework/io/";
+    private static final String TEST_PATH = "io";
 
     private DefaultConfigurationBuilder m_builder;
     private DefaultConfigurationBuilder m_nsBuilder;
@@ -276,8 +276,9 @@
 
     public DefaultConfigurationBuilderTestCase( final String name )
     {
-        super( name );
-        m_testDirectory = (new File( TEST_PATH )).getAbsoluteFile();
+        super( name );
+        File basedir = new File( System.getProperty( "basedir" ) );
+        m_testDirectory = (new File( basedir, TEST_PATH )).getAbsoluteFile();
         if( !m_testDirectory.exists() )
         {
             m_testDirectory.mkdirs();
@@ -306,7 +307,6 @@
         writer.close();
     }
 
-
     protected  void tearDown()
         throws Exception
     {
@@ -314,17 +314,20 @@
         m_nsBuilder = null;
     }
 
-
     public void testBuildFromFileName()
         throws Exception
     {
          m_builder = new DefaultConfigurationBuilder();
-         m_nsBuilder = new DefaultConfigurationBuilder(true); // switch on namespace support
-         Configuration conf = m_builder.buildFromFile( TEST_PATH + SIMPLE_FILE_NAME );
+         m_nsBuilder = new DefaultConfigurationBuilder(true); // switch on namespace support
+         File basedir = new File( System.getProperty( "basedir" ) );
+         File testFile = new File( basedir, TEST_PATH );
+         File simple = new File( testFile, SIMPLE_FILE_NAME );
+
+         Configuration conf = m_builder.buildFromFile( simple.toString() );
          simpleAssertions( conf );
-         conf = m_builder.buildFromFile( TEST_PATH + NS_FILE_NAME );
+         conf = m_builder.buildFromFile( new File( testFile, NS_FILE_NAME ).toString() );
          simpleAssertionsNS( conf );
-         conf = m_nsBuilder.buildFromFile( TEST_PATH + NS_FILE_NAME );
+         conf = m_nsBuilder.buildFromFile( new File( testFile, NS_FILE_NAME ).toString()
);
          nsAssertions( conf );
     }
 
@@ -442,7 +445,10 @@
         MyEntityResolver customResolver = new MyEntityResolver();
  
         builder.setEntityResolver( new MyEntityResolver() );
-        Configuration conf = builder.buildFromFile( TEST_PATH + EXTERNAL_FILE_NAME );
+        File basedir = new File( System.getProperty( "basedir" ) );
+        File testFile = new File( basedir, TEST_PATH );
+        File external = new File( testFile, EXTERNAL_FILE_NAME );
+        Configuration conf = builder.buildFromFile( external  );
         simpleAssertions( conf );
     }
     

Modified: avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java
==============================================================================
--- avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java
(original)
+++ avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java
Mon Jun  7 09:14:40 2004
@@ -42,9 +42,14 @@
         super( name );
     }
     
-    public void setUp() {
-        testDirectory = (new File("test/framework/io")).getAbsoluteFile();
-        testDirectory2 = (new File("test/framework/DefaultConfigurationSerializerTestCase")).getAbsoluteFile();
+    public void setUp() {
+        File basedir = new File( System.getProperty( "basedir" ) );
+        testDirectory = (new File( basedir, "io" ) ).getAbsoluteFile();
+        testDirectory2 = 
+          new File( 
+            basedir,  
+            "DefaultConfigurationSerializerTestCase" ).getAbsoluteFile();
+
         if( !testDirectory.exists() )
         {
             testDirectory.mkdirs();

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message