You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/04/24 23:49:02 UTC
cvs commit: jakarta-turbine-2/src/test/org/apache/turbine/test TestComponentImpl.java
quintonm 2003/04/24 14:49:02
Modified: src/test/org/apache/turbine/test TestComponentImpl.java
Log:
updated test case to make the test component Contextualizable. Test getting the
new application root from the context.
Revision Changes Path
1.3 +14 -4 jakarta-turbine-2/src/test/org/apache/turbine/test/TestComponentImpl.java
Index: TestComponentImpl.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/test/org/apache/turbine/test/TestComponentImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestComponentImpl.java 9 Mar 2003 03:08:49 -0000 1.2
+++ TestComponentImpl.java 24 Apr 2003 21:49:02 -0000 1.3
@@ -57,6 +57,9 @@
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
/**
* Implementation of the test component.
@@ -66,8 +69,9 @@
*/
public class TestComponentImpl
extends AbstractLogEnabled
- implements Initializable, Disposable, TestComponent
+ implements Initializable, Disposable, TestComponent, Contextualizable
{
+ private String appRoot;
public void initialize() throws Exception
{
@@ -79,7 +83,13 @@
public void test()
{
- this.setupLogger(this, "TestComponent");
- this.getLogger().debug("test");
+ setupLogger(this, "TestComponent");
+ getLogger().debug("test");
+ getLogger().debug("ComponentAppRoot = "+appRoot);
+ }
+
+ public void contextualize(Context context) throws ContextException
+ {
+ appRoot = (String) context.get("ComponentAppRoot");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org