ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Moquin <fragility...@gmail.com>
Subject Re: ACE client
Date Thu, 20 Jun 2013 12:28:35 GMT
Why not take a look at the karaf project documentation, it tells you how to
setup an integration test, it's really not hard at all and the
documentation is pretty accurate.  If you go to karaf.apache.org, under
developer guide documentation there is an integrarion test section, it does
a good job explaining things.

If you need any help, the guys on the karaf user list are always willing to
answer any questions and point to examples.

Ryan
On Jun 20, 2013 8:05 AM, "Marcel Offermans" <marcel.offermans@luminis.nl>
wrote:

> On Jun 20, 2013, at 11:42 AM, <Wilfried.Sibla@bosch-si.com> wrote:
>
> > But nevertheless, I will write a small bundle including the bndrun file
> and use the bundle start method to test something...
>
> That works. If you want a bit more flexibility, you can write a shell
> command, by making an Activator that does something like this:
>
> public class Activator extends DependencyActivatorBase {
>     @Override
>     public void init(BundleContext context, DependencyManager manager)
> throws Exception {
>       Properties props = new Properties();
>       props.put(CommandProcessor.COMMAND_SCOPE, "myscope");
>       props.put(CommandProcessor.COMMAND_FUNCTION, new String[] { "test",
> "two" });
>         manager.add(createComponent()
>             .setInterface(Object.class.getName(), props)
>             .setImplementation(Commands.class)
>         );
>     }
>
>     @Override
>     public void destroy(BundleContext context, DependencyManager manager)
> throws Exception {
>     }
> }
>
> and a Commands class with commands that do something like this:
>
> public class Commands {
>     public void test() {
>         System.out.println("test command executing");
>     }
>
>     public void two() throws Exception {
>         throw new RuntimeException("I throw an exception.");
>     }
> }
>
> Of course your commands should do something useful, and you might want to
> inject certain service dependencies into that class, but this is the idea.
> From the shell you can then simply type: "test" (or "myscope:test" if there
> exists more than one "test" command in different scopes).
>
> Greetings, Marcel
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message