leosimons 2003/08/16 08:43:54
Added: magic .cvsignore LICENSE.txt README.txt maven.log
maven.xml project-common.xml project.xml
magic/api .cvsignore project.xml
magic/impl .cvsignore project.xml
magic/impl/src/java/org/apache/avalon/magic/impl
Avalon2PicoAdapter.java
magic/impl/src/test/org/apache/avalon/magic/test/impl
AssertionLogger.java
Avalon2PicoAdapterTestCase.java Tweety.java
TweetyImpl.java
Log:
Adding initial cut of a working Avalon2PicoAdapter.
Revision Changes Path
1.1 avalon-sandbox/magic/.cvsignore
Index: .cvsignore
===================================================================
target
*.log
1.1 avalon-sandbox/magic/LICENSE.txt
Index: LICENSE.txt
===================================================================
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 2003 The Apache Software Foundation.
All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Apache", "Avalon", "Excalibur", "Fortress", "Phoenix",
"Merlin" and "Apache Software Foundation" must not be used to endorse or
promote products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see http://www.apache.org/.
1.1 avalon-sandbox/magic/README.txt
Index: README.txt
===================================================================
============================================
Avalon-Magic: your ultimate interop solution
============================================
=======================================================================
Magic?
Avalon-Magic allows you to exchange components between various
container models and apis. The initial goal is to support interop
between XWork/WebWork2, Avalon and PicoContainer/NanoContainer.
=======================================================================
How does it work?
By using reflection, JDK 1.3 dynamic proxies and other tricks.
=======================================================================
How do I build it?
Get maven, then type 'maven'.
=======================================================================
Plans?
No. This is a sandbox project.
=======================================================================
Docs?
No. Please add to the wiki for us.
1.1 avalon-sandbox/magic/maven.log
Index: maven.log
===================================================================
2003-08-16 17:38:17,562 INFO org.apache.maven.plugin.PluginManager - Initializing
Plugins!
2003-08-16 17:38:17,609 INFO org.apache.maven.plugin.PluginManager - Unpacking
plugins from directory --> C:\opt\maven-1.0-beta-10\plugins
2003-08-16 17:38:17,656 INFO org.apache.maven.plugin.PluginManager - Processing
unpacked plugins in C:\Documents and Settings\lsimons\.maven\plugins
2003-08-16 17:38:17,656 INFO org.apache.maven.plugin.PluginManager - Processing
Plugin: maven-deploy-plugin-1.1
2003-08-16 17:38:17,796 INFO org.apache.maven.plugin.PluginManager - Processing
Plugin: maven-plexus-plugin-0.2
2003-08-16 17:38:17,828 INFO org.apache.maven.plugin.PluginManager - Processing
Plugin: maven-runner-plugin-0.2
2003-08-16 17:38:17,828 INFO org.apache.maven.plugin.PluginManager - Processing
Plugin: maven-sea-plugin-1.0
2003-08-16 17:38:17,843 INFO org.apache.maven.plugin.PluginManager - Processing
Plugin: maven-vdoclet-plugin-1.0
2003-08-16 17:38:17,843 INFO org.apache.maven.plugin.PluginCacheManager - Saving
caches to C:\Documents and Settings\lsimons\.maven\plugins
2003-08-16 17:38:17,921 INFO org.apache.maven.plugin.PluginManager - Finished
initializing Plugins!
2003-08-16 17:38:23,781 WARN
org.apache.commons.jelly.expression.jexl.JexlExpression - Caught exception evaluating:
[EMAIL PROTECTED] Reason: java.lang.NumberFormatException: For input string: "includes"
java.lang.NumberFormatException: For input string: "includes"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Integer.valueOf(Integer.java:532)
at org.apache.commons.jexl.util.Coercion.coerceInteger(Coercion.java:95)
at
org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:177)
at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:104)
at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:106)
at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:88)
at org.apache.commons.jexl.parser.ASTNotNode.value(ASTNotNode.java:88)
at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:85)
at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:123)
at
org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:115)
at
org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$ExpressionSupportLocal.evaluate(JexlExpressionFactory.java:168)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:106)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:116)
at org.apache.commons.jelly.tags.core.WhenTag.doTag(WhenTag.java:90)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:84)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.ProjectTag.doTag(ProjectTag.java:112)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:112)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:139)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:734)
at
org.apache.maven.plugin.PluginManager.prepDynamicTagLib(PluginManager.java:611)
at
org.apache.maven.plugin.PluginManager.prepDynaTagLibs(PluginManager.java:586)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:686)
at org.apache.maven.plugin.PluginManager.loadPlugins(PluginManager.java:766)
at
org.apache.maven.plugin.PluginManager.prepForCallbacks(PluginManager.java:554)
at org.apache.maven.plugin.PluginManager.prepForGoal(PluginManager.java:525)
at org.apache.maven.MavenSession.prepForGoal(MavenSession.java:248)
at
org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:105)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:360)
at org.apache.maven.jelly.tags.maven.ReactorTag.doTag(ReactorTag.java:374)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
at org.apache.maven.cli.App.doMain(App.java:525)
at org.apache.maven.cli.App.main(App.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:543)
at com.werken.forehead.Forehead.main(Forehead.java:573)
2003-08-16 17:38:23,796 WARN
org.apache.commons.jelly.expression.jexl.JexlExpression - Caught exception evaluating:
[EMAIL PROTECTED] Reason: java.lang.NumberFormatException: For input string: "excludes"
java.lang.NumberFormatException: For input string: "excludes"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Integer.valueOf(Integer.java:532)
at org.apache.commons.jexl.util.Coercion.coerceInteger(Coercion.java:95)
at
org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:177)
at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:104)
at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:106)
at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:88)
at org.apache.commons.jexl.parser.ASTNotNode.value(ASTNotNode.java:88)
at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:85)
at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:123)
at
org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:115)
at
org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$ExpressionSupportLocal.evaluate(JexlExpressionFactory.java:168)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:106)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:116)
at org.apache.commons.jelly.tags.core.WhenTag.doTag(WhenTag.java:90)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:84)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.ProjectTag.doTag(ProjectTag.java:112)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:112)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:139)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:734)
at
org.apache.maven.plugin.PluginManager.prepDynamicTagLib(PluginManager.java:611)
at
org.apache.maven.plugin.PluginManager.prepDynaTagLibs(PluginManager.java:586)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:686)
at org.apache.maven.plugin.PluginManager.loadPlugins(PluginManager.java:766)
at
org.apache.maven.plugin.PluginManager.prepForCallbacks(PluginManager.java:554)
at org.apache.maven.plugin.PluginManager.prepForGoal(PluginManager.java:525)
at org.apache.maven.MavenSession.prepForGoal(MavenSession.java:248)
at
org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:105)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:360)
at org.apache.maven.jelly.tags.maven.ReactorTag.doTag(ReactorTag.java:374)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
at org.apache.maven.cli.App.doMain(App.java:525)
at org.apache.maven.cli.App.main(App.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:543)
at com.werken.forehead.Forehead.main(Forehead.java:573)
2003-08-16 17:38:23,812 WARN
org.apache.commons.jelly.expression.jexl.JexlExpression - Caught exception evaluating:
[EMAIL PROTECTED] Reason: java.lang.NumberFormatException: For input string: "includes"
java.lang.NumberFormatException: For input string: "includes"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Integer.valueOf(Integer.java:532)
at org.apache.commons.jexl.util.Coercion.coerceInteger(Coercion.java:95)
at
org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:177)
at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:104)
at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:106)
at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:88)
at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:123)
at
org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:115)
at
org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$ExpressionSupportLocal.evaluate(JexlExpressionFactory.java:168)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:106)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:146)
at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:127)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.TagSupport.getBodyText(TagSupport.java:271)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:267)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.ProjectTag.doTag(ProjectTag.java:112)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:112)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:139)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:734)
at
org.apache.maven.plugin.PluginManager.prepDynamicTagLib(PluginManager.java:611)
at
org.apache.maven.plugin.PluginManager.prepDynaTagLibs(PluginManager.java:586)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:686)
at org.apache.maven.plugin.PluginManager.loadPlugins(PluginManager.java:766)
at
org.apache.maven.plugin.PluginManager.prepForCallbacks(PluginManager.java:554)
at org.apache.maven.plugin.PluginManager.prepForGoal(PluginManager.java:525)
at org.apache.maven.MavenSession.prepForGoal(MavenSession.java:248)
at
org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:105)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:360)
at org.apache.maven.jelly.tags.maven.ReactorTag.doTag(ReactorTag.java:374)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
at org.apache.maven.cli.App.doMain(App.java:525)
at org.apache.maven.cli.App.main(App.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:543)
at com.werken.forehead.Forehead.main(Forehead.java:573)
2003-08-16 17:38:23,812 WARN
org.apache.commons.jelly.expression.jexl.JexlExpression - Caught exception evaluating:
[EMAIL PROTECTED] Reason: java.lang.NumberFormatException: For input string: "excludes"
java.lang.NumberFormatException: For input string: "excludes"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Integer.valueOf(Integer.java:532)
at org.apache.commons.jexl.util.Coercion.coerceInteger(Coercion.java:95)
at
org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:177)
at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:104)
at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:106)
at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:88)
at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:123)
at
org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:115)
at
org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$ExpressionSupportLocal.evaluate(JexlExpressionFactory.java:168)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:106)
at
org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:146)
at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:127)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.TagSupport.getBodyText(TagSupport.java:271)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:267)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.ProjectTag.doTag(ProjectTag.java:112)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:112)
at org.apache.maven.jelly.JellyUtils.runScript(JellyUtils.java:139)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:734)
at
org.apache.maven.plugin.PluginManager.prepDynamicTagLib(PluginManager.java:611)
at
org.apache.maven.plugin.PluginManager.prepDynaTagLibs(PluginManager.java:586)
at org.apache.maven.plugin.PluginManager.loadPlugin(PluginManager.java:686)
at org.apache.maven.plugin.PluginManager.loadPlugins(PluginManager.java:766)
at
org.apache.maven.plugin.PluginManager.prepForCallbacks(PluginManager.java:554)
at org.apache.maven.plugin.PluginManager.prepForGoal(PluginManager.java:525)
at org.apache.maven.MavenSession.prepForGoal(MavenSession.java:248)
at
org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:105)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:360)
at org.apache.maven.jelly.tags.maven.ReactorTag.doTag(ReactorTag.java:374)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
at org.apache.maven.cli.App.doMain(App.java:525)
at org.apache.maven.cli.App.main(App.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:543)
at com.werken.forehead.Forehead.main(Forehead.java:573)
1.1 avalon-sandbox/magic/maven.xml
Index: maven.xml
===================================================================
<?xml version="1.0"?>
<project default="avalon-magic:install-snapshot"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven">
<goal name="avalon-magic:install-snapshot">
<maven:reactor
basedir="${basedir}/impl/"
includes="project.xml"
goals="jar:install-snapshot"
banner="INSTALLING SNAPSHOT: "
ignoreFailures="false"/>
</goal>
</project>
1.1 avalon-sandbox/magic/project-common.xml
Index: project-common.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<pomVersion>3</pomVersion>
<inceptionYear>2003</inceptionYear>
<shortDescription>smart reflection and proxy library</shortDescription>
<description>
Avalon-Magic is a small and pragmatic library that contains smart
(but complex and ugly and sometimes slow) reflection and proxying
code that allows interop between various container solutions.
</description>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<inceptionYear>2003</inceptionYear>
<package>org.apache.avalon.magic</package>
<gumpRepositoryId>avalon-sandbox</gumpRepositoryId>
<url>http://avalon.apache.org/sandbox/magic/</url>
<issueTrackingUrl><![CDATA[http://nagoya.apache.org/bugzilla/reports.cgi?product=Avalon&output=most_doomed&links=1&banner=1&quip=0]]></issueTrackingUrl>
<repository>
<connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:avalon-sandbox</connection>
<url>http://cvs.apache.org/viewcvs/avalon-sandbox/magic/</url>
</repository>
<mailingLists>
<mailingList>
<name>Avalon User List</name>
<subscribe>
[EMAIL PROTECTED]
</subscribe>
<unsubscribe>
[EMAIL PROTECTED]
</unsubscribe>
<archive>
http://marc.theaimsgroup.com/?l=avalon-users
</archive>
</mailingList>
<mailingList>
<name>Avalon Development List</name>
<subscribe>
[EMAIL PROTECTED]
</subscribe>
<unsubscribe>
[EMAIL PROTECTED]
</unsubscribe>
<archive>
http://marc.theaimsgroup.com/?l=avalon-dev
</archive>
</mailingList>
<mailingList>
<name>Avalon CVS List</name>
<subscribe>
[EMAIL PROTECTED]
</subscribe>
<unsubscribe>
[EMAIL PROTECTED]
</unsubscribe>
<archive>
http://nagoya.apache.org/eyebrowse/SummarizeList?listId=8
</archive>
</mailingList>
</mailingLists>
<dependencies>
<dependency>
<id>junit</id>
<version>3.8.1</version>
<url>http://www.junit.org/</url>
</dependency>
</dependencies>
<properties>
<use-forrest>true</use-forrest>
</properties>
<build>
<nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress>
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
<!-- Unit test cases -->
<unitTest>
<includes>
<include>**/*TestCase.java</include>
</includes>
<excludes>
<exclude>**/Abstract*</exclude>
</excludes>
</unitTest>
<!-- Resources that are packaged up inside the JAR file -->
<resources>
<includes>
<include>*.conf</include>
<include>*.xconf</include>
<include>*.resources</include>
<include>*.properties</include>
</includes>
</resources>
</build>
</project>
1.1 avalon-sandbox/magic/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>./project-common.xml</extend>
<name>Avalon-Magic</name>
<id>avalon-magic</id>
<currentVersion>0.1a</currentVersion>
</project>
1.1 avalon-sandbox/magic/api/.cvsignore
Index: .cvsignore
===================================================================
target
*.log
1.1 avalon-sandbox/magic/api/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>${basedir}/../project-common.xml</extend>
<name>Avalon-Magic API</name>
<id>avalon-magic-api</id>
<currentVersion>0.1a</currentVersion>
</project>
1.1 avalon-sandbox/magic/impl/.cvsignore
Index: .cvsignore
===================================================================
target
*.log
1.1 avalon-sandbox/magic/impl/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>${basedir}/../project-common.xml</extend>
<name>Avalon-Magic Implementation</name>
<id>avalon-magic-impl</id>
<currentVersion>0.1a</currentVersion>
<dependencies>
<dependency>
<id>avalon-framework</id>
<version>4.1.4</version>
</dependency>
</dependencies>
</project>
1.1
avalon-sandbox/magic/impl/src/java/org/apache/avalon/magic/impl/Avalon2PicoAdapter.java
Index: Avalon2PicoAdapter.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.avalon.magic.impl;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.InvocationHandler;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.logger.Logger;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.Contextualizable;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.container.ContainerUtil;
/**
* An InvocationHandler that intercepts calls to the avalon-framework
* lifecycle methods and saves their arguments for later use. During
* initialize, an instance is created with the constructor arguments
* populated from stuff retrieved from the avalon-framework lifecycle
* arguments.
*
* TODO: fully support the complete lifecycle
*
* Usage:
*
* <pre>
* public class MyComponentImpl implements MyComponent
* {
* Logger m_logger;
* Configuration m_config;
* MyOtherComponent m_moc;
*
* public MyComponentImpl( Logger logger, Configuration config,
* MyOtherComponent moc )
* {
* m_logger = logger;
* m_configuration = config;
* m_moc = moc;
* }
*
* public void doStuff() {
* moc.callMe();
* }
* }
*
* // and then somewhere....
* MyComponent comp = (MyComponent)
* AvalonInvocationHandler.getProxy( MyComponentImpl.class );
*
* // the container will set up your logger, configuration and
* // all other dependencies for you
* myAvalonContainer.add( comp );
*
* // you can only use methods specified by interfaces here, but
* // that's already true for all avalon components
* comp.doStuff();
*
* </pre>
*
* Yes, indeed, this allows you to deploy any PicoContainer-compatible
* component into an existing avalon container! This class can also be
* used by avalon containers internally to automagicallly support
* PicoContainer-compatible components.
*
* @version $Id: Avalon2PicoAdapter.java,v 1.1 2003/08/16 15:43:53 leosimons Exp $
*/
public class Avalon2PicoAdapter implements InvocationHandler
{
// ----------------------------------------------------------------------
// Properties
// ----------------------------------------------------------------------
private boolean initialized = false;
private boolean badstate = false;
private Class m_targetClass;
private Object m_target;
private Logger m_log;
private Context m_context;
private ServiceManager m_serviceManager;
private Configuration m_configuration;
public final static Method ENABLE_LOGGING;
static
{
Method m;
try
{
m = LogEnabled.class.getMethod( "enableLogging",
new Class[] { Logger.class } );
}
catch( NoSuchMethodException nsme )
{
// won't happen
m = null;
}
ENABLE_LOGGING = m;
}
public final static Method SERVICE;
static
{
Method m;
try
{
m = Serviceable.class.getMethod( "service",
new Class[] { ServiceManager.class } );
}
catch( NoSuchMethodException nsme )
{
// won't happen
m = null;
}
SERVICE = m;
}
public final static Method CONTEXTUALIZE;
static
{
Method m;
try
{
m = Contextualizable.class.getMethod( "contextualize",
new Class[] { Context.class } );
}
catch( NoSuchMethodException nsme )
{
// won't happen
m = null;
}
CONTEXTUALIZE = m;
}
public final static Method CONFIGURE;
static
{
Method m;
try
{
m = Configurable.class.getMethod( "configure",
new Class[] { Configuration.class } );
}
catch( NoSuchMethodException nsme )
{
// won't happen
m = null;
}
CONFIGURE = m;
}
public final static Method INITIALIZE;
static
{
Method m;
try
{
m = Initializable.class.getMethod( "initialize",
new Class[0] );
}
catch( NoSuchMethodException nsme )
{
// won't happen
m = null;
}
INITIALIZE = m;
}
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
Avalon2PicoAdapter( Class target )
{
setTargetClass( target );
}
/**
* Create a proxy that will redirect calls to avalon-framework
* lifecycle methods to a multi-argument constructor.
*
* @param targetClass
* @return
*/
public static Object getProxy( Class targetClass )
{
// all interfaces implemented by the class,
// and all lifecycle interfaces implemented
// by the handler
Class[] intf = targetClass.getInterfaces();
List i = new ArrayList( Arrays.asList(intf) );
i.add( LogEnabled.class );
i.add( Serviceable.class );
i.add( Contextualizable.class );
i.add( Configurable.class );
i.add( Initializable.class );
intf = (Class[])i.toArray( new Class[i.size()] );
return Proxy.newProxyInstance(
targetClass.getClassLoader(),
intf,
new Avalon2PicoAdapter( targetClass ) );
}
// ----------------------------------------------------------------------
// Methods
// ----------------------------------------------------------------------
protected Class getTargetClass()
{
return m_targetClass;
}
protected void setTargetClass( Class targetClass )
{
m_targetClass = targetClass;
}
protected Logger getLog()
{
return m_log;
}
protected void setLog( Logger log )
{
m_log = log;
}
protected Context getContext()
{
return m_context;
}
protected void setContext( Context context )
{
m_context = context;
}
protected ServiceManager getServiceManager()
{
return m_serviceManager;
}
protected void setServiceManager( ServiceManager serviceManager )
{
m_serviceManager = serviceManager;
}
protected Configuration getConfiguration()
{
return m_configuration;
}
protected void setConfiguration( Configuration configuration )
{
m_configuration = configuration;
}
public Object invoke( Object proxy, Method method, Object[] args )
throws Throwable
{
if(badstate)
throw new IllegalStateException( "Initialization did not complete
without errors!" );
if(initialized)
return method.invoke( m_target, args );
if( ENABLE_LOGGING.equals( method ) )
{
setLog( (Logger)args[0] );
return null;
}
if( CONTEXTUALIZE.equals( method ) )
{
setContext( (Context)args[0] );
return null;
}
if( SERVICE.equals( method ) )
{
setServiceManager( (ServiceManager)args[0] );
return null;
}
if( CONFIGURE.equals( method ) )
{
setConfiguration( (Configuration)args[0] );
return null;
}
if( INITIALIZE.equals( method ) )
{
try
{
createInstance();
}
catch( Exception e )
{
badstate = true;
throw e;
}
return null;
}
if( m_target == null )
throw new IllegalStateException( "You need to call initialize() first!"
);
return method.invoke( m_target, args );
}
protected void createInstance()
throws Exception
{
// select the longest constructor (argument-wise)
Constructor[] constructors = getTargetClass().getConstructors();
sortConstructors( constructors );
Constructor constructor = constructors[0];
// call it
m_target = constructor.newInstance( getArguments( constructor ) );
// for any lifecycle interfaces already implemented by the target
ContainerUtil.enableLogging( m_target, getLog() );
ContainerUtil.contextualize( m_target, getContext() );
ContainerUtil.service( m_target, getServiceManager() );
ContainerUtil.contextualize( m_target, getContext() );
ContainerUtil.configure( m_target, getConfiguration() );
ContainerUtil.initialize( m_target );
initialized = true;
}
protected Object[] getArguments( Constructor c )
throws Exception
{
Class[] paramTypes = c.getParameterTypes();
List args = new ArrayList();
for( int i = 0; i < paramTypes.length; i++ )
{
if( paramTypes[i].isAssignableFrom( Logger.class ) )
{
args.add( i, getLog() );
break;
}
if( paramTypes[i].isAssignableFrom( Context.class ) )
{
args.add( i, getContext() );
break;
}
if( paramTypes[i].isAssignableFrom( Configuration.class ) )
{
args.add( i, getConfiguration() );
break;
}
if( paramTypes[i].isAssignableFrom( ServiceManager.class ) )
{
args.add( i, getServiceManager() );
break;
}
if( getServiceManager().hasService( getRole( paramTypes[i] ) ) )
{
Object comp = getServiceManager().lookup( paramTypes[i].getName() );
args.add( i, comp );
break;
}
Object comp = null;
String role = getRole( paramTypes[i] );
try
{
comp = getContext().get( role );
}
catch( ContextException ce )
{
// that's okay
}
if( comp != null )
{
args.add( i, comp );
break;
}
throw new ServiceException( paramTypes[i].getName(), "Missing
dependency!" );
}
return args.toArray();
}
protected String getRole( Class clazz )
{
try
{
Field field = clazz.getField( "ROLE" );
int mods = field.getModifiers();
if( Modifier.isPublic( mods ) &&
Modifier.isStatic( mods ) &&
Modifier.isFinal( mods ) )
return field.get( null ).toString();
else
return clazz.getName();
}
catch( NoSuchFieldException nsfe )
{
return clazz.getName();
}
catch( IllegalAccessException iae )
{
return clazz.getName();
}
}
/**
* Sort constructors in the order to be tried. This
* implementation sorts by whether a constructor is
* public, next by the number of arguments (descending).
*
* @return
*/
protected static void sortConstructors( Constructor[] constr )
{
Arrays.sort( constr, new Comparator()
{
public int compare( Object o1, Object o2 )
{
Constructor c1 = (Constructor) o1;
Constructor c2 = (Constructor) o2;
// compare accessibility
if( Modifier.isPublic( c1.getModifiers() ) )
{
if( Modifier.isPublic( c2.getModifiers() ) )
return -1; // more important
} else if( Modifier.isPublic( c2.getModifiers() ) )
{
return 1; // more important
}
// both accessible, compare length
int a1 = c1.getParameterTypes().length;
int a2 = c2.getParameterTypes().length;
if( a1 > a2 )
return -1; // more important
if( a1 == a2 )
return 0;
return 1;
}
}
);
}
}
1.1
avalon-sandbox/magic/impl/src/test/org/apache/avalon/magic/test/impl/AssertionLogger.java
Index: AssertionLogger.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.avalon.magic.test.impl;
import org.apache.avalon.framework.logger.Logger;
/**
*
*
* @author <a href="mail at leosimons dot com">Leo Simons</a>
* @version $Id: AssertionLogger.java,v 1.1 2003/08/16 15:43:53 leosimons Exp $
*/
public class AssertionLogger implements Logger
{
boolean infoCalled = false;
private Avalon2PicoAdapterTestCase m_avalon2PicoAdapterTestCase;
public AssertionLogger( Avalon2PicoAdapterTestCase avalon2PicoAdapterTestCase )
{
m_avalon2PicoAdapterTestCase = avalon2PicoAdapterTestCase;
}
public boolean isInfoCalled()
{
return infoCalled;
}
public void debug( String message )
{
}
public void debug( String message, Throwable throwable )
{
}
public boolean isDebugEnabled()
{
return true;
}
public void info( String message )
{
infoCalled = true;
}
public void info( String message, Throwable throwable )
{
infoCalled = true;
}
public boolean isInfoEnabled()
{
return true;
}
public void warn( String message )
{
}
public void warn( String message, Throwable throwable )
{
}
public boolean isWarnEnabled()
{
return true;
}
public void error( String message )
{
}
public void error( String message, Throwable throwable )
{
}
public boolean isErrorEnabled()
{
return true;
}
public void fatalError( String message )
{
}
public void fatalError( String message, Throwable throwable )
{
}
public boolean isFatalErrorEnabled()
{
return true;
}
public Logger getChildLogger( String name )
{
return this;
}
}
1.1
avalon-sandbox/magic/impl/src/test/org/apache/avalon/magic/test/impl/Avalon2PicoAdapterTestCase.java
Index: Avalon2PicoAdapterTestCase.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.avalon.magic.test.impl;
import org.apache.avalon.framework.logger.Logger;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.avalon.framework.context.DefaultContext;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
import org.apache.avalon.framework.service.DefaultServiceManager;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.magic.impl.Avalon2PicoAdapter;
import junit.framework.TestCase;
/**
*
*
* @author <a href="mail at leosimons dot com">Leo Simons</a>
* @version $Id: Avalon2PicoAdapterTestCase.java,v 1.1 2003/08/16 15:43:53 leosimons
Exp $
*/
public class Avalon2PicoAdapterTestCase extends TestCase
{
public void testLogEnabledPicoComponent() throws Exception
{
AssertionLogger logger = new AssertionLogger( this );
Tweety tweety = (Tweety)Avalon2PicoAdapter.getProxy( TweetyImpl.class );
ContainerUtil.enableLogging( tweety, logger );
ContainerUtil.contextualize( tweety, new DefaultContext() );
ContainerUtil.service( tweety, new DefaultServiceManager() );
ContainerUtil.configure( tweety, new DefaultConfiguration( "blah" ) );
ContainerUtil.parameterize( tweety, new Parameters() );
ContainerUtil.initialize( tweety );
ContainerUtil.start( tweety );
tweety.chilp();
assertTrue( "The Logger was not properly passed to the proxied pico-style
component", logger.isInfoCalled() );
}
}
1.1
avalon-sandbox/magic/impl/src/test/org/apache/avalon/magic/test/impl/Tweety.java
Index: Tweety.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.avalon.magic.test.impl;
/**
*
*
* @author <a href="mail at leosimons dot com">Leo Simons</a>
* @version $Id: Tweety.java,v 1.1 2003/08/16 15:43:53 leosimons Exp $
*/
public interface Tweety
{
public void chilp();
}
1.1
avalon-sandbox/magic/impl/src/test/org/apache/avalon/magic/test/impl/TweetyImpl.java
Index: TweetyImpl.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.avalon.magic.test.impl;
import org.apache.avalon.framework.logger.Logger;
/**
*
*
* @author <a href="mail at leosimons dot com">Leo Simons</a>
* @version $Id: TweetyImpl.java,v 1.1 2003/08/16 15:43:53 leosimons Exp $
*/
public class TweetyImpl implements Tweety
{
Logger m_logger;
public TweetyImpl( Logger logger )
{
m_logger = logger;
}
public void chilp()
{
m_logger.info( "chilp!" );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]