Skip to content

Commit 0b19854

Browse files
Ahmed TawilaAhmed Tawila
authored andcommitted
Merge branch 'master' of https://github.com/eugenp/tutorials
2 parents c46996b + 1854175 commit 0b19854

26 files changed

Lines changed: 699 additions & 194 deletions

File tree

‎bootique/dependency-reduced-pom.xml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
<dependency>
2929
<groupId>junit</groupId>
3030
<artifactId>junit</artifactId>
31-
<version>3.8.1</version>
31+
<version>4.12</version>
3232
<scope>test</scope>
33+
<exclusions>
34+
<exclusion>
35+
<artifactId>hamcrest-core</artifactId>
36+
<groupId>org.hamcrest</groupId>
37+
</exclusion>
38+
</exclusions>
3339
</dependency>
3440
</dependencies>
3541
<dependencyManagement>

‎core-java-concurrency/src/test/java/com/baeldung/concurrent/stopping/StopThreadTest.java‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package com.baeldung.concurrent.stopping;
22

3+
import com.jayway.awaitility.Awaitility;
34
import org.junit.Test;
45

6+
import java.util.concurrent.TimeUnit;
7+
8+
import static com.jayway.awaitility.Awaitility.await;
59
import static org.junit.Assert.assertFalse;
610
import static org.junit.Assert.assertTrue;
711

@@ -22,11 +26,10 @@ public void whenStoppedThreadIsStopped() throws InterruptedException {
2226

2327
// Stop it and make sure the flags have been reversed
2428
controlSubThread.stop();
25-
Thread.sleep(interval);
26-
assertTrue(controlSubThread.isStopped());
29+
await()
30+
.until(() -> assertTrue(controlSubThread.isStopped()));
2731
}
2832

29-
3033
@Test
3134
public void whenInterruptedThreadIsStopped() throws InterruptedException {
3235

@@ -44,7 +47,8 @@ public void whenInterruptedThreadIsStopped() throws InterruptedException {
4447
controlSubThread.interrupt();
4548

4649
// Wait less than the time we would normally sleep, and make sure we exited.
47-
Thread.sleep(interval/10);
48-
assertTrue(controlSubThread.isStopped());
50+
Awaitility.await()
51+
.atMost(interval/ 10, TimeUnit.MILLISECONDS)
52+
.until(controlSubThread::isStopped);
4953
}
5054
}

‎core-java-sun/.gitignore‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.class
2+
3+
0.*
4+
5+
#folders#
6+
/target
7+
/neoDb*
8+
/data
9+
/src/main/webapp/WEB-INF/classes
10+
*/META-INF/*
11+
.resourceCache
12+
13+
# Packaged files #
14+
*.jar
15+
*.war
16+
*.ear
17+
18+
# Files generated by integration tests
19+
*.txt
20+
backup-pom.xml
21+
/bin/
22+
/temp
23+
24+
#IntelliJ specific
25+
.idea/
26+
*.iml

‎core-java-sun/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=========
2+
3+
## Core Java Cookbooks and Examples
4+
5+
### Relevant Articles:
6+
- [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin)

0 commit comments

Comments
 (0)