[code]
<suite name="fn-unit-tests" verbose="1">
<test name="Unit Test">
<groups>
<run>
<include name="unit" />
<include name="unit.spring" />
</run>
</groups>
</test>
</suite>
[/code]
(Why does not format correctly?)
But no tests are found nor run. I have even imported the class folder directly. Still no tests.
I really need a project that runs all the unit tests for all projects. Sure I can go to ant, but right now I don't even have an ant build setup. Besides, I want to run this in the plugin runner.
Am I missing something simple, or does the plugin explicity only run tests from the current projects output folder(s)?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33806#33806
"run group 'unit' for all classes in the project"
But 'class name="*"' doesn't work. I can't find any example in the docs that do anything like this.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33817#33817
On a releated note, can I specify a wildcard in the <classes> element? I want to say
"run group 'unit' for all classes in the project"
But 'class name="*"' doesn't work. I can't find any example in the docs that do anything like this.
- create project A, project B
- add tests to A and B with the group name "unit"
- create project Test and have it depend on A and B
- create a new run configuration, set the project to Test
Now at this point I want to specify the "unit" group but cannot because the only way to specify a group is to select one. Since Test does not define any tests itself, there are not groups to select. So....
- change run configuration to either project A or B
- now select the "unit" group
- change the run configuration back to project Test
Now all tests in the dependent projects with the group "unit" will run.
(I'll submt a jira issue that references this thread)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33820#33820
(No up-to-date versions in jira for testng?)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33821#33821
(But see my reply above, I have found a workaround)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33828#33828
http://jira.opensymphony.com/browse/TESTNG-28
(No up-to-date versions in jira for testng?)
Hi Barry!
Can you please check what is the command line used to launch TestNG in this scenario? You can find
this line in the .log file of your workspace.
I suspect that the following is happening: you are using JDK1.4, and for this TestNG needs access to
the source dirs. While using project dependencies, the plugin is not reaching the other projects
source dirs, and as a result it is not able to run tests in those projects.
In case you are using JDK1.5, I don't have any ideas (yet).
./alex
--
.w( the_mindstorm )p.
----
!ENTRY org.testng.eclipse 1 1 2006-02-06 19:55:09.703
!MESSAGE [-port, 3678, -sourcedir, Q:\folio\portfolio\src\prod\java;Q:\folio\portfolio\src\prod\conf;Q:\folio\portfolio\src\test\conf;Q:\folio\portfolio\src\test\java;Q:\folio\platform\src\prod\java;Q:\folio\platform\src\test\conf;Q:\folio\platform\src\prod\conf;Q:\folio\platform\src\test\java, -d, Q:\folio\test, Q:\folio\test\testng.xml]
----
For the dependent projects the /source/ directories are in the path, not the output folders.
But.... Here is the command for the target that does work. This target was created as I described above (ie, by tricking the plugin to use the groups):
----
!ENTRY org.testng.eclipse 1 1 2006-02-06 19:58:07.875
!MESSAGE [-port, 3695, -sourcedir, Q:\folio\portfolio\src\prod\java;Q:\folio\portfolio\src\prod\conf;Q:\folio\portfolio\src\test\conf;Q:\folio\portfolio\src\test\java;Q:\folio\platform\src\prod\java;Q:\folio\platform\src\test\conf;Q:\folio\platform\src\prod\conf;Q:\folio\platform\src\test\java, -d, Q:\folio\portfolio, Q:\folio\portfolio\fn-portfolio_Custom_suite_c9d431a9.xml]
----
The are the same! The only difference is that the generated suite has the <classes> entries that it auto-discovered. So does this mean that the classes must always be specified even if a group is selected?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=33881#33881
Ugly :-). Can you please paste the 2 suites (the one you created vs the one autogenerated - by the
way, I never thought the autogeneration would work better than the manual one :-) ).
I guess that indeed the classes or packages must be provided in the suite. The reason is that
without it TestNG would have to load all classes in the classpath and investigate each of them to
see if they are part of the group. This would take an eternity with real projects. So, in order to
keep things at a normal speed you will have to provide at least the packages where TestNG should look.
Does this makes sense?
cheers,
Manually created suite:
---
<suite name="fn-unit-tests" verbose="1">
<test name="Unit Test">
<groups>
<run>
<include name="unit" />
<include name="unit.spring" />
</run>
</groups>
</test>
</suite>
---
Plugin generated suite:
----
<suite name="Custom suite">
<test verbose="2" name="fn-test" annotations="1.5">
<groups>
<run>
<include name="unit, unit.spring"/>
<include name="unit"/>
</run>
</groups>
<classes>
<class name="org.opentrader.infra.hibernate.DAOPersistentClassBeanFactoryPostProcessorTest"/>
<class name="org.opentrader.infra.lingo.MaskedTopicFactoryTest"/>
<class name="org.opentrader.infra.lingo.SingleArgumentTopicResolverTest"/>
</classes>
</test>
</suite>
----
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=34037#34037
Barry I tend to disagree with you. Looking at each class if it extends some TestClass is quite easy.
Moreover I think that in JUnit you are specifying where you should look for those. Now compair
this with scanning all the classes in the classpath, reading all methods and check for an
annotation. Doesn't look quite the same. Moreover, I don't see a good reason why you shouldn't
provide a org.opentrader.infra.* package.
When we scanned the classpath it was /not/ the entire classpath, but just the specific folders which we knew to contain our tests. (This was in Idea, pre-module days. So all tests were in a single directory.) We never scanned jars and such.
Even now, I don't want to scan jars. I just want to pick up all our tests from all our eclipse projects. If a "org.opentrader.*" will do the trick, I'm more than happy.
-barry
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=34164#34164
I expect it to work with a package. Please keep us updated.
cheers,
And it does indeed work!
So one only has to create an eclipse project that depends on all other projects. Create a testng.xml similar to below, and all tests selected from all projects will run. Thanks!!
<suite name="fn-unit-tests" verbose="1">
<test name="Unit Test">
<groups>
<run>
<include name="unit" />
<include name="unit.spring" />
</run>
</groups>
<packages>
<package name="org.opentrader.*" />
</packages>
</test>
</suite>
-barry
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=17229&messageID=34318#34318
Thanks for the confirmation Barry!