GitHub user dfa1 opened a pull request:
https://github.com/apache/jmeter/pull/376
Logging of JUnitSampler exceptions
## Description
Logging of any non-assert exception generated inside a test.
## Motivation and Context
The main motivation is to speedup fixing of errors inside test methods. We
have a big test suite that
is run using the JUnitSampler using this pattern:
```java
private final Logger logger = LoggerFactory.getLogger(getClass());
@Test
public void testName() {
try {
// test body
} catch (Exception ex) {
logger.warn("caught exception", ex);
throw ex;
}
}
```
With this change the code would be simpler:
```java
@Test
public void testName() {
// test body
}
```
## How Has This Been Tested?
Still to be tested. Since we are using jmeter-maven-plugin, we need to
install the JMeter core in the local maven repository. There is a quick way to
do this using ant?
## Types of changes
- New feature (non-breaking change which adds functionality)
## Checklist:
- [x] My code follows the [code style][style-guide] of this project.
- [ ] I have updated the documentation accordingly.
[style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dfa1/jmeter log_junitsampler_exceptions
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jmeter/pull/376.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #376
commit 03e94e29c641d2e5b4aa509534993b3c4b654ed2
Author: Davide Angelocola
Date: 2018-02-13T08:09:10Z
logging exceptions around test method execution
commit 41f0e218db58d22bd4843142f7157ec915ea5154
Author: Davide Angelocola
Date: 2018-02-14T15:07:06Z
logging other cause as well
---