Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
00b9e7f4
Commit
00b9e7f4
authored
Jun 11, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4.x' into 2.5.x
Closes gh-26868
parents
1a828af1
186658cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
TunnelClientTests.java
...mework/boot/devtools/tunnel/client/TunnelClientTests.java
+6
-3
No files found.
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/client/TunnelClientTests.java
View file @
00b9e7f4
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
21
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -24,7 +24,9 @@ import java.nio.ByteBuffer;
...
@@ -24,7 +24,9 @@ import java.nio.ByteBuffer;
import
java.nio.channels.Channels
;
import
java.nio.channels.Channels
;
import
java.nio.channels.SocketChannel
;
import
java.nio.channels.SocketChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.time.Duration
;
import
org.awaitility.Awaitility
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -85,9 +87,10 @@ class TunnelClientTests {
...
@@ -85,9 +87,10 @@ class TunnelClientTests {
TunnelClient
client
=
new
TunnelClient
(
0
,
this
.
tunnelConnection
);
TunnelClient
client
=
new
TunnelClient
(
0
,
this
.
tunnelConnection
);
int
port
=
client
.
start
();
int
port
=
client
.
start
();
SocketChannel
channel
=
SocketChannel
.
open
(
new
InetSocketAddress
(
port
));
SocketChannel
channel
=
SocketChannel
.
open
(
new
InetSocketAddress
(
port
));
Thread
.
sleep
(
200
);
Awaitility
.
await
().
atMost
(
Duration
.
ofSeconds
(
30
)).
until
(
this
.
tunnelConnection
::
getOpenedTimes
,
(
times
)
->
times
==
1
);
assertThat
(
this
.
tunnelConnection
.
isOpen
()).
isTrue
();
client
.
stop
();
client
.
stop
();
assertThat
(
this
.
tunnelConnection
.
getOpenedTimes
()).
isEqualTo
(
1
);
assertThat
(
this
.
tunnelConnection
.
isOpen
()).
isFalse
();
assertThat
(
this
.
tunnelConnection
.
isOpen
()).
isFalse
();
assertThat
(
channel
.
read
(
ByteBuffer
.
allocate
(
1
))).
isEqualTo
(-
1
);
assertThat
(
channel
.
read
(
ByteBuffer
.
allocate
(
1
))).
isEqualTo
(-
1
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment