Another approach to make sure your bundle started properly is to use
@Inject to inject any services that are started/exposed by your bundle.
Your @Test won't run until everything is injected properly:

https://ops4j1.jira.com/wiki/display/PAXEXAM4/Getting+Started+with+OSGi+Tests

On Wed, Mar 8, 2017 at 3:59 PM JT <[email protected]> wrote:

> Hi,
>
> I don't know if I am doing something wrong but when I use LogReaderService
> and get the logs using getLog(), the Enumeration is of size 100 and I don't
> find the expected message in there, even though I know it has been logged
> (by manually inspecting the logs). I also know the log is greater than 100
> entries in size and 100 does seem to convenient a size. Do I need some sort
> of additional configuration to the logging?  (I aleady set LogLevel to INFO
> in KarafDistributionconfiguration.
>
> Thanks, Kerry
>
> On 07/03/17 20:23, Jean-Baptiste Onofré wrote:
> > Hi Kerry,
> >
> > you can access the LogService LRU (as the log:display command does).
> >
> > Anyway, I would recommend to use bundle service to check the state
> instead of log.
> >
> > Regards
> > JB
> >
> > On 03/07/2017 09:13 PM, JT wrote:
> >> Hi,
> >>
> >> I'm just starting to use Pax exam with Karaf and I am writing a very
> >> simple test. All I want it to do is to examine the log files of Karaf to
> >> see if a specific bundle has successfully deployed. The bundle contains
> >> a native library and I load this using a Blueprint bean. If the library
> >> loads then a 'load successful' entry is written to the logs.
> >>
> >> Is there any easy way of examining the logs in the test?
> >>
> >> Thanks, Kerry
> >>
> >
>
>

Reply via email to