felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clement Escoffier <clement.escoff...@gmail.com>
Subject Re: Test plugin
Date Sun, 13 Feb 2011 09:29:14 GMT

You need to initialize the iPOJO Helper in the setUp method:
helper = new IPOJOHelper(this);

This is really important as it's how the helper get the bundle context.

Moreover, in the tearDown method it is recommended to dispose the helper:

The disposal deletes all the instances created using the helper, release



On 12.02.11 21:38, "Pierre Henry Perret" <phperret@gmail.com> wrote:

>Hi all,
>I have a junis4osgi test plugin running and that one returns a NPE when
>trying accessing the context.
>I have made as explained in the tutorial junit4osgi: created a plugin
>separate test alon with the bundle to test.
>my config is that one:
>       <plugin>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>maven-bundle-plugin</artifactId>
>        <extensions>true</extensions>
>        <configuration>
>          <instructions>
>            <Private-Package>services.osgi</Private-Package>
>            <Bundle-SymbolicName>
>              ${project.artifactId}
>            </Bundle-SymbolicName>
>            <Test-Suite>
>              services.osgi.StructuralInformationServicesTest
>            </Test-Suite>
>          </instructions>
>        </configuration>
>      </plugin>
>Test reports that the iPOJO helper m_context is null ...?!
>I think I havent configured well the test...

To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

View raw message