You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by le...@teliasonera.com on 2012/02/24 12:51:41 UTC

Problems with Karaf 2.2.5 integration tests

Hello all,

I have been trying for some time to get integration tests running properly in Karaf 2.2.5.
The test rig is copied from what little integration tests could be found on the net.

My problem is that I always receive an exception claiming that the executed command does not exist.
Is this a known problem?
Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that actually works without relying on Karaf 3.0.0 snapshot dependencies?

2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller             | eployer.kar.KarArtifactInstaller   71 | 15 - org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf Archive timestamps. Results may vary...
        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (2.2.5)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.

karaf@root> 2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.
2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.
2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.

Running command: bundle:list --help

org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: bundle:list
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)


--
// Bästa hälsningar,
// [sw. "Best regards,"]
//
// Lennart Jörelid, Systems Architect
// email: lennart.jorelid@teliasonera.com<ma...@teliasonera.com>
// cell: +46 708 507 603
// skype: jgurueurope


Re: Problems with Karaf 2.2.5 integration tests

Posted by Łukasz Dywicki <lu...@code-house.org>.
Hey Lennart,
You can take a look for cellar integration tests. They execute commands on test container.
https://github.com/apache/karaf-cellar/tree/trunk/itests

Current cellar trunk is tested with Karaf 2.2.5.

Best regards,
Lukasz Dywicki
--
Code-House
http://code-house.org

Wiadomość napisana przez <le...@teliasonera.com> <le...@teliasonera.com> w dniu 24 lut 2012, o godz. 12:51:

> Hello all,
> 
> I have been trying for some time to get integration tests running properly in Karaf 2.2.5.
> The test rig is copied from what little integration tests could be found on the net.
> 
> My problem is that I always receive an exception claiming that the executed command does not exist.
> Is this a known problem? 
> Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that actually works without relying on Karaf 3.0.0 snapshot dependencies?
> 
> 2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller             | eployer.kar.KarArtifactInstaller   71 | 15 - org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf Archive timestamps. Results may vary...
>         __ __                  ____      
>        / //_/____ __________ _/ __/      
>       / ,<  / __ `/ ___/ __ `/ /_        
>      / /| |/ /_/ / /  / /_/ / __/        
>     /_/ |_|\__,_/_/   \__,_/_/         
> 
>   Apache Karaf (2.2.5)
> 
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.
> 
> karaf@root> 2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.
> 2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.
> 2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 | 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a name. The name will be mandatory in the next Karaf version.
> 
> Running command: bundle:list --help
> 
> org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: bundle:list
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
> 	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
> 	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
> 
> 
> --
> // Bästa hälsningar, 
> // [sw. "Best regards,"]
> //
> // Lennart Jörelid, Systems Architect
> // email: lennart.jorelid@teliasonera.com
> // cell: +46 708 507 603
> // skype: jgurueurope
> 


Re: Problems with Karaf 2.2.5 integration tests

Posted by le...@teliasonera.com.
Hello Guillaume,

Gaah... You are quite correct.
What a silly error on my part.

Thanks!

24 feb 2012 kl. 15:24 skrev Guillaume Nodet:

The point is that in karaf 2.x, the command is named "osgi:list" and
not "bundle:list" which is only for 3.x

On Fri, Feb 24, 2012 at 12:51,  <le...@teliasonera.com>> wrote:
Hello all,

I have been trying for some time to get integration tests running properly
in Karaf 2.2.5.
The test rig is copied from what little integration tests could be found on
the net.

My problem is that I always receive an exception claiming that the executed
command does not exist.
Is this a known problem?
Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that
actually works without relying on Karaf 3.0.0 snapshot dependencies?

2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller
          | eployer.kar.KarArtifactInstaller   71 | 15 -
org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf
Archive timestamps. Results may vary...
        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (2.2.5)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.

karaf@root> 2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 |
FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 |
16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't
have a name. The name will be mandatory in the next Karaf version.
2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl
         | res.internal.FeaturesServiceImpl  214 | 16 -
org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
name. The name will be mandatory in the next Karaf version.
2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl
         | res.internal.FeaturesServiceImpl  214 | 16 -
org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
name. The name will be mandatory in the next Karaf version.

Running command: bundle:list --help

org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found:
bundle:list
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)


--
// Bästa hälsningar,
// [sw. "Best regards,"]
//
// Lennart Jörelid, Systems Architect
// email: lennart.jorelid@teliasonera.com<ma...@teliasonera.com>
// cell: +46 708 507 603
// skype: jgurueurope





--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

--
// Bästa hälsningar,
// [sw. "Best regards,"]
//
// Lennart Jörelid, Systems Architect
// email: lennart.jorelid@teliasonera.com<ma...@teliasonera.com>
// cell: +46 708 507 603
// skype: jgurueurope


Re: Problems with Karaf 2.2.5 integration tests

Posted by Andreas Pieber <an...@gmail.com>.
Hey Lennart,

Just to make sure: If I read the previous thread correctly you're
using labs-paxexam-karaf for your integration tests on karaf-2.x;
right?

On Tue, Feb 28, 2012 at 03:43,  <le...@teliasonera.com> wrote:
> </SKIP>
>
> It doesn't seem to matter if I provision the bundle holding the
> KarafIntegrationTest class, or if I add it to the bootDelegationPackage.

ok, the bootDelegationPackage thing will definitely not work because
the bundle is simply no where available in the karaf environment;
nevertheless the "provision the bundle holding the
KarafIntegrationTest class" should work. Can you pls post the snippet
of what you're doing?

> What is the pattern for doing this?

Basically you've two options here: either merge your sources into your
test package using maven or provision the bundle with the general
classes.

Kind regards,
Andreas

> I.e. extracting the main algorithms to another maven project, which is then
> imported into test scope of the actual integration test project.
>
> --
> // Bästa hälsningar,
> // [sw. "Best regards,"]
> //
> // Lennart Jörelid, Systems Architect
> // email: lennart.jorelid@teliasonera.com
> // cell: +46 708 507 603
> // skype: jgurueurope
>
>

Re: Problems with Karaf 2.2.5 integration tests

Posted by le...@teliasonera.com.
Hello all,

I'm trying to find the pattern for something presumably rather simple WRT integration testing in Karaf with Pax Exam, but I cannot seem to find a working example anywhere.

Basically I would like to factor out some integration test utilities to a separate Maven project, like so:
The class KarafITValidatorTest resides in test scope of project A, and KarafIntegrationTest resides in compile/artifact scope of project B.

@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FooTest extends KarafIntegrationTest {

I would have thought that the KarafIntegrationTest would be accessible from within the Pax Exam testcase, but I get a ClassNotFoundException instead:

Caused by: java.lang.ClassNotFoundException: some.package.KarafIntegrationTest not found by PAXEXAM-PROBE-0baa0bbc-bb52-4729-be3f-26ac76a8beaa [60]
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

It doesn't seem to matter if I provision the bundle holding the KarafIntegrationTest class, or if I add it to the bootDelegationPackage.

What is the pattern for doing this?
I.e. extracting the main algorithms to another maven project, which is then imported into test scope of the actual integration test project.

--
// Bästa hälsningar,
// [sw. "Best regards,"]
//
// Lennart Jörelid, Systems Architect
// email: lennart.jorelid@teliasonera.com<ma...@teliasonera.com>
// cell: +46 708 507 603
// skype: jgurueurope


Re: Problems with Karaf 2.2.5 integration tests

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes and no. osgi:list is the command, and bundle:list is an alias.

Unfortunately, aliases are not well supported.

Regards
JB

On 02/24/2012 03:24 PM, Guillaume Nodet wrote:
> The point is that in karaf 2.x, the command is named "osgi:list" and
> not "bundle:list" which is only for 3.x
>
> On Fri, Feb 24, 2012 at 12:51,<le...@teliasonera.com>  wrote:
>> Hello all,
>>
>> I have been trying for some time to get integration tests running properly
>> in Karaf 2.2.5.
>> The test rig is copied from what little integration tests could be found on
>> the net.
>>
>> My problem is that I always receive an exception claiming that the executed
>> command does not exist.
>> Is this a known problem?
>> Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that
>> actually works without relying on Karaf 3.0.0 snapshot dependencies?
>>
>> 2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller
>>            | eployer.kar.KarArtifactInstaller   71 | 15 -
>> org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf
>> Archive timestamps. Results may vary...
>>          __ __                  ____
>>         / //_/____ __________ _/ __/
>>        / ,<    / __ `/ ___/ __ `/ /_
>>       / /| |/ /_/ / /  / /_/ / __/
>>      /_/ |_|\__,_/_/   \__,_/_/
>>
>>    Apache Karaf (2.2.5)
>>
>> Hit '<tab>' for a list of available commands
>> and '[cmd] --help' for help on a specific command.
>> Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.
>>
>> karaf@root>  2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 |
>> FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 |
>> 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't
>> have a name. The name will be mandatory in the next Karaf version.
>> 2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl
>>           | res.internal.FeaturesServiceImpl  214 | 16 -
>> org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
>> name. The name will be mandatory in the next Karaf version.
>> 2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl
>>           | res.internal.FeaturesServiceImpl  214 | 16 -
>> org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
>> name. The name will be mandatory in the next Karaf version.
>>
>> Running command: bundle:list --help
>>
>> org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found:
>> bundle:list
>> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
>> at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
>> at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
>> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
>> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
>> at
>> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
>>
>>
>> --
>> // Bästa hälsningar,
>> // [sw. "Best regards,"]
>> //
>> // Lennart Jörelid, Systems Architect
>> // email: lennart.jorelid@teliasonera.com
>> // cell: +46 708 507 603
>> // skype: jgurueurope
>>
>>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problems with Karaf 2.2.5 integration tests

Posted by Guillaume Nodet <gn...@gmail.com>.
The point is that in karaf 2.x, the command is named "osgi:list" and
not "bundle:list" which is only for 3.x

On Fri, Feb 24, 2012 at 12:51,  <le...@teliasonera.com> wrote:
> Hello all,
>
> I have been trying for some time to get integration tests running properly
> in Karaf 2.2.5.
> The test rig is copied from what little integration tests could be found on
> the net.
>
> My problem is that I always receive an exception claiming that the executed
> command does not exist.
> Is this a known problem?
> Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that
> actually works without relying on Karaf 3.0.0 snapshot dependencies?
>
> 2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller
>           | eployer.kar.KarArtifactInstaller   71 | 15 -
> org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf
> Archive timestamps. Results may vary...
>         __ __                  ____
>        / //_/____ __________ _/ __/
>       / ,<  / __ `/ ___/ __ `/ /_
>      / /| |/ /_/ / /  / /_/ / __/
>     /_/ |_|\__,_/_/   \__,_/_/
>
>   Apache Karaf (2.2.5)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.
>
> karaf@root> 2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 |
> FeaturesServiceImpl              | res.internal.FeaturesServiceImpl  214 |
> 16 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't
> have a name. The name will be mandatory in the next Karaf version.
> 2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl
>          | res.internal.FeaturesServiceImpl  214 | 16 -
> org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
> name. The name will be mandatory in the next Karaf version.
> 2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl
>          | res.internal.FeaturesServiceImpl  214 | 16 -
> org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a
> name. The name will be mandatory in the next Karaf version.
>
> Running command: bundle:list --help
>
> org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found:
> bundle:list
> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
> at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
> at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
> at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
>
>
> --
> // Bästa hälsningar,
> // [sw. "Best regards,"]
> //
> // Lennart Jörelid, Systems Architect
> // email: lennart.jorelid@teliasonera.com
> // cell: +46 708 507 603
> // skype: jgurueurope
>
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com