Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 18, 2024
1 parent b45acb2 commit 8c79019
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion eo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ SOFTWARE.
<dependency>
<groupId>com.yegor256</groupId>
<artifactId>tojos</artifactId>
<version>0.18.3</version>
<version>0.18.4</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void readsFromTojosConcurrently(@Mktmp final Path tmp) {
MatcherAssert.assertThat(
"adds different elements to catalog",
new Together<>(
(thread) -> {
thread -> {
final Tojo tojo = tojos.add(UUID.randomUUID().toString());
final String key = "foo";
tojo.set(key, UUID.randomUUID().toString());
Expand Down
26 changes: 10 additions & 16 deletions eo-runtime/src/test/java/org/eolang/PhDefaultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@
*/
package org.eolang;

import com.yegor256.Together;
import java.security.SecureRandom;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.cactoos.Scalar;
import org.cactoos.experimental.Threads;
import org.cactoos.set.SetOf;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -303,17 +299,15 @@ void makesObjectIdentity() {
@Test
void createsDifferentPhiInParallel() {
final int threads = 100;
final Set<PhDefault> objects = ConcurrentHashMap.newKeySet();
new Threads<>(
threads,
Stream.generate(
() -> (Scalar<PhDefault>) Int::new
).limit(threads).collect(Collectors.toList())
).forEach(objects::add);
MatcherAssert.assertThat(
AtCompositeTest.TO_ADD_MESSAGE,
objects,
Matchers.hasSize(threads)
"all objects are unique",
new SetOf<>(
new Together<>(
threads,
(thread) -> new Int()
)
),
Matchers.iterableWithSize(threads)
);
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ SOFTWARE.
<dependency>
<groupId>com.yegor256</groupId>
<artifactId>together</artifactId>
<version>0.0.1</version>
<version>0.0.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 8c79019

Please sign in to comment.