Open ops4j-issues opened 10 years ago
Lukas Roedl commented
Patched the ArchiveExtractor unpacking also the "base" directory.
The right Karaf directory is then found via the "searchKarafBase" method in the "KarafTestContainer".
Lukas Roedl commented
Any chance to get this issue resolved with the provided patch?
Harald Wellmann commented
I can't see anything unusual about Karaf's packaging layout, this is what most projects use. Pax Exam is supposed to work with official Karaf distributions out of the box, and we can't support all sorts of alternative formats.
Lukas Roedl commented
There is nothing unusual about Karaf's packaging format, but I have the following problem:
I create a custom Karaf distribution on top of a standard Karaf distro. So I unpack it, edit and add some files and repack it. When running iTests with resulting zip or tar file I get the before mentioned error.
I tried to look into your implementation and found out, that there is a method 'searchKarafBase' which should find the correct directory. But in the current configuration this method doesn't work and is some kind of useless because there is a problem when unpacking - which doesn't show up with the default Karaf distro.
So I really appreciate that this is fixed...
Harald Wellmann commented
Did you try changing your custom distro to this format?
apache-karaf-2.3.5-custom/bin
apache-karaf-2.3.5-custom/data
Lukas Roedl commented
Yes, I tried this and it worked.
But in my case (as I then unpack it once more and repack it to other formats) it would really help if this also would work as I wouldn't have to reconfigure a bunch of modules in my Maven project.
And in my understanding this is intended to work when I look at the current implementation. But correct me if I'm wrong...
Harald Wellmann commented
You've submitted a pull request without even running the regression tests, or else you would have noticed a broken test.
Rather than adapting your custom build to the standard layout, you seem to expect everyone to adapt to your layout or to assume that both layouts will work in all use cases.
You've preempted the project lead's decision to include a fix for this issue in a given release.
You should get a vote from the Karaf community on this and make all tests pass before going on with this.
Lukas Roedl commented
You are right that I forgot to enable the test while running the build - I’ll look into the itests and fix them as soon as possible. Furthermore I’ve to say that I didn’t want to preempt anyone’s decision: When raising a Jira, it asks for a version and so I filled it out. But as I've now read in the JIRA guide this is not the intended use of this property. You've my apologies.
Regarding the standard layout you can maybe point me in the right direction and tell me were the standard layout is described.
Anyway I’ll discuss this topic with the Karaf development team and come back to you.
Lukas Roedl created PAXEXAM-615
Following the manual at http://karaf.apache.org/manual/latest-2.3.x/developers-guide/writing-tests.html#KarafDistributionConfigurationOption I tried to write integration tests based on a custom Karaf distribution.
I used the following to configure the container:
When running the tests I get an "java.lang.RuntimeException: Problem starting container" error. When looking into the "target\exam\<random>\" folder (= UNPACK_DIRECTORY) there is really a mess:
What I expected was the default Karaf distribution layout:
Digging into the problem I found out that the eg. the apache-karaf-2.3.5.zip looks like:
Whereas the custom distribution I'm using looks like:
Note the different "base" directory in the two packages - "apache-karaf-2.3.5" in case of the Karaf 2.3.5 assembly.
It seems that the container assumes that every zip/tar.gz file given has this "base" directory structure and extracts only the contents of subfolders to the unpack directory.
I already saw the "searchKarafBase" function in the "KarafTestContainer" but that doesn't seem to work as the extraction of the underlying archive doesn't work as expected.
But I was able to fix it on my own modifying the "ArchiveExtractor".
Affects: 3.4.0, 3.5.0 Fixed in: unscheduled Attachments:
Votes: 1, Watches: 2