donaldp 2002/11/12 13:56:00
Modified: testcase/src/java/org/apache/avalon/excalibur/testcase
ExcaliburTestCase.java
Log:
Cleanup the excalibur test case and remove protected variables
Revision Changes Path
1.6 +17 -25
jakarta-avalon-excalibur/testcase/src/java/org/apache/avalon/excalibur/testcase/ExcaliburTestCase.java
Index: ExcaliburTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/testcase/src/java/org/apache/avalon/excalibur/testcase/ExcaliburTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ExcaliburTestCase.java 7 Sep 2002 11:35:11 -0000 1.5
+++ ExcaliburTestCase.java 12 Nov 2002 21:56:00 -0000 1.6
@@ -23,6 +23,8 @@
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.component.Component;
+import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.context.Context;
@@ -219,7 +221,6 @@
///Format of default formatter
private static final String FORMAT =
"%7.7{priority} %23.23{time:yyyy-MM-dd' 'HH:mm:ss.SSS} [%30.30{category}]
(%{context}): %{message}\n%{throwable}";
- //"%7.7{priority} %5.5{time} [%20.20{category}] (%{context}):
%{message}\\n%{throwable}";
//The default logger
private Logger m_logger;
@@ -228,12 +229,6 @@
private DefaultLogKitManager m_logKitManager;
private static HashMap m_tests = new HashMap();
- /**
- * @deprecated The test log priority should now be set using the test category
in the
- * test case configuration file using the "test" category.
- */
- protected Priority m_logPriority = null;
-
protected ComponentManager manager;
public ExcaliburTestCase( final String name )
@@ -332,7 +327,7 @@
conf.getChild( "logkit" ),
context );
manager = m_manager;
-
+
setCurrentLogger( "prepare" );
}
@@ -417,7 +412,7 @@
}
catch( Exception e )
{
- System.out.println(e);
+ System.out.println( e );
e.printStackTrace();
result.addError( this, e );
}
@@ -452,14 +447,7 @@
{
// Logger for the portion of the configuration has been loaded.
logger = Hierarchy.getDefaultHierarchy().getLoggerFor( name );
- if( m_logPriority != null )
- {
- logger.setPriority( m_logPriority );
- }
- else
- {
- logger.setPriority( Priority.INFO );
- }
+ logger.setPriority( Priority.INFO );
PatternFormatter formatter = new PatternFormatter( FORMAT );
StreamTarget target = new StreamTarget( System.out, formatter );
@@ -468,13 +456,6 @@
else
{
logger = m_logKitManager.getLogger( "test." + name );
-
- // Use the log priority in the conf file unless specified using the
m_logPriority
- // property. This must be kept around for backwards compatibility.
- if( m_logPriority != null )
- {
- logger.setPriority( m_logPriority );
- }
}
/*
@@ -575,5 +556,16 @@
manager.configure( confCM );
manager.initialize();
m_manager = manager;
+ }
+
+ protected final Object lookup( final String key )
+ throws ComponentException
+ {
+ return manager.lookup( key );
+ }
+
+ protected final void release( final Component object )
+ {
+ manager.release( object );
}
}
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>