Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;

import java.util.Objects;
Expand All @@ -18,36 +17,12 @@ public class Allure1TestCaseAspects {

private static AllureLifecycle lifecycle;

/**
* Pointcut for things annotated with {@link org.junit.Test}.
*/
@Pointcut("@annotation(org.junit.Test)")
public void withJunitAnnotation() {
//pointcut body, should be empty
}

/**
* Pointcut for things annotated with {@link org.testng.annotations.Test}.
*/
@Pointcut("@annotation(org.testng.annotations.Test)")
public void withTestNgAnnotation() {
//pointcut body, should be empty
}

/**
* Pointcut for any methods.
*/
@Pointcut("execution(* *(..))")
public void anyMethod() {
//pointcut body, should be empty
}

@Before("anyMethod() && withJunitAnnotation()")
@Before("execution(@org.junit.Test * *.*(..))")
public void junitTestStart(final JoinPoint joinPoint) {
updateTestCase(joinPoint);
}

@Before("anyMethod() && withTestNgAnnotation()")
@Before("execution(@org.testng.annotations.Test * *.*(..))")
public void testNgTestStart(final JoinPoint joinPoint) {
updateTestCase(joinPoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<aspect name="io.qameta.allure.aspects.Allure1StepsAspects"/>
<aspect name="io.qameta.allure.aspects.Allure1AttachAspects"/>
</aspects>
<weaver options="-warn:none -Xlint:ignore"/>
</aspectj>