[GRADLE-1620] Gradle does not execute testng test classes with just a org.testng.annotations.Factory annotation Created: 16/Jun/11  Updated: 24/Jan/13  Resolved: 24/Jan/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-3
Fix Version/s: 1.5-rc-1

Type: Bug
Reporter: Ric Klaren Assignee: Unassigned
Resolution: Fixed Votes: 0


We have a number of test classes that use the org.testng.annotations.Factory annotation to provide the testcases:

import org.testng.annotations.Factory;
import eu.educator.test.TestBuilder;

public class LogEntryTest {
	public Object[] testLogEntry() {
		TestBuilder builder = new TestBuilder(Dummy.class);
		// stuff...
		return builder.build();

These are not picked up by the gradle testng testcase scanner. (they are completely left out of the test classes that are run)

Workarounds are to include an additional @Test annotation on the class itself. Or set scanForTestClasses = false, and provide a proper include pattern.

Generated at Wed Jun 30 12:00:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.