Note: only the latest version is supported
When the ITestListener or any other listener gets implemented eclipse should show add unimplemented methods option, when clicked on the option all the methods of the interface should included the class
Its not working as expected behavior
package com.freecrm.ExtentReportListener;
import org.testng.ITestListener;
public class MyListener implements ITestListener{
}
@sen1983 - TestNG 7.0.0 uses JDK8 and with it default methods within interfaces. What this means is that every listener would now have a default implementation (which doesn't do anything ) for all methods defined within the interface.
So now you won't see those indications from the IDE. The biggest benefit of default methods in interfaces is that let's say you are implementing an interface that has 10 methods defined in it, you can just implement whatever you need and the rest of the behavior comes via the default methods in the interface.
@krmahadevan - Thank you for the answer, adding more info to it.
When you are not able to add the unimplemented methods, start writing the code but do not add "@override".
@sagaramritkar - Not sure what do you mean and what you were trying to explain. Care to explain one more time ?
@sagaramritkar Agreed with your statement when I am adding the default method
[ default void onTestFailure(ITestResult result) {
// not implemented
} ]
with "@override" it's giving me an error with a quick fix --> "Remove @Override annotation"
@krmahadevan Please verify
This issue belongs to TestNG 7.1.0. try to configure TestNG 6.14.3. Issue will not reproduce.
is this an issue or change ?
@prernabhandari2427 - Not sure what you mean by that.
This issue belongs to TestNG 7.1.0. try to configure TestNG 6.14.3. Issue will not reproduce.
Thanks, it works
Most helpful comment
@sen1983 - TestNG 7.0.0 uses JDK8 and with it default methods within interfaces. What this means is that every listener would now have a default implementation (which doesn't do anything ) for all methods defined within the interface.
So now you won't see those indications from the IDE. The biggest benefit of default methods in interfaces is that let's say you are implementing an interface that has 10 methods defined in it, you can just implement whatever you need and the rest of the behavior comes via the default methods in the interface.