Skip to content

Commit 1602388

Browse files
authored
Merge pull request #24 from applandinc/testng_20200806
Add support for TestNG
2 parents 553a119 + 76f5bc0 commit 1602388

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
## [0.4.0] - 2020-08-06
7+
### Added
8+
- Tests annotated with `org.testng.annotations.Test` are now recorded.
69

710
## [0.3.2] - 2020-07-30
811
### Fixed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020
mavenCentral()
2121
}
2222

23-
version = '0.3.2'
23+
version = '0.4.0'
2424

2525
dependencies {
2626
implementation 'org.yaml:snakeyaml:1.25'

src/main/java/com/appland/appmap/process/hooks/ToggleRecord.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,29 @@ public static void junitJupiter(Event event, Exception exception, Object[] args)
226226
recorder.add(event);
227227
stopTest();
228228
}
229+
230+
@ArgumentArray
231+
@ExcludeReceiver
232+
@HookAnnotated("org.testng.annotations.Test")
233+
public static void testng(Event event, Object[] args) {
234+
startTest(event);
235+
}
236+
237+
@ArgumentArray
238+
@CallbackOn(MethodEvent.METHOD_RETURN)
239+
@ExcludeReceiver
240+
@HookAnnotated("org.testng.annotations.Test")
241+
public static void testnt(Event event, Object returnValue, Object[] args) {
242+
stopTest();
243+
}
244+
245+
@ArgumentArray
246+
@CallbackOn(MethodEvent.METHOD_EXCEPTION)
247+
@ExcludeReceiver
248+
@HookAnnotated("org.testng.annotations.Test")
249+
public static void testng(Event event, Exception exception, Object[] args) {
250+
event.setException(exception);
251+
recorder.add(event);
252+
stopTest();
253+
}
229254
}

0 commit comments

Comments
 (0)