You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Andreas Pieber <an...@gmail.com> on 2011/10/07 18:00:54 UTC

Release PaxExam Karaf Testframework 0.2.0

Hey Guys,

I've finished the second feature release of the Pax Exam Karaf Testframework
today and it finally reached maven central. You might want to give it shot
if you need to do integration tests on Karaf base. It is as simple as adding
the following to your pom...

<dependency>
  <groupId>org.openengsb.labs.paxexam.karaf</groupId>
  <artifactId>paxexam-karaf-container</artifactId>
  <version>0.2.0</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.ops4j.pax.exam</groupId>
  <artifactId>pax-exam-junit4</artifactId>
  <version>2.3.0.M1</version>
  <scope>test</scope>
</dependency>


... reference your karaf based distribution ...

<dependency>
  <groupId>org.apache.karaf</groupId>
  <artifactId>apache-karaf</artifactId>
  <version>2.2.3</version>
  <type>zip</type>
  <scope>test</scope>
  <exclusions>
    <exclusion>
      <groupId>org.apache.karaf.shell</groupId>
      <artifactId>org.apache.karaf.shell.dev</artifactId>
    </exclusion>
  </exclusions>
</dependency>



... and the following configuration section ...

@Configuration
public Option[] config() {
    return new Option[]{ karafDistributionConfiguration().frameworkUrl(
      maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
};
}


... and your integration tests will run on the framework you've just
configured. The full documentation could be found here [1]. The changeset of
the new feature release could be found here [2]. Have fun and
don't hesitate to report any problems you encounter at this list or here
[3]. Btw, all sources are under Apache 2 License here [4] and will be
included in the karaf 3 release. It's just out of the ASF repos right now so
that it can be developed/released in faster cycles.

Kind regards,
Andreas

[1] https://github.com/openengsb/labs-paxexam-karaf/wiki
[2] https://github.com/openengsb/labs-paxexam-karaf/wiki/V0.2.0
[3] http://issues.openengsb.org/jira/browse/lab
[4] https://github.com/openengsb/labs-paxexam-karaf

RE: Release PaxExam Karaf Testframework 0.2.0

Posted by "Kuhtz, Andreas" <an...@atos.net>.
Hi Andreas,
 
Thank you!
 
Kind regards,
Andreas


________________________________

	From: Andreas Pieber [mailto:anpieber@gmail.com] 
	Sent: Montag, 17. Oktober 2011 13:54
	To: user@karaf.apache.org
	Subject: Re: Release PaxExam Karaf Testframework 0.2.0
	
	
	Hey Andreas, 

	I've just pushed paxexam-karaf 0.2.2 (goo.gl/FI9XP) to m2
central. Should be available there within the next hours. This release
also publishes the sources to the central repository. Your feature
requests will be included into a 0.3.0 release coming this week.
	
	
	Kind regards,
	Andreas
	
	
	On Fri, Oct 14, 2011 at 13:40, Andreas Pieber
<an...@gmail.com> wrote:
	

		Hey Andreas,
		
		
		On Fri, Oct 14, 2011 at 12:38, akuhtz
<an...@siemens.com> wrote: 

			Great work!!
			


		Good to hear that you like it! BTW, I've just pushed a
0.2.1 version fixing various bugs to m2 central (goo.gl/aQyb0). Should
be synced within the next hours.
		 

			I've started to use it and really like it.
			And I hit a problem: If I want to use the
standard distribution (as shown in
			the sample) and add a configuration file to etc/
the only way I found to do
			this is creating a custom ConfigurationPointer
and use
	
KarafDistributionOption.editConfigurationFilePut(...) for every line.
			
			Is there another solution to have a
preconfigured file copied from resources
			to etc folder? ... or maybe even a solution to
let the user add files to the
			unpacked karaf installation before karaf is
started? (e.g. adding
			event-admin to the system libraries to allow
adding it to
			startup.properties)
			
			Or do I have to provide a custom distribution?
			


		Right now there is no other option, but I'm with you
that there should be a better solution. I've created
http://issues.openengsb.org/jira/browse/LAB-76 for this problem. Still,
questions remaining aer: do you think about a replacement or rather an
batch operation (take all options from this file and "extend" them with
config file x; take all options from this file and "put" them into
config file x; this would be equivalent to the current options but with
an overload taking an file instead of an string option for the value).
Or do you rather want to replace the entire file?
		 

			Another thing would be support for TestNG :-)
I've seen that
			pax-exam-2.3.0.M1 has already support for TestNG
but I was not able to get
			it run with PaxExam Karaf because somewhere in
the route from the test to
			karaf is something with JUnitProbeInvoker and
this causes the TestNG test to
			fail.
			Have you done some testing with TestNG so far?
I'm completely new to
			pax-exam so if you have a pointer where to start
looking at this issue I
			might be able to help to find a solution.
			


		TBH I've never used TestNG with paxexam. I would have to
give it a more detailed look (about what is required). I'm not sure if
the test-ng implementation in paxexam is far enough to run in this
configuration. BUT if it is it would require an change in the
ExamFeaturesFile.java and KarafTestContainer.java. In addition I'm
afraid that we wont get the used testframework at the container.
Therefore we'll have to an additional property which allow the switching
between those two. Nevermind, if you want to give it a short try simply
replace the deps of junit in ExamFeaturesFile to testng and also change
the invoker line in KarafTestContainer
[systemProperty("pax.exam.invoker").value("junit"),] to the value of
testng. Maybe I've a chance to check this the next days... I've created
http://issues.openengsb.org/jira/browse/LAB-77 for this feature request.

		Kind regards,
		Andreas
		 

			
			--
			View this message in context:
http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-
2-0-tp3403220p3421267.html
			Sent from the Karaf - User mailing list archive
at Nabble.com.
			




Re: Release PaxExam Karaf Testframework 0.2.0

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

I've just pushed paxexam-karaf 0.2.2 (goo.gl/FI9XP) to m2 central. Should be
available there within the next hours. This release also publishes the
sources to the central repository. Your feature requests will be included
into a 0.3.0 release coming this week.

Kind regards,
Andreas

On Fri, Oct 14, 2011 at 13:40, Andreas Pieber <an...@gmail.com> wrote:

> Hey Andreas,
>
> On Fri, Oct 14, 2011 at 12:38, akuhtz <an...@siemens.com> wrote:
>>
>> Great work!!
>>
>
> Good to hear that you like it! BTW, I've just pushed a 0.2.1 version fixing
> various bugs to m2 central (goo.gl/aQyb0). Should be synced within the
> next hours.
>
>
>> I've started to use it and really like it.
>> And I hit a problem: If I want to use the standard distribution (as shown
>> in
>> the sample) and add a configuration file to etc/ the only way I found to
>> do
>> this is creating a custom ConfigurationPointer and use
>> KarafDistributionOption.editConfigurationFilePut(...) for every line.
>>
>> Is there another solution to have a preconfigured file copied from
>> resources
>> to etc folder? ... or maybe even a solution to let the user add files to
>> the
>> unpacked karaf installation before karaf is started? (e.g. adding
>> event-admin to the system libraries to allow adding it to
>> startup.properties)
>>
>> Or do I have to provide a custom distribution?
>>
>
> Right now there is no other option, but I'm with you that there should be a
> better solution. I've created
> http://issues.openengsb.org/jira/browse/LAB-76 for this problem. Still,
> questions remaining aer: do you think about a replacement or rather an batch
> operation (take all options from this file and "extend" them with config
> file x; take all options from this file and "put" them into config file x;
> this would be equivalent to the current options but with an overload taking
> an file instead of an string option for the value). Or do you rather want to
> replace the entire file?
>
>
>> Another thing would be support for TestNG :-) I've seen that
>> pax-exam-2.3.0.M1 has already support for TestNG but I was not able to get
>> it run with PaxExam Karaf because somewhere in the route from the test to
>> karaf is something with JUnitProbeInvoker and this causes the TestNG test
>> to
>> fail.
>> Have you done some testing with TestNG so far? I'm completely new to
>> pax-exam so if you have a pointer where to start looking at this issue I
>> might be able to help to find a solution.
>>
>
> TBH I've never used TestNG with paxexam. I would have to give it a more
> detailed look (about what is required). I'm not sure if the test-ng
> implementation in paxexam is far enough to run in this configuration. BUT if
> it is it would require an change in the ExamFeaturesFile.java and
> KarafTestContainer.java. In addition I'm afraid that we wont get the used
> testframework at the container. Therefore we'll have to an additional
> property which allow the switching between those two. Nevermind, if you want
> to give it a short try simply replace the deps of junit in ExamFeaturesFile
> to testng and also change the invoker line in KarafTestContainer
> [systemProperty("pax.exam.invoker").value("junit"),] to the value of testng.
> Maybe I've a chance to check this the next days... I've created
> http://issues.openengsb.org/jira/browse/LAB-77 for this feature request.
>
> Kind regards,
> Andreas
>
>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-2-0-tp3403220p3421267.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>

Re: Release PaxExam Karaf Testframework 0.2.0

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

On Fri, Oct 14, 2011 at 14:37, akuhtz <an...@siemens.com> wrote:

> Hi Andreas,
>
> My first intention was to add a new file (no replacement), but if we could
> add the options you list it would be more flexible.
>

Good; then I'll implement all three methods here (hopefull at the weekend).


> TestNG: I'll have a look on it ;-)
>

Good luck with that! Feel free to ping me if you need any help anywhere.

Kind regards,
Andreas


>
> Regards,
> Andi
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-2-0-tp3403220p3421526.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Release PaxExam Karaf Testframework 0.2.0

Posted by akuhtz <an...@siemens.com>.
Hi Andreas,

My first intention was to add a new file (no replacement), but if we could
add the options you list it would be more flexible.

TestNG: I'll have a look on it ;-)

Regards,
Andi 

--
View this message in context: http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-2-0-tp3403220p3421526.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Release PaxExam Karaf Testframework 0.2.0

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

On Fri, Oct 14, 2011 at 12:38, akuhtz <an...@siemens.com> wrote:
>
> Great work!!
>

Good to hear that you like it! BTW, I've just pushed a 0.2.1 version fixing
various bugs to m2 central (goo.gl/aQyb0). Should be synced within the next
hours.


> I've started to use it and really like it.
> And I hit a problem: If I want to use the standard distribution (as shown
> in
> the sample) and add a configuration file to etc/ the only way I found to do
> this is creating a custom ConfigurationPointer and use
> KarafDistributionOption.editConfigurationFilePut(...) for every line.
>
> Is there another solution to have a preconfigured file copied from
> resources
> to etc folder? ... or maybe even a solution to let the user add files to
> the
> unpacked karaf installation before karaf is started? (e.g. adding
> event-admin to the system libraries to allow adding it to
> startup.properties)
>
> Or do I have to provide a custom distribution?
>

Right now there is no other option, but I'm with you that there should be a
better solution. I've created
http://issues.openengsb.org/jira/browse/LAB-76 for
this problem. Still, questions remaining aer: do you think about a
replacement or rather an batch operation (take all options from this file
and "extend" them with config file x; take all options from this file and
"put" them into config file x; this would be equivalent to the current
options but with an overload taking an file instead of an string option for
the value). Or do you rather want to replace the entire file?


> Another thing would be support for TestNG :-) I've seen that
> pax-exam-2.3.0.M1 has already support for TestNG but I was not able to get
> it run with PaxExam Karaf because somewhere in the route from the test to
> karaf is something with JUnitProbeInvoker and this causes the TestNG test
> to
> fail.
> Have you done some testing with TestNG so far? I'm completely new to
> pax-exam so if you have a pointer where to start looking at this issue I
> might be able to help to find a solution.
>

TBH I've never used TestNG with paxexam. I would have to give it a more
detailed look (about what is required). I'm not sure if the test-ng
implementation in paxexam is far enough to run in this configuration. BUT if
it is it would require an change in the ExamFeaturesFile.java and
KarafTestContainer.java. In addition I'm afraid that we wont get the used
testframework at the container. Therefore we'll have to an additional
property which allow the switching between those two. Nevermind, if you want
to give it a short try simply replace the deps of junit in ExamFeaturesFile
to testng and also change the invoker line in KarafTestContainer
[systemProperty("pax.exam.invoker").value("junit"),] to the value of testng.
Maybe I've a chance to check this the next days... I've created
http://issues.openengsb.org/jira/browse/LAB-77 for this feature request.

Kind regards,
Andreas


>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-2-0-tp3403220p3421267.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Release PaxExam Karaf Testframework 0.2.0

Posted by akuhtz <an...@siemens.com>.
Hi, 

Great work!!

I've started to use it and really like it. 
And I hit a problem: If I want to use the standard distribution (as shown in
the sample) and add a configuration file to etc/ the only way I found to do
this is creating a custom ConfigurationPointer and use
KarafDistributionOption.editConfigurationFilePut(...) for every line. 

Is there another solution to have a preconfigured file copied from resources
to etc folder? ... or maybe even a solution to let the user add files to the
unpacked karaf installation before karaf is started? (e.g. adding
event-admin to the system libraries to allow adding it to
startup.properties)

Or do I have to provide a custom distribution?


Another thing would be support for TestNG :-) I've seen that
pax-exam-2.3.0.M1 has already support for TestNG but I was not able to get
it run with PaxExam Karaf because somewhere in the route from the test to
karaf is something with JUnitProbeInvoker and this causes the TestNG test to
fail.
Have you done some testing with TestNG so far? I'm completely new to
pax-exam so if you have a pointer where to start looking at this issue I
might be able to help to find a solution.

--
View this message in context: http://karaf.922171.n3.nabble.com/Release-PaxExam-Karaf-Testframework-0-2-0-tp3403220p3421267.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Release PaxExam Karaf Testframework 0.2.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Andreas,

once again (and as usual), really great work.

+1

Regards
JB

On 10/07/2011 06:00 PM, Andreas Pieber wrote:
> Hey Guys,
>
> I've finished the second feature release of the Pax Exam Karaf
> Testframework today and it finally reached maven central. You might want
> to give it shot if you need to do integration tests on Karaf base. It is
> as simple as adding the following to your pom...
>
> <dependency>
>    <groupId>org.openengsb.labs.paxexam.karaf</groupId>
>    <artifactId>paxexam-karaf-container</artifactId>
>    <version>0.2.0</version>
>    <scope>test</scope>
> </dependency>
> <dependency>
>    <groupId>org.ops4j.pax.exam</groupId>
>    <artifactId>pax-exam-junit4</artifactId>
>    <version>2.3.0.M1</version>
>    <scope>test</scope>
> </dependency>
>
>
> ... reference your karaf based distribution ...
>
> <dependency>
>    <groupId>org.apache.karaf</groupId>
>    <artifactId>apache-karaf</artifactId>
>    <version>2.2.3</version>
>    <type>zip</type>
>    <scope>test</scope>
>    <exclusions>
>      <exclusion>
>        <groupId>org.apache.karaf.shell</groupId>
>        <artifactId>org.apache.karaf.shell.dev</artifactId>
>      </exclusion>
>    </exclusions>
> </dependency>
>
>
>
> ... and the following configuration section ...
>
> @Configuration
> public Option[] config() {
>      return new Option[]{ karafDistributionConfiguration().frameworkUrl(
>        maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject()) };
> }
>
> ... and your integration tests will run on the framework you've just
> configured. The full documentation could be found here [1]. The
> changeset of the new feature release could be found here [2]. Have fun
> and don't hesitate to report any problems you encounter at this list or
> here [3]. Btw, all sources are under Apache 2 License here [4] and will
> be included in the karaf 3 release. It's just out of the ASF repos right
> now so that it can be developed/released in faster cycles.
>
> Kind regards,
> Andreas
>
> [1] https://github.com/openengsb/labs-paxexam-karaf/wiki
> [2] https://github.com/openengsb/labs-paxexam-karaf/wiki/V0.2.0
> [3] http://issues.openengsb.org/jira/browse/lab
> [4] https://github.com/openengsb/labs-paxexam-karaf
>

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