All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qase.junit4.QaseJunit4Aspects Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
package io.qase.junit4;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.junit.runner.notification.RunNotifier;

@Aspect
public final class QaseJunit4Aspects {
    private final QaseListener qaseListener = ListenerFactory.getInstance();

    @After("execution(org.junit.runner.notification.RunNotifier.new())")
    public void addListener(JoinPoint point) {
        System.out.println("Add listener");
        RunNotifier notifier = (RunNotifier) point.getThis();
        notifier.removeListener(qaseListener);
        notifier.addListener(qaseListener);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy