An open API service indexing awesome lists of open source software.

https://github.com/yvanmazy/concurrent-testing

Minimal Java library to create concurrency tests.
https://github.com/yvanmazy/concurrent-testing

concurrency java lightweight unit-testing

Last synced: about 1 year ago
JSON representation

Minimal Java library to create concurrency tests.

Awesome Lists containing this project

README

          

# 🧵 concurrent-testing

Very small Java library for doing concurrency tests during unit testing. It's a tool that I use for personal projects,
it is not intended to be really maintained.

Here is a small example of use:

```java
@RepeatedTest(10) // To reduce randomness, use repeated test
void testAtomicCounter() {
final Counter counter = new AtomicCounter();
ConcurrentTester.run(() -> {
// Code executed in different threads
counter.increment();
}, c -> c.threads(THREADS).iterations(ITERATIONS));
assertEquals(THREADS * ITERATIONS, counter.get());
}
```

To use the project as a dependency, you can add it using [Maven](https://maven.apache.org/)
or [Gradle](https://gradle.org/).

**Last version**: [![Release](https://jitpack.io/v/YvanMazy/concurrent-testing.svg)](https://jitpack.io/#YvanMazy/concurrent-testing)

```groovy
repositories {
maven { url 'https://jitpack.io' }
}

dependencies {
implementation 'com.github.YvanMazy:concurrent-testing:VERSION'
}
```

```xml


jitpack.io
https://jitpack.io


com.github.YvanMazy
concurrent-testing
VERSION

```