Hi David,

Sorry for the slow response. Read some answers/questions inline.

On Thu, Feb 23, 2012 at 2:00 AM, David Jencks <david_jen...@yahoo.com> wrote:
> I've been trying to write a new integration test for felix scr using pax-exam 
> 2.4.0.RC1 and I'm having some problems.  I'm using
>      <artifactId>pax-exam-container-forked</artifactId>
>
>      <groupId>org.eclipse</groupId>
>      <artifactId>osgi</artifactId>
>      <version>3.7.1.R37x_v20110808-1106</version>
>
>
>
> 1. I haven't been able to get the junit @Before and @After annotations to 
> work. They are in my test class's superclass, but the @inject and 
> @Configuration annotations all work in the superclass.

Solved already, i guess..?

>
> 2.  I'm running the test using equinox and equinox appears to be starting its 
> internal log service, and felix ds (that I'm trying to test) is using that 
> one rather than pax-logging.  Any idea how to get ds to use pax-logging 
> instead of equinox's log service?

Can you give details about your configuration ? I doubt exam is
picking equinox logging by itself..

>
> 3.  I have to stop the framework in my test to demonstrate the behavior I'm 
> interested in.  This seems to cause the test to fail when pax-exam tries to 
> stop the framework.  I get a stack trace like:
>
>    <error message="BundleContext is no longer valid" 
> type="java.lang.IllegalStateException">java.lang.IllegalStateException: 
> BundleContext is no longer valid
>        at 
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.checkValid(BundleContextImpl.java:931)
>        at 
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.ungetService(BundleContextImpl.java:634)
>        at 
> org.osgi.util.tracker.ServiceTracker.removedService(ServiceTracker.java:495)
>        at 
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1006)
>        at 
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1)
>        at 
> org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:352)
>        at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:412)
>        at 
> org.eclipse.osgi.framework.internal.core.ConsoleManager.stopConsole(ConsoleManager.java:209)
>        at 
> org.eclipse.osgi.framework.internal.core.EquinoxLauncher.stop(EquinoxLauncher.java:284)
>        at org.eclipse.osgi.launch.Equinox.stop(Equinox.java:266)
>        at 
> org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.stop(RemoteFrameworkImpl.java:91)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
>        at sun.rmi.transport.Transport$1.run(Transport.java:159)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>        at 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>        at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>        at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:680)
>        at 
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
>        at 
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
>        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
>        at 
> java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
>        at 
> java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
>        at $Proxy12.stop(Unknown Source)
>        at 
> org.ops4j.pax.exam.forked.ForkedTestContainer.stop(ForkedTestContainer.java:179)
>        at 
> org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:77)
>        at 
> org.ops4j.pax.exam.junit.JUnit4TestRunner$3.evaluate(JUnit4TestRunner.java:304)
>        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>        at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
>        at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>        at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
>        at 
> org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:93)
>        at 
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
>        at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
>        at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at 
> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
>        at $Proxy0.invoke(Unknown Source)
>        at 
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
>        at 
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
>        at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
>
> Is there any way to avoid this error such as by having pax-exam check if the 
> framework is already stopped before trying to stop it?

I will have a look at forked container, which you are using
appealingly. Please add a Jira ticket including configuration
information (how to reproduce).



>
> Many thanks for any hints!!

>
> david jencks
>
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general



-- 
Toni Menzel Source

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to