Revert "Issue #2597 - Improving UnixSocketTest behavior."

This reverts commit ebdac11

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2018-06-06 20:04:56 -05:00
parent ebdac11d71
commit d82b9a2f89
1 changed files with 7 additions and 15 deletions

View File

@ -37,10 +37,8 @@ import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.unixsocket.client.HttpClientTransportOverUnixSockets;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -48,28 +46,23 @@ import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
public class UnixSocketTest
{
private static final Logger log = Log.getLogger(UnixSocketTest.class);
private Logger log = Log.getLogger( getClass() );
@Rule
public TestingDir testingDir = new TestingDir();
private Server server;
private HttpClient httpClient;
private Path sockFile;
Server server;
HttpClient httpClient;
Path sockFile;
@Before
public void before() throws Exception
{
server = null;
httpClient = null;
testingDir.ensureEmpty();
// Create a unique unix.sock, in target/tests directory, that's based on TestClass + testMethod + testScope
sockFile = testingDir.getPathFile("unix.sock");
Path targetDir = MavenTestingUtils.getTargetPath();
sockFile = Files.createTempFile(targetDir, "unix", ".sock" );
}
@After
@ -79,8 +72,7 @@ public class UnixSocketTest
httpClient.stop();
if (server!=null)
server.stop();
// Force delete, this will fail if UnixSocket was not closed properly in the implementation
FS.delete(sockFile);
Files.deleteIfExists(sockFile);
}
@Test