aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandros Karypidis <>
Subject Re: Running JUnit tests from within Eclipse
Date Wed, 18 Aug 2010 17:41:06 GMT
Thanks for taking the time to explain this. However, I am getting the 
error even though I have successfully completed an "mvn install" (which 
surely should have generated that file). For example, I just ran an "mvn 
test" in blueprint-itests:

C:\aries\trunk\blueprint\blueprint-itests>mvn test
[INFO] Scanning for projects...
[INFO] Building Apache Aries Blueprint iTests
[INFO]    task-segment: [test]
[INFO] [enforcer:enforce {execution: default}]
[INFO] [antrun:run {execution: create-prop}]
[INFO] Executing tasks
      [echo] Maven version: 0.3-incubating-SNAPSHOT
      [echo] OSGi version: 0.3.0.incubating-SNAPSHOT
[INFO] Executed tasks
[INFO] [properties:read-project-properties {execution: default}]
[INFO] Setting property: classpath.resource.loader.class => 
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] [paxexam:generate-depends-file {execution: generate-config}]
[INFO] Created: 
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
[INFO] skip non existing resourceDirectory 
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] skip non existing resourceDirectory 
[INFO] Copying 4 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: 

  T E S T S
Running org.apache.aries.blueprint.itests.TestRegistrationListener
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.258 sec
Running org.apache.aries.blueprint.itests.MultiBundleWithAsmTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.556 sec
Running org.apache.aries.blueprint.itests.BlueprintContainerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.834 sec
Running org.apache.aries.blueprint.itests.TestConfigAdmin
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.511 sec
Running org.apache.aries.blueprint.itests.BlueprintContainerBTCustomizerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.502 sec
Running org.apache.aries.blueprint.itests.BlueprintContainer2Test
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.122 sec
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.934 sec
Running org.apache.aries.blueprint.itests.MultiBundleWithCgLibTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.47 sec
Running org.apache.aries.blueprint.itests.TestReferences
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.333 sec

Results :

Tests run: 13, Failures: 0, Errors: 0, Skipped: 0

[INFO] Total time: 1 minute 9 seconds
[INFO] Finished at: Wed Aug 18 20:32:59 EEST 2010
[INFO] Final Memory: 28M/67M

Immediately afterwards (and without even launching Eclipse), I checked 
for the file, but it was not generated:

C:\aries\trunk\blueprint\blueprint-itests>dir target\classes\META-INF
  Volume in drive C has no label.
  Volume Serial Number is DEDC-167F

  Directory of 

18/08/2010  20:32 <DIR>          .
18/08/2010  20:32 <DIR>          ..
18/08/2010  20:31               572 DEPENDENCIES
18/08/2010  20:31               562 DISCLAIMER
18/08/2010  20:31            11.358 LICENSE
18/08/2010  20:31               186 NOTICE
                4 File(s)         12.678 bytes

On 18/8/2010 19:42, Bartosz Kowalewski wrote:
> Hi,
> As Lin said, Pax Exam tests are just ordinary JUnit tests and can be
> run from Eclipse w/o any additional tweaking. Unfortunately, there's
> one little catch that is introduced by Pax Exam configuration used in
> Aries itests projects. That is why you're observing this weird error.
> These tests need to download Maven artifacts. Versions of these
> artifacts are not specified inside the Pax Exam tests. It is so,
> because it's cleaner to keep those versions in a single location - in
> pom.xml (and not in both pom.xml and JUnit test). The issue is that
> Pax Exam tests do not have access to pom.xml. That is why, during a
> build of an itests project, a properties file with all details on
> artifacts that are dependencies of the itests project is being
> generated. This is done using ServiceMix's Mojo - depends-maven-plugin
> - or a similar Mojo from OPS4J Pax (I don't remember its name). The
> file is being added to target\classes\META-INF\maven\ and is named
> Conclusion: You need to run a Maven build to have this file generated.
> If it's present, you'll be able to run tests from Eclipse until this
> file is deleted (when running 'mvn clean' or by Eclipse itself). Oh,
> one more thing - this plugin should attached to the
> 'generate-resources' phase of a Maven lifecycle, so it should be
> enough to just run this Maven phase and then invoke tests from
> Eclipse.
> Thanks,
>    Bartek
> 2010/8/18 Lin Sun<>:
>> Hi,
>> Are you trying to run the itests from Eclipse or just the junit tests
>> from Eclipse?
>> I personally have never run the itests from Eclipse, but running junit
>> tests from Eclipse should be doable.
>> Lin
>> On Wed, Aug 18, 2010 at 11:38 AM, Alexandros Karypidis
>> <>  wrote:
>>> Hi,
>>> I'm trying to run the integration tests from within Eclipse. I've never used
>>> pax-exam before. As far as I can understand I need to configure pax-exam to
>>> create an OSGi container in order to deply the test bundle. What kind of
>>> launch configuration should I use in Eclispe to have the test run within an
>>> Equinox instance? My workspace has all Aries modules in it, imported from an
>>> "mvn eclipse:eclipse" after a successful build.
>>> Thanks,
>>> Alexander

View raw message