I wonder if you would consider creating a simple one-class project with a sample build.xml to illustrate Ant integration. I find I'm able to generate a test application in the <momeunit> task for example, and see that it contains my test case classes, but the output when I run the build says "no tests found." So far, my <momeunit> task looks like this:
What do I need to do for the momeunit task to find my tests? (The testdir attribute is set correctly and my test class names all end in "Test". The classpath also includes the directory indicated for testdir)
Thanks in advance!
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably you are using Windows system.
If it is so, there is a known bug connected with using patterns with dots.
(Internally dots are replaced with file's separator and pattern is matched as path.
I erroneously relied on some methods of ant's API to convert slashes to target system's file-separators. Actually it is my fall – I didn't check documentation thoroughly).
The possible remedy is not to use dot in pattern (sorry :-(( ). if your test cases are in default package, It can be easily done e.g. *Test. It is also possible to specify back-slash (/) instead of dot, but you need to skip class test via
onlytests=”off”. It should work. In the next two weeks I will provide new version with this bug fixed.
If this doesn't help, please, supply me with OS used momeunit and jvm versions. I will try to help.
Here is the algorithm that is applied to distinguish test cases.
1.class must be not under momeunit package (eliminating framework classes)
2.name must match a pattern.
3.if onlytests is on must implement Test interface.
Maybe this information can be helpful.
I am really sorry for inconveniences. I tested ant integration package on Linux
thoroughly and received feedback mostly from uses on this system (and I am still not satisfied of it's quality). On Windows I probed it several times. I started receiving feedback from Windows last time. This is very helpful.
And thank you for your feedback again. Don't hesitate to write.
Looking forward to here from you again.
Sergio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wonder if you would consider creating a simple one-class project with a sample build.xml to illustrate Ant integration. I find I'm able to generate a test application in the <momeunit> task for example, and see that it contains my test case classes, but the output when I run the build says "no tests found." So far, my <momeunit> task looks like this:
<momeunit testdir="${j2me.test.classes.dir}"
pattern="**.*Test"
reportdir="${j2me.test.data.dir}"
printsummary="true"
failureproperty="failed.tests"
appdir="${test.deploy.dir}"
appname="Test_${project}">
<classpath>
<path refid="j2me.test.classpath"/>
<path path="${j2me.support.jars}"/>
</classpath>
<formatter type="xml"/>
</momeunit>
What do I need to do for the momeunit task to find my tests? (The testdir attribute is set correctly and my test class names all end in "Test". The classpath also includes the directory indicated for testdir)
Thanks in advance!
David
Dear David,
Thank you for feedback.
There can be different causes of the problem.
Probably you are using Windows system.
If it is so, there is a known bug connected with using patterns with dots.
(Internally dots are replaced with file's separator and pattern is matched as path.
I erroneously relied on some methods of ant's API to convert slashes to target system's file-separators. Actually it is my fall – I didn't check documentation thoroughly).
The possible remedy is not to use dot in pattern (sorry :-(( ). if your test cases are in default package, It can be easily done e.g. *Test. It is also possible to specify back-slash (/) instead of dot, but you need to skip class test via
onlytests=”off”. It should work. In the next two weeks I will provide new version with this bug fixed.
If this doesn't help, please, supply me with OS used momeunit and jvm versions. I will try to help.
Here is the algorithm that is applied to distinguish test cases.
1.class must be not under momeunit package (eliminating framework classes)
2.name must match a pattern.
3.if onlytests is on must implement Test interface.
Maybe this information can be helpful.
I am really sorry for inconveniences. I tested ant integration package on Linux
thoroughly and received feedback mostly from uses on this system (and I am still not satisfied of it's quality). On Windows I probed it several times. I started receiving feedback from Windows last time. This is very helpful.
And thank you for your feedback again. Don't hesitate to write.
Looking forward to here from you again.
Sergio