Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-10 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > Hi Steinar, > afaik Mockito does some real nasty things on the classpath with reflection > etc. > That'll hurt to have it running on Pax Exam. Yes, I figured that out. This is also what the bug https://ops4j1.jira.com/browse/PAXEXAM-274 says. > Mockito is

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-09 Thread 'Achim Nierbeck' via OPS4J
Hi Steinar, afaik Mockito does some real nasty things on the classpath with reflection etc. That'll hurt to have it running on Pax Exam. You have to differ. Mockito is great with unit tests and it's where it belongs. Pax Exam is the foundation for your integration tests, and there you usually don'

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-09 Thread Steinar Bang
> Steinar Bang : > The problem is similar to what was seen in this bug, 6 years ago > https://ops4j1.jira.com/browse/PAXEXAM-274 > But the bug was 6 years ago, and many versions of everything (OSGi, > pax-exam, mockito, Java) ago, so I'm not sure if the simiarlities are a > red herring...?

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-08 Thread Steinar Bang
> Steinar Bang : > Is there something else I can try? Looking closer at the error message: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "$javax.servlet.http.HttpServletRequest$$EnhancerByMockitoWithCGLIB$$22025fbe.newInstance

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-08 Thread Steinar Bang
> Steinar Bang : > Steinar Bang : >> This worked fine in getting karaf to start and the service to be >> produced, but actually using mockito mocks failed: >> java.lang.LinkageError: loader constraint violation in interface itable >> initialization: when resolving method >> "$javax.servl

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
> Steinar Bang : > This worked fine in getting karaf to start and the service to be > produced, but actually using mockito mocks failed: > java.lang.LinkageError: loader constraint violation in interface itable > initialization: when resolving method > "$javax.servlet.http.HttpServletReques

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
> Steinar Bang : > Plan going forward: > 1. Create a feature file in the test project (ie. a real artifact and > not a test scope thing), using karaf-maven-plugin and the above > three bundles as compile dependencies of the test project > 2. Add the feature file to the pax-exam confi

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
> Steinar Bang : > Can anyone spot what I've missed in the copy/paste...? I think I did. > [1] > > [2] >

Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
Karaf 4.1.2 Pax-exam 4.11.0 Java 1.8 Windows 10 I'm trying to copy-paste stuff from a working pax-exam karaf test[1], but the copy-pasted test[2] fails in startup, because it can't find the BundleContext{3]. Stack trace of the failing unit test is[4]. I have tried commenting out my own stuff in