parent
bd5f09906e
commit
0baceb4aa4
|
|
@ -20,7 +20,6 @@ import java.sql.Connection;
|
|||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
@ -95,11 +94,9 @@ public abstract class AbstractDevToolsDataSourceAutoConfigurationTests {
|
|||
|
||||
protected ConfigurableApplicationContext getContext(
|
||||
Supplier<ConfigurableApplicationContext> supplier) throws Exception {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
AtomicReference<ConfigurableApplicationContext> atomicReference = new AtomicReference<>();
|
||||
Thread thread = new Thread(() -> {
|
||||
ConfigurableApplicationContext context = supplier.get();
|
||||
latch.countDown();
|
||||
atomicReference.getAndSet(context);
|
||||
});
|
||||
thread.start();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.time.Duration;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
@ -253,11 +252,9 @@ public class LocalDevToolsAutoConfigurationTests {
|
|||
|
||||
private ConfigurableApplicationContext getContext(
|
||||
Supplier<ConfigurableApplicationContext> supplier) throws Exception {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
AtomicReference<ConfigurableApplicationContext> atomicReference = new AtomicReference<>();
|
||||
Thread thread = new Thread(() -> {
|
||||
ConfigurableApplicationContext context = supplier.get();
|
||||
latch.countDown();
|
||||
atomicReference.getAndSet(context);
|
||||
});
|
||||
thread.start();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.springframework.boot.devtools.autoconfigure;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
@ -183,11 +182,9 @@ public class RemoteDevToolsAutoConfigurationTests {
|
|||
private AnnotationConfigServletWebApplicationContext getContext(
|
||||
Supplier<AnnotationConfigServletWebApplicationContext> supplier)
|
||||
throws Exception {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
AtomicReference<AnnotationConfigServletWebApplicationContext> atomicReference = new AtomicReference<>();
|
||||
Thread thread = new Thread(() -> {
|
||||
AnnotationConfigServletWebApplicationContext context = supplier.get();
|
||||
latch.countDown();
|
||||
atomicReference.getAndSet(context);
|
||||
});
|
||||
thread.start();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ package org.springframework.boot.devtools.env;
|
|||
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
@ -122,11 +121,9 @@ public class DevToolPropertiesIntegrationTests {
|
|||
|
||||
protected ConfigurableApplicationContext getContext(
|
||||
Supplier<ConfigurableApplicationContext> supplier) throws Exception {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
AtomicReference<ConfigurableApplicationContext> atomicReference = new AtomicReference<>();
|
||||
Thread thread = new Thread(() -> {
|
||||
ConfigurableApplicationContext context = supplier.get();
|
||||
latch.countDown();
|
||||
atomicReference.getAndSet(context);
|
||||
});
|
||||
thread.start();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
|
|
@ -74,10 +73,8 @@ public class DevToolsHomePropertiesPostProcessorTests {
|
|||
}
|
||||
|
||||
protected void runPostProcessor(Runnable runnable) throws Exception {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
Thread thread = new Thread(() -> {
|
||||
runnable.run();
|
||||
latch.countDown();
|
||||
});
|
||||
thread.start();
|
||||
thread.join();
|
||||
|
|
|
|||
Loading…
Reference in New Issue