felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre Henry Perret <phper...@gmail.com>
Subject Re: Test plugin
Date Sun, 13 Feb 2011 11:28:21 GMT
Hi Clement,

It is what is done in my code but when I debug I see that the
IPJOHelper.getContext method returns null.

Thanks
--
Pierre




2011/2/13 Clement Escoffier <clement.escoffier@gmail.com>

> Hi,
>
> 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:
> helper.dispose();
>
> The disposal deletes all the instances created using the helper, release
> services...
>
> Regards,
>
> Clement
>
>
> 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>
> ><plugin>
> ><groupId>org.apache.felix</groupId>
> ><artifactId>maven-junit4osgi-plugin</artifactId>
> ><executions>
> ><execution>
> ><goals>
> ><goal>test</goal>
> ></goals>
> ><configuration>
> ><deployprojectartifact>false</deployprojectartifact>
> ></configuration>
> ></execution>
> ></executions>
> ></plugin>
> >____________________________________________________
> >
> >Test reports that the iPOJO helper m_context is null ...?!
> >
> >I think I havent configured well the test...
> >
> >--
> >Pierre
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message