[GRADLE-713] TestNG tests not executed when @Test annotation is used for class Created: 21/Oct/09  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.8
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Tomek Kaczanowski Assignee: Tom Eyckmans
Resolution: Fixed Votes: 0

Attachments: Zip Archive testng.zip    

 Description   

TestNG tests not executed when @Test annotation is used for class

such behaviour is not compatible with what TestNG users can expect. See TestNG documentation:
http://testng.org/doc/documentation-main.html#class-level
"The effect of a class level @Test annotation is to make all the public methods of this class to become test methods even if they are not annotated. You can still repeat the @Test annotation on a method if you want to add certain attributes."

for example tests from this class will not be executed

import org.testng.annotations.Test;
import static org.testng.Assert.assertTrue;

@Test
public class MyClassTestNGTest {

public void testMyClass()

{ assertTrue(false); }

}

run "gradle test" on the attached project to see it happening (or rather not happening)



 Comments   
Comment by Tom Eyckmans [ 05/Nov/09 ]

Hi Tomek,

I wasn't aware of this, I'll add this to our test class detection.

Thanks for reporting this.

Generated at Wed Jun 30 11:36:56 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.