Ekstazi with TestNg

35 views
Skip to first unread message

Michael Kronberger

unread,
May 15, 2019, 1:39:00 AM5/15/19
to Ekstazi
Hi, 

i like to use Ekstazi together with the testing frame work TestNg. But unfortunately i don't get it running. Maybe you could provide me more information how to implement Ekstazi together with an other testing framework. 
This i what i have tried but not working: 

public class TestNgBackendListener implements ITestListener {

    @Override
    public void onTestStart(ITestResult iTestResult) {
        if (Ekstazi.inst().checkIfAffected(iTestResult.getInstanceName())) {
            Ekstazi.inst().startCollectingDependencies(iTestResult.getInstanceName());
        }
    }

    @Override
    public void onTestSuccess(ITestResult iTestResult) {
            Ekstazi.inst().finishCollectingDependencies(iTestResult.getInstanceName());
    }

    @Override
    public void onTestFailure(ITestResult iTestResult) {
        Ekstazi.inst().finishCollectingDependencies(iTestResult.getInstanceName());

    }

    @Override
    public void onTestSkipped(ITestResult iTestResult) {

    }

    @Override
    public void onTestFailedButWithinSuccessPercentage(ITestResult iTestResult) {
        Ekstazi.inst().finishCollectingDependencies(iTestResult.getInstanceName());
    }

    @Override
    public void onStart(ITestContext iTestContext) {
       /* if (org.ekstazi.Ekstazi.inst().checkIfAffected(iTestContext.getName())) {
            org.ekstazi.Ekstazi.inst().startCollectingDependencies(iTestContext.getName());
            try {
                // Collecting dependencies for code here.
            } finally {
                org.ekstazi.Ekstazi.inst().finishCollectingDependencies(iTestContext.getName());
            }
        }
        iTestContext.getName();*/

    }

    @Override
    public void onFinish(ITestContext iTestContext) {
    }
}

And i have an additional question. We are also using the JaCoCo plugin for test coverage. Is it possible that JaCoCo identifies the test coverage of the unit tests, even they are not executed because they haven't been affected from any dependency changes?

best regards
Michael
Reply all
Reply to author
Forward
0 new messages