avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Tagunov <atagu...@mail.cnt.ru>
Subject Re: Component not visible from class loader
Date Mon, 07 Jul 2003 08:18:18 GMT
Hello Hugo!

HB> I have written an Avalon component following the white paper
HB> "Developing with Apache Avalon".
An excellent book indeed :-)

HB> java.lang.IllegalArgumentException: interface
HB> org.apache.avalon.framework.component.Component is not visible from class
HB> loader
HB>         at java.lang.reflect.Proxy.getProxyClass(Proxy.java:331)

HB> The problem occurs only when I try to do this (create the container) from my
HB> junit test class started from java main.

My guess is that you're using the graphical JUnit launcher.
Probably I can not help you with that as I have never used it myself
(as you guess its some classloader issue, and probably needs more

But, if instead you create an Ant task, like I do

    <target name="test" depends="..."
            description="run tests">
        <junit printsummary="off">
            <formatter type="plain" usefile="false"/>
            <formatter type="xml"/> <!--*-->
                <pathelement path="${java.api.compiled}"/>
                <pathelement path="${java.impl.compiled}"/>
                <pathelement path="${java.test.compiled}"/>
                <path refid="runtimecp"/>
            <batchtest todir="${test.reports.dir}">
                <fileset dir="${java.test.prepr}">
                    <include name="**/test/*TestCase.java"/>
                    <exclude name="**/Abstract*"/>
                    <exclude name="**/UpdateableBoxTestCase*"/>
you're going to be okay. The line marked with <!--*-->
may be removed if you do not want test reports be put into xml
files to ${test.reports.dir}

    ant test

and only want the results to be printed to your console as you do.
Of course the todir attribute can also be removed in that case.

I agree that using the junit task in Ant 1.5.1 is somewhat tricky,
that's why I'm sending you the Ant task that does use it successfully.

In particular it looks to me that the printsummary attribute on
junit task does not work, so instead of setting it to 'true'
we use a plain-text formatter with usefile="false".

WBR, Anton

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

View raw message