Hi,

On 08.05.2009, at 01:25, Jose Guerra wrote:

Hi,

First of all i like to say *hat off* to Apache for Felix and all
technologies applied to OSGi, and particulary iPOJO which i find
extremely powerful and useful framework.
So, my case, I am just messing around with iPOJOs and i am trying to
set up a basic test case using JUnit4OSGi on Felix. So, I created a
bundle with an OSGi test case within and i deployed the bundle on
Felix (Bundle ID# 15). I also got deployed the JUnit4OSGi example
(Bundle ID# 16) shipped with the framework.

ps
START LEVEL 1
  ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.6.1)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.2.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.2.0)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.0)
[   4] [Active     ] [    1] Apache Felix Log Service (1.0.0)
[ 5] [Active ] [ 1] Apache Felix Configuration Admin Service (1.0.10)
[   6] [Active     ] [    1] Logback_osgi Plug-in (1.0.0)
[   7] [Active     ] [    1] Apache Felix iPOJO (1.3.0.SNAPSHOT)
[ 8] [Active ] [ 1] Apache Felix iPOJO URL Handler (1.3.0.SNAPSHOT) [ 9] [Active ] [ 1] Apache Felix iPOJO Arch Command (1.3.0.SNAPSHOT)
[  10] [Active     ] [    1] Apache Felix iPOJO OSGi Junit Runner
(1.1.0.SNAPSHOT)
[  11] [Active     ] [    1] Apache Felix iPOJO Extender Pattern
Handler (1.3.0.SNAPSHOT)
[  12] [Active     ] [    1] Apache Felix iPOJO OSGi Junit Runner -
Felix Command (1.1.0.SNAPSHOT)
[  15] [Active     ] [    1] Test2 Plug-in (1.0.0)
[  16] [Active     ] [    1] Junit-OSGi-Example (0)
->

Ok, so far so good. Now when i try to execute the test case in my
bundle, Felix comes out with the output:

-> junit 15
-> No tests to execute

however, if i execute the example ...

-> junit 16
Executing [Hello Service Test Suite]
....
Time: 0

OK (4 tests)

->
it works!!.

As you will see below, the bundle contains a test case, but it seems
to me that for some reason it doesn't execute the test case. So, ps,
can anyone here try to explain me what i am doing wrong?

package osgitest;

import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

public class BarTest extends OSGiTestCase {

        public void testBar() {
                assertTrue(true);
        }
}

The bundle is deployed and started correctly

-> install file:bundle/mess/test_1.0.0.jar
Bundle ID: 15
-> 23:39:56.937 [Thread-0] INFO  test - BundleEvent INSTALLED

-> start 15
23:40:02.843 [Thread-0] INFO test - BundleEvent RESOLVED
23:40:02.843 [Thread-0] DEBUG org.apache.felix.ipojo - [DEBUG]
IPOJO-Extender : Creator thread is going to analyze the bundle 15 List
: [test [15]]
-> 23:40:02.843 [Thread-0] DEBUG org.apache.felix.ipojo - [DEBUG]
IPOJO-Extender : Creator thread is waiting - Nothing to do
23:40:02.843 [Thread-0] DEBUG org.apache.felix.ipojo - [DEBUG]
IPOJO-Extender : Creator thread is processing 15
23:40:02.843 [Thread-0] INFO  test - BundleEvent STARTED

I'd be glad if anyone here help me out on this!

As said by Filippo, you have to add a test suite or the test case in your manifest (bundle 15):
Test-Suite: osgitest.BarTest

junit4osgi detects tests by using an extender pattern. So, it looks in all the bundles if they contain the Test-Suite header.

Regards,

Clement






Cheers

---------------------------------------------------------------------
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]

Reply via email to