Discussion:
Minerva UI Tests and miscellaneous issues
(too old to reply)
Thomas Holland
2011-06-19 17:24:19 UTC
Permalink
Hi,

hope this is the right place for some Minerva issues as I haven't found
any Minerva-specific lists.

I am currently 'minerva-fying' my little Eclipse Plugin (
http://sourceforge.net/projects/avr-eclipse/ ) and the
"java.lang.RuntimeException: Bundle org.aniszczyk.minerva.tests.ui is
not found" issue had me pulling out my hair for almost two days until I
found the culprit:

In the file org.aniszczyk.minerva.tests.ui/META-INF/MANIFEST.MF in the
line

Fragment-Host: org.aniszczyk.minerva.tests.core;bundle-version="1.0.0.qualifier"

the ".qualifier" ending was causing the fail. Removing ".qualifier" and
the UI Tests works, almost, as now SWTBot was barfing due to no tests to
run.
Adding an empty test method

@Test
public void someTest() {
// Do nothing (for now)
}

to
org.aniszczyk.minerva.tests.ui/src/org/aniszczyk/minerva/tests/ui/SimpleUITestCase.javafixed
that and my Minerva build was finally successful.

Now log4j still complaints that the log4j system is not properly
initialized but that does not break the build. AFAIK log4j wants to have
a log4j.xml or log4j.properties file in the classpath, but I have not
looked into this yet.

BTW is there any particular advantage in making the tests.ui project a
fragment of the tests.core plugin?


Some other issues with Minerva that I found:

1. Minerva currently uses a no longer existing Snapshot repository of
the Orbit site in the parent pom.xml:
<orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/S20110124210048/repository</orbit-site>

this should be replaced by the current Orbit release repository
<orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository/</orbit-site>

2. In the UI tests pom.xml: The site referenced in the line
<local-p2-site>file:/${basedir}/../org.aniszczyk.minerva-updatesite/target/site</local-p2-site>
does not exist, because a) "org.aniszczyk-updatesite" is actually named
"org.aniszczyk.minerva-repository/" in the filesystem and b) as it is a
repository and not an update-site it should end with
.../target/repository and not .../target/site.
I am not sure if the whole thing is needed at all, as Minerva builds
fine without it.

Anyway the "org.aniszczyk.minerva-updatesite" project should be renamed
to "org.aniszczyk.minerva-repository" in eclipse to reflect the real
pathname and the real content.

3. A general suggestion for Minerva: I think it would be more
Eclipse-friendly to move the parent pom.xml from the root directory to
its own Eclipse project, like "org.aniszczyk.minerva-parent", because as
it is now the file is not shown in Eclipse when doing an "Import
Projects" from the Minerva git repository.
This would, of course, require a

<relativePath>../org.aniszczyk.minerva-parent/pom.xml</relativePath>

entry in all sub pom.xml files.

4. Coming back to the UI tests project. I think in the manifest.mf all
Import-Package and probably all Required-Bundle entries can be replaced
by the org.eclipse.swtbot.go bundle.

Also there is some stuff in the UI tests pom.xml that seems to be a
leftover from from whichever Project Minerva was extracted from (EGit?),
like a dependecy on org.eclipse.cvs.feature.group. (Are all the
dependencies required anyway? Minerva builds fine without them. But then
again I am absolutely new to maven and tycho, still trying to wrap my
head around what's going on inside the build)

5. Many more questions and suggestions, but I think I'll stop here for
now :-)

BTW, what would be the best way to contribute code/fixes to Minerva at
the moment (while it is still at github)?


Thomas
Mykola Nikishov
2011-06-20 13:47:52 UTC
Permalink
Hi Thomas,
Post by Thomas Holland
I am currently 'minerva-fying' my little Eclipse Plugin (
http://sourceforge.net/projects/avr-eclipse/ ) and the
"java.lang.RuntimeException: Bundle org.aniszczyk.minerva.tests.ui is
not found" issue had me pulling out my hair for almost two days until I
I hope https://github.com/caniszczyk/minerva/pull/10 will save you
couple days next time ;-)
Post by Thomas Holland
BTW is there any particular advantage in making the tests.ui project a
fragment of the tests.core plugin?
Yes, 'Option 3: Place test code in a fragment' @
http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/
Post by Thomas Holland
3. A general suggestion for Minerva: I think it would be more
Eclipse-friendly to move the parent pom.xml from the root directory to
its own Eclipse project, like "org.aniszczyk.minerva-parent", because as
it is now the file is not shown in Eclipse when doing an "Import
Projects" from the Minerva git repository.
This would, of course, require a
<relativePath>../org.aniszczyk.minerva-parent/pom.xml</relativePath>
entry in all sub pom.xml files.
It makes sense.
Post by Thomas Holland
5. Many more questions and suggestions, but I think I'll stop here for
now :-)
It's Ok,
https://github.com/caniszczyk/minerva/issues/8#issuecomment-1099615 ;-)
Post by Thomas Holland
BTW, what would be the best way to contribute code/fixes to Minerva at
the moment (while it is still at github)?
I think it's Ok to fork it on github, push your changes to your private
repository and create a pull request.
--
Mykola
Thomas Holland
2011-06-20 23:13:38 UTC
Permalink
Hi Mykola,

thanks for the reply!
Post by Mykola Nikishov
I hope https://github.com/caniszczyk/minerva/pull/10 will save you
couple days next time ;-)
Well, I pulled your latest Minerva repo and the bug I mentioned is still
there. Building your Minerva fails with the same error:
java.lang.RuntimeException: Bundle org.aniszczyk.minerva.tests.ui is not
found.
Post by Mykola Nikishov
Post by Thomas Holland
BTW is there any particular advantage in making the tests.ui project a
fragment of the tests.core plugin?
http://www.modumind.com/2007/06/20/unit-testing-plug-ins-with-fragments/
Yes, I am familiar with that. But the tests.ui is a fragment to the
tests.core, which itself is a normal plugin. So basically the test.ui
has access to the non-public methods of test.core (but what for?) while
neither the tests.core nor the tests.ui has non-public access to the
plugins they are supposed to test.

For my own project I have the tests.core as a fragment to the core plugin.
And I just changed my tests.ui to a normal plugin (not fragment) because
a) so far my (very limiteded) SWTBot test don't need special access to
the classes they are testing and -- more important -- b) I can add a
log4j.xml to the tests.ui/src to stop log4j from complaining about not
properly being set up.


Thanks for the pointers to the github issues page for Minerva. Haven't
used github so far but I think I'll register and use it to contribute my
2¢ to Minerva (which I think is a great tool for all small Eclipse
plugin developers like me)

Thomas
Mykola Nikishov
2011-06-21 07:52:04 UTC
Permalink
Post by Thomas Holland
Post by Mykola Nikishov
I hope https://github.com/caniszczyk/minerva/pull/10 will save you
couple days next time ;-)
Well, I pulled your latest Minerva repo and the bug I mentioned is still
java.lang.RuntimeException: Bundle org.aniszczyk.minerva.tests.ui is not
found.
Sure, my pull request implements only an IT for Minerva's archetype and
no fixes for any problems you've mentioned. During 'mvn
integration-test' for archetype module, it will generate sample project
(actually, the Minerva itself) and try to build it. It will fail build
for Minerva archetype if this generated project fails. It's the only
goal of this change.

I haven't pushed fixes I already have. In my private repo generated
project fails to run org.aniszczyk.minerva.ui.tests.SimpleUITestCase:

Caused by: java.lang.IllegalStateException: Could not find a display
at org.eclipse.swtbot.swt.finder.utils.SWTUtils.display(SWTUtils.java:249)

It's the only remaining problem as far as I can see. I hope to fix it
today and push these changes.
Post by Thomas Holland
Thanks for the pointers to the github issues page for Minerva. Haven't
used github so far but I think I'll register and use it to contribute my
2¢ to Minerva (which I think is a great tool for all small Eclipse
plugin developers like me)
You're welcome, Thomas.
--
Mykola
Matthias Sohn
2011-06-21 11:41:51 UTC
Permalink
Post by Mykola Nikishov
Post by Thomas Holland
Post by Mykola Nikishov
I hope https://github.com/caniszczyk/minerva/pull/10 will save you
couple days next time ;-)
Well, I pulled your latest Minerva repo and the bug I mentioned is still
java.lang.RuntimeException: Bundle org.aniszczyk.minerva.tests.ui is not
found.
Sure, my pull request implements only an IT for Minerva's archetype and
no fixes for any problems you've mentioned. During 'mvn
integration-test' for archetype module, it will generate sample project
(actually, the Minerva itself) and try to build it. It will fail build
for Minerva archetype if this generated project fails. It's the only
goal of this change.
I haven't pushed fixes I already have. In my private repo generated
Caused by: java.lang.IllegalStateException: Could not find a display
at
org.eclipse.swtbot.swt.finder.utils.SWTUtils.display(SWTUtils.java:249)
It's the only remaining problem as far as I can see. I hope to fix it
today and push these changes.
in order to fix that you need to enable the Xvnc plugin and start a window
manager
before starting the ui tests.
--
Matthias
Mykola Nikishov
2011-06-21 13:21:50 UTC
Permalink
Post by Matthias Sohn
in order to fix that you need to enable the Xvnc plugin and start a
window manager before starting the ui tests.
Thank you, Matthias, but it's not the case. I'm building in xterm inside
my current X session and can start Eclipse IDE itself from it without
any problems. So there should be no problems related to headless builds.

Any thoughts?
--
Mykola
Mykola Nikishov
2011-06-21 15:15:19 UTC
Permalink
Post by Mykola Nikishov
Sure, my pull request implements only an IT for Minerva's archetype and
no fixes for any problems you've mentioned. During 'mvn
integration-test' for archetype module, it will generate sample project
(actually, the Minerva itself) and try to build it. It will fail build
for Minerva archetype if this generated project fails. It's the only
goal of this change.
I haven't pushed fixes I already have. In my private repo generated
Caused by: java.lang.IllegalStateException: Could not find a display
at org.eclipse.swtbot.swt.finder.utils.SWTUtils.display(SWTUtils.java:249)
It's the only remaining problem as far as I can see. I hope to fix it
today and push these changes.
I've sorted this out, UI test passes now,
https://github.com/caniszczyk/minerva/pull/10 updated with latest
changes and waiting for comments.
--
Mykola
Cristiano Gavião
2011-06-21 22:45:18 UTC
Permalink
Hi,

Nice archetype Mykola... ;-)

But I just found that there is some little issues.

In the __rootArtifactId__.core.tests/pom.xml, at <coverage> profile, you
still using old <groupId>org.sonatype.tycho</groupId> and
<artifactId>maven-osgi-test-plugin</artifactId>

in main pom.xml you need to explicitly use "helios" instead of
${platform-version-name}, just because swtbot doesn't have a repo for
indigo:

<swtbot-site>http://download.eclipse.org/technology/swtbot/${platform-version-name}/dev-build/update-site</swtbot-site>

and this orbit repo doesn't exist anymore:

<orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/S20110124210048/repository</orbit-site>

Now just exist this:
<orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository</orbit-site>


cheers

Cristiano
Post by Mykola Nikishov
Post by Mykola Nikishov
Sure, my pull request implements only an IT for Minerva's archetype and
no fixes for any problems you've mentioned. During 'mvn
integration-test' for archetype module, it will generate sample project
(actually, the Minerva itself) and try to build it. It will fail build
for Minerva archetype if this generated project fails. It's the only
goal of this change.
I haven't pushed fixes I already have. In my private repo generated
Caused by: java.lang.IllegalStateException: Could not find a display
at org.eclipse.swtbot.swt.finder.utils.SWTUtils.display(SWTUtils.java:249)
It's the only remaining problem as far as I can see. I hope to fix it
today and push these changes.
I've sorted this out, UI test passes now,
https://github.com/caniszczyk/minerva/pull/10 updated with latest
changes and waiting for comments.
Mykola Nikishov
2011-06-21 23:25:32 UTC
Permalink
Post by Cristiano Gavião
Nice archetype Mykola... ;-)
Actually, it was David Carver [1] who contributed an initial
implementation, I just tried to use it ;-)
Post by Cristiano Gavião
But I just found that there is some little issues.
Cristiano, would you mind to create separate issues right in Minerva's
issue tracker [1]? This will make life easier for those who would like
to use Minerva or contribute to it.

[1] https://github.com/kingargyle
[2] https://github.com/caniszczyk/minerva/issues
--
Mykola
Loading...