This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new d866168  Beautify test
d866168 is described below

commit d8661682937a1d8f53a3830cff17d05d897e692f
Author: remm <r...@apache.org>
AuthorDate: Wed Jun 30 22:07:55 2021 +0200

    Beautify test
---
 test/org/apache/tomcat/util/net/TestXxxEndpoint.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestXxxEndpoint.java 
b/test/org/apache/tomcat/util/net/TestXxxEndpoint.java
index efc4dd1..f270258 100644
--- a/test/org/apache/tomcat/util/net/TestXxxEndpoint.java
+++ b/test/org/apache/tomcat/util/net/TestXxxEndpoint.java
@@ -213,12 +213,14 @@ public class TestXxxEndpoint extends TomcatBaseTest {
                 c.getProtocolHandlerClassName().contains("NioProtocol")
                 && JreCompat.isJre16Available());
 
-        File tempPath = File.createTempFile("tomcat", ".uds");
-        final String unixDomainSocketPath = tempPath.getAbsolutePath();
-        tempPath.delete();
+        File tempPath = File.createTempFile("uds-tomcat-test-", ".sock");
+        String unixDomainSocketPath = tempPath.getAbsolutePath();
+        // Need to delete the file to make way for the actual socket
+        Assert.assertTrue(tempPath.delete());
         Assert.assertTrue(c.setProperty("unixDomainSocketPath", 
unixDomainSocketPath));
         tomcat.start();
 
+        // Connect to the domain socket as a client
         SocketAddress sa = 
JreCompat.getInstance().getUnixDomainSocketAddress(unixDomainSocketPath);
         ByteBuffer response = ByteBuffer.allocate(1024);
         try (SocketChannel socket = 
JreCompat.getInstance().openUnixDomainSocketChannel()) {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to