I know that about annotations, I already solved it in my tests (it is not a
problem anymore), but I need some classes of junit 4.8.
I can try your advice, I only need to be sure that if I update the junit
dependency it wont break anything from junit4osgi. Let me check if I caught
the idea... for updating the junit dependency I only need to change the junit
version in felix command pom.xml:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
I noticed that I already changed that version but in junit4osgi jar.
Then the question is... is there a problem if I change everything to
junit-4.8.1 or what would be the alternative? adapting to 3.8.1? (this last
option will be more difficult for me, trying to find workarounds for missing
classes in junit-3.8.1
Thank you very very much! this is important for me!
On Sep 9, 2010, at 7:11 PM, Clement Escoffier wrote:
> Hi,
>
> junit4osgi embeds junit. So, you can't use a different version. But you can
> easily modify the junit4osgi bundle to expose the missing package / update
> the junit dependency. However, the launcher does not support annotations, so,
> you must use the junit 3 development model.
>
> Regards,
>
> Clement
>
>
> On 09.09.2010, at 18:01, Anna Karina Nava Soriano wrote:
>
>> thanks Richard!!!!
>>
>> Now in the junit-4.8.1.jar MANIFEST I included all the missing packages and
>> the result is:
>> Manifest-Version: 1.0
>> Ant-Version: Apache Ant 1.7.1
>> Export-Package: org.junit.runner.notification,org.junit,
>> org.junit.runner.manipulation,org.junit.runner
>> Created-By: 1.5.0_20-141 (Apple Inc.)
>>
>> Now everithing is able to be installed and started:
>> [ 404] [Active ] [ 1] Apache Felix iPOJO Extender Pattern Handler
>> (1.4.0)
>> [ 405] [Active ] [ 1] Apache Felix iPOJO OSGi Junit Runner - Felix
>> Command (1.0.0)
>> [ 408] [Active ] [ 1]
>> file:/Applications/NetBeans/sges-v3/glassfish/modules/junit-4.8.1.jar
>> [ 409] [Active ] [ 1] Apache Felix iPOJO OSGi Junit Runner - Swing
>> Gui (1.0.0)
>> [ 410] [Active ] [ 1] Apache Felix iPOJO OSGi Junit Runner
>> (1.1.0.SNAPSHOT)
>> [ 412] [Active ] [ 1] Apache Felix iPOJO (1.6.4)
>> [ 428] [Active ] [ 1] Broker Project Services TESTS (1.3)
>>
>> but even having the Felix Command bundle installed and active. I got no
>> junit command :( and previously I was. In fact if I type help
>> -> help
>> bundlelevel
>> cd
>> find
>> headers
>> help
>> inspect
>> install
>> log
>> ps
>> refresh
>> resolve
>> scr
>> shutdown
>> start
>> startlevel
>> stop
>> sysprop
>> uninstall
>> update
>> version
>>
>> see? no junit command :( I haven't changed that bundle at all. I don't know
>> what is happening here. I tried uninstall everything from 404 and
>> reinstalling it but having the same result. May be it is there is a problem
>> if some part of the unit test packages are being exported by junit4osgi and
>> other by the junit library? I don't know how to make junit4osgi treat this
>> packages the same way since its manifest is automatically built when I
>> compile the junit4osgi project
>>
>> Thanks for your supor!
>>
>>
>>
>>
>>
>> On Sep 9, 2010, at 3:34 PM, Richard S. Hall wrote:
>>
>>> On 9/9/10 6:28, Anna Karina Nava Soriano wrote:
>>>> Hello everyone!
>>>>
>>>> Nice tool junit4osgi!
>>>>
>>>> I am working with junit4osgi and needed to extend the JunitExtender class
>>>> to run tests in a particular way (the reason is not important).
>>>> MyJunitExtender is the new class and it extends JunitExtender and only
>>>> overrides the run method. I tested it and this was working fine!
>>>> (obviously I changed metadata.xml to tell the new MyJunitExtender class)
>>>> so far so good.
>>>>
>>>> The thing is that I need now org.junit.internal.JUnitSystem. So in
>>>> MyJunitExtender I added "import org.junit.internal.JUnitSystem;" then I
>>>> compile the project again, and the import-Package in my new MANIFEST looks
>>>> like this:
>>>> ....
>>>> Import-Package: org.apache.felix.ipojo.junit4osgi.helpers, org.junit.i
>>>> nternal, junit.runner, org.apache.felix.ipojo;version=1.6, org.junit.
>>>> runner.notification, javax.xml.parsers, org.osgi.service.packageadmin
>>>> ;version=1.1, org.w3c.dom, junit.textui, org.apache.felix.ipojo.parse
>>>> r;version=1.6, org.junit, junit.extensions, org.junit.runner.manipula
>>>> tion, org.osgi.service.log;version=1.2, junit.framework, org.apache.f
>>>> elix.ipojo.junit4osgi, org.apache.felix.ipojo.architecture;version=1.
>>>> 6, org.junit.runner, org.osgi.framework;version=1.2, org.osgi.service
>>>> .cm;version=1.1, org.apache.felix.ipojo.metadata
>>>> ....
>>>>
>>>> as you can see, the org.junit.internal is there. I install this new jar
>>>> in my Felix (see the last line)
>>>> ....
>>>> [ 320] [Active ] [ 1]
>>>> file:/Applications/NetBeans/sges-v3/glassfish/modules/junit-4.8.1.jar
>>>> [ 326] [Active ] [ 1] Apache Felix iPOJO Extender Pattern Handler
>>>> (1.4.0)
>>>> [ 327] [Installed ] [ 1] Apache Felix iPOJO OSGi Junit Runner - Felix
>>>> Command (1.0.0)
>>>> [ 330] [Installed ] [ 1] Apache Felix iPOJO OSGi Junit Runner - Swing
>>>> Gui (1.0.0)
>>>> [ 332] [Active ] [ 1] Apache Felix iPOJO (1.6.4)
>>>> [ 339] [Installed ] [ 1] Broker Project Services TESTS (1.3)
>>>> [ 354] [Installed ] [ 1] Apache Felix iPOJO OSGi Junit Runner
>>>> (1.1.0.SNAPSHOT)
>>>>
>>>> and when I do "start 354" it keeps saying:
>>>> "org.osgi.framework.BundleException: Unresolved constraint in bundle
>>>> org.apache.felix.ipojo.junit4osgi [354]: package;
>>>> (package=org.junit.internal)"
>>>>
>>>> I know probably there is some stupid thing that I am missing. My junit
>>>> file (you can see it with the id "320") has this manifest:
>>>> "Manifest-Version: 1.0
>>>> Ant-Version: Apache Ant 1.7.1
>>>> Created-By: 1.5.0_20-141 (Apple Inc.)"
>>>
>>> If that's all it has, then it is not a bundle. It needs to, at least,
>>> export its packages.
>>>
>>> -> richard
>>>
>>>> So... does somebody knows what am I doing wrong? I am new in the
>>>> junit4osgi world and I always get kind of lost with all dependencies.
>>>>
>>>> Thank you so much in advance!
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]