Re: ClassNotFoundException: com.vaadin.testbench.TestBenchTestCase not found by PAXEXAM-PROBE

2017-08-30 Thread laeubi.mobile via OPS4J
And even better: You can open issues for the libs that are not bundles an 
try to convince them to add bundle-manifest headers to their lib for better 
osgi integration :-)

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClassNotFoundException: com.vaadin.testbench.TestBenchTestCase not found by PAXEXAM-PROBE

2017-08-30 Thread laeubi.mobile via OPS4J
You use the wrapBundle() option, depending on your setup you have to add 
pax-url and pax-wrap to your bunlde-mix.

Am Freitag, 4. August 2017 06:17:47 UTC+2 schrieb reindheer:
>
> Hi,
>
> I am using Apache Karaf 4.0.8 for our backend and ui web applications, and 
> pax exam 4.10 for module testing. We have have written module tests using 
> pax exam for the backend applications.
>
> In UI application we use vaadin for ui and testbench for ui automation 
> testing. Now we want to integrate both so we could test the whole backend 
> and ui application. 
>
> So we are trying to run testbench using junits in pax exam.The testbench 
> uses selenium and other third party libs which are not bundles. Even 
> testbench is not a bundle. We have added all the third party libs as 
> dependencies to our project which only runs tests on pax exam. It compiles 
> but when run we get the following exception.
>
> java.lang.ClassNotFoundException: com.vaadin.testbench.TestBenchTestCase 
> not found by PAXEXAM-PROBE-19b79a7d-9de8-4bf9-bc34-0d3bdab631d6 [190]
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
> at 
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
> at 
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at 
> com.mymoduletest.uitest.LaunchWebApp.(LaunchWebApp.java:14)
>
> For this i tried adding all libraries required for testbench in a bundle( 
> exporting all packages) and added this to pax exam using maven() in pax 
> exam config method. Is this correct or we could do it in a better way?
>
> Thanks & Regards,
> Dheeraj
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClassNotFoundException: com.vaadin.testbench.TestBenchTestCase not found by PAXEXAM-PROBE

2017-08-30 Thread laeubi.mobile via OPS4J


Am Freitag, 4. August 2017 06:17:47 UTC+2 schrieb reindheer:
>
> Hi,
>
> I am using Apache Karaf 4.0.8 for our backend and ui web applications, and 
> pax exam 4.10 for module testing. We have have written module tests using 
> pax exam for the backend applications.
>
> In UI application we use vaadin for ui and testbench for ui automation 
> testing. Now we want to integrate both so we could test the whole backend 
> and ui application. 
>
> So we are trying to run testbench using junits in pax exam.The testbench 
> uses selenium and other third party libs which are not bundles. Even 
> testbench is not a bundle. We have added all the third party libs as 
> dependencies to our project which only runs tests on pax exam. It compiles 
> but when run we get the following exception.
>
> java.lang.ClassNotFoundException: com.vaadin.testbench.TestBenchTestCase 
> not found by PAXEXAM-PROBE-19b79a7d-9de8-4bf9-bc34-0d3bdab631d6 [190]
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
> at 
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
> at 
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at 
> com.mymoduletest.uitest.LaunchWebApp.(LaunchWebApp.java:14)
>
> For this i tried adding all libraries required for testbench in a bundle( 
> exporting all packages) and added this to pax exam using maven() in pax 
> exam config method. Is this correct or we could do it in a better way?
>
> Thanks & Regards,
> Dheeraj
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: gave up waiting for service org.ops4j.pax.exam.ProbeInvokerFactory

2017-08-30 Thread laeubi.mobile via OPS4J
Okay, I have created https://ops4j1.jira.com/browse/PAXEXAM-891 I'll try to 
take a look at it the nex days..
It seems the logic has already changed in PaxExam-5 for this, if you want 
you can try our latest snapshot build?


Am Mittwoch, 30. August 2017 12:36:04 UTC+2 schrieb Martin Lichtin:
>
> Thanks, but unfortunately that setting has no effect in this situation.
>
> Parser.createInvoker calls
>
> public static  T getService( BundleContext bc, Class type, 
> Map props )
> {
> return getService( bc, type, DEFAULT_TIMEOUT, props );
> }
>
> and that DEFAULT_TIMEOUT is set to 10 seconds.
>
> On Tuesday, August 29, 2017 at 3:42:01 PM UTC+2, laeubi...@googlemail.com 
> wrote:
>>
>> This can happen when your test-container is under stress e.g init several 
>> things after startup. You can define a system-property 
>> 'pax.exam.service.timeout' with a value of e.g. 3 to wait longer.  
>> using systemProperty() option.
>>
>> Am Sonntag, 27. August 2017 17:17:08 UTC+2 schrieb Martin Lichtin:
>>>
>>> Actually no, the @Injects are all ok, also they all have a 60s timeout 
>>> on it.
>>>
>>> From the stacktrace you can see it's hitting an pax-exam internal 10s 
>>> timeout.
>>>
>>> Parser.createInvoker calls ServiceLookup.getService(ctx, 
>>> org.ops4j.pax.exam.ProbeInvokerFactory.class)
>>> That getService method waits up to 10 seconds for the 
>>> "ProbeInvokerFactory" service.
>>>
>>> Would you understand what could cause a delay for that service to become 
>>> registered?
>>>
>>> - Martin
>>>
>>> On Saturday, August 26, 2017 at 8:15:49 AM UTC+2, Achim Nierbeck wrote:

 Hi, 

 is your test failing because an @Inject of your service fails?
 I think you can add a timeout to the @Inject, in case you have a rather 
 big setup where the service does take a bit longer to be available after 
 start. 

 regards, Achim

 2017-08-24 10:51 GMT+02:00 Martin Lichtin :

> Sometimes, not always, a Pax test fails with
>
> org.ops4j.pax.swissbox.tracker.ServiceLookupException: gave up waiting 
> for service org.ops4j.pax.exam.ProbeInvokerFactory
> at 
> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:161)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
> at 
> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:104)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
> at 
> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:87)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
> at 
> org.ops4j.pax.exam.raw.extender.intern.Parser.createInvoker(Parser.java:79)[296:org.ops4j.pax.exam.extender.service:4.11.0]
> at 
> org.ops4j.pax.exam.raw.extender.intern.Parser.make(Parser.java:68)[296:org.ops4j.pax.exam.extender.service:4.11.0]
> at 
> org.ops4j.pax.exam.raw.extender.intern.Parser.(Parser.java:54)[296:org.ops4j.pax.exam.extender.service:4.11.0]
> at 
> org.ops4j.pax.exam.raw.extender.intern.TestBundleObserver.addingEntries(TestBundleObserver.java:69)[296:org.ops4j.pax.exam.extender.service:4.11.0]
> at 
> org.ops4j.pax.swissbox.extender.BundleWatcher$3.run(BundleWatcher.java:226)[301:org.ops4j.pax.swissbox.extender:1.8.2]
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_141]
> at 
> java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_141]
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_141]
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_141]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_141]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_141]
> at java.lang.Thread.run(Thread.java:748)[:1.8.0_141]
>
> Any ideas what could be wrong? In case it is a timing issue, which 
> timeout parameter would that be?
>
> - Martin
>
> -- 
> -- 
> --
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>
> --- 
> You received this message because you are subscribed to the Google 
> Groups "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to ops4j+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



 -- 

 Apache Member
 Apache Karaf  Committer & PMC
 OPS4J Pax Web  
 Committer & Project Lead
 blog 
 Co-Author of Apache Karaf Cookbook 

 Software 

Re: Pax exam. Proposal to allow catch Exception in checkstyle rules

2017-08-29 Thread laeubi.mobile via OPS4J
I think it is bad style to catch (checked) Exceptions and wrap them into 
Runtime just for "not having to catch them". If the API forbidds throwing 
cached exceptions there is of course o other way, but even there there a 
global "catch all exceptions" should be decided with care, it is almost 
always better to catch indivual types and rethrow with a sensible hint 
whats going wrong.

Beside that you can always disable checkstyle rules for a given code path.

Am Mittwoch, 23. August 2017 11:36:34 UTC+2 schrieb Christian Schneider:
>
> Currently the checkstyle rules forbid to catch Exception. 
>
> I propose to change this as catching Exception is sometimes very useful 
> when for example a called method throws Exception or we simply want to 
> map to RuntimeException to avoid having throws Exception in every caller. 
>
> Christian 
>
> -- 
> Christian Schneider 
> http://www.liquid-reality.de 
>
> Open Source Architect 
> http://www.talend.com 
>
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: gave up waiting for service org.ops4j.pax.exam.ProbeInvokerFactory

2017-08-29 Thread laeubi.mobile via OPS4J
This can happen when your test-container is under stress e.g init several 
things after startup. You can define a system-property 
'pax.exam.service.timeout' with a value of e.g. 3 to wait longer.  
using systemProperty() option.

Am Sonntag, 27. August 2017 17:17:08 UTC+2 schrieb Martin Lichtin:
>
> Actually no, the @Injects are all ok, also they all have a 60s timeout on 
> it.
>
> From the stacktrace you can see it's hitting an pax-exam internal 10s 
> timeout.
>
> Parser.createInvoker calls ServiceLookup.getService(ctx, 
> org.ops4j.pax.exam.ProbeInvokerFactory.class)
> That getService method waits up to 10 seconds for the 
> "ProbeInvokerFactory" service.
>
> Would you understand what could cause a delay for that service to become 
> registered?
>
> - Martin
>
> On Saturday, August 26, 2017 at 8:15:49 AM UTC+2, Achim Nierbeck wrote:
>>
>> Hi, 
>>
>> is your test failing because an @Inject of your service fails?
>> I think you can add a timeout to the @Inject, in case you have a rather 
>> big setup where the service does take a bit longer to be available after 
>> start. 
>>
>> regards, Achim
>>
>> 2017-08-24 10:51 GMT+02:00 Martin Lichtin :
>>
>>> Sometimes, not always, a Pax test fails with
>>>
>>> org.ops4j.pax.swissbox.tracker.ServiceLookupException: gave up waiting 
>>> for service org.ops4j.pax.exam.ProbeInvokerFactory
>>> at 
>>> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:161)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
>>> at 
>>> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:104)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
>>> at 
>>> org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:87)[304:org.ops4j.pax.swissbox.tracker:1.8.2]
>>> at 
>>> org.ops4j.pax.exam.raw.extender.intern.Parser.createInvoker(Parser.java:79)[296:org.ops4j.pax.exam.extender.service:4.11.0]
>>> at 
>>> org.ops4j.pax.exam.raw.extender.intern.Parser.make(Parser.java:68)[296:org.ops4j.pax.exam.extender.service:4.11.0]
>>> at 
>>> org.ops4j.pax.exam.raw.extender.intern.Parser.(Parser.java:54)[296:org.ops4j.pax.exam.extender.service:4.11.0]
>>> at 
>>> org.ops4j.pax.exam.raw.extender.intern.TestBundleObserver.addingEntries(TestBundleObserver.java:69)[296:org.ops4j.pax.exam.extender.service:4.11.0]
>>> at 
>>> org.ops4j.pax.swissbox.extender.BundleWatcher$3.run(BundleWatcher.java:226)[301:org.ops4j.pax.swissbox.extender:1.8.2]
>>> at 
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_141]
>>> at 
>>> java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_141]
>>> at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_141]
>>> at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_141]
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_141]
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_141]
>>> at java.lang.Thread.run(Thread.java:748)[:1.8.0_141]
>>>
>>> Any ideas what could be wrong? In case it is a timing issue, which 
>>> timeout parameter would that be?
>>>
>>> - Martin
>>>
>>> -- 
>>> -- 
>>> --
>>> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OPS4J" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ops4j+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>>
>> Apache Member
>> Apache Karaf  Committer & PMC
>> OPS4J Pax Web  Committer 
>> & Project Lead
>> blog 
>> Co-Author of Apache Karaf Cookbook 
>>
>> Software Architect / Project Manager / Scrum Master 
>>
>>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setup database structure before bundle under test is started with pax exam + karaf

2017-08-29 Thread laeubi.mobile via OPS4J
You should provide a little more info about your setup, e.g. "working" vs 
"not working" configs, how you run the camel bundle (bluprint? spring? 
Routebuilders?)

I assume you want to test the route itself not the pax-jdbc setup, then you 
should configure your datasource that way that it can either run from JNDI 
or or a local jdbc-url to make testing easier.
You can the provide a config for test and one for deployment that contains 
either jndi or plain jdbc with e.g. inmemory db of h2 (which can be 
configured to init the db from a file).

Am Donnerstag, 24. August 2017 09:36:05 UTC+2 schrieb 
karste...@hermes-ottoint.com:
>
> Hello everybody,
> i am running pax exam 4 with a karaf 3 container.
> The bundle under test is a camel 2.16.3 bundle.
> The bundle uses a time triggered camel jpa component and pax-jdbc with (XA 
> and pooling) to instantiate the datasource.
> For the test i need some table and some test data in a schema.
> If i run the test with an existing postgres database everything is fine. 
> If i try to instantiate and setup the database first (H2 or Derby) the 
> bundle under test does not 
> find the database with the jndi name:
> javax.naming.NameNotFoundException: osgi:service/javax.sql.DataSource/"(
> osgi.jndi.service.name=jdbc/scv_xa)"
>
> How can i startup and setup the temporary db before the bundle under test 
> is started?
>
> Thanks and best regards
> Karsten
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.