More fixes for Windows build

This commit is contained in:
Joakim Erdfelt 2013-11-04 16:50:18 -07:00
parent c366c6b356
commit aba3a41a34
5 changed files with 31 additions and 7 deletions

1
.gitattributes vendored
View File

@ -1,3 +1,4 @@
*.sh eol=lf
*.bat eol=crlf
*.txt eol=lf
*.js eol=lf

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.client;
import static java.nio.file.StandardOpenOption.CREATE;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpCookie;
@ -63,15 +64,21 @@ import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
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.TestingDir;
import org.eclipse.jetty.toolchain.test.annotation.Slow;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
public class HttpClientTest extends AbstractHttpClientServerTest
{
@Rule
public TestingDir testdir = new TestingDir();
public HttpClientTest(SslContextFactory sslContextFactory)
{
super(sslContextFactory);
@ -508,7 +515,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
start(new EmptyServerHandler());
// Prepare a big file to upload
Path targetTestsDir = MavenTestingUtils.getTargetTestingDir().toPath();
Path targetTestsDir = testdir.getEmptyDir().toPath();
Files.createDirectories(targetTestsDir);
Path file = Paths.get(targetTestsDir.toString(), "http_client_conversation.big");
try (OutputStream output = Files.newOutputStream(file, CREATE))

View File

@ -1109,7 +1109,10 @@ public class SslBytesServerTest extends SslBytesTest
@Test
public void testRequestWithBigContentReadBlockedThenReset() throws Exception
{
final SSLSocket client = newClient();
// Don't run on Windows (buggy JVM)
Assume.assumeTrue(!OS.IS_WINDOWS);
final SSLSocket client = newClient();
SimpleProxy.AutomaticFlow automaticProxyFlow = proxy.startAutomaticFlow();
client.startHandshake();

View File

@ -25,6 +25,7 @@ import static org.hamcrest.Matchers.notNullValue;
import java.io.IOException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.util.List;
import java.util.concurrent.ExecutionException;
@ -32,6 +33,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.toolchain.test.TestTracker;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.UpgradeException;
@ -62,7 +64,11 @@ public class ClientConnectTest
{
// Validate thrown cause
Throwable cause = e.getCause();
Assert.assertThat("ExecutionException.cause",cause,instanceOf(errorClass));
if(!errorClass.isInstance(cause))
{
cause.printStackTrace(System.err);
Assert.assertThat("ExecutionException.cause",cause,instanceOf(errorClass));
}
// Validate websocket captured cause
Assert.assertThat("Error Queue Length",wsocket.errorQueue.size(),greaterThanOrEqualTo(1));
@ -354,8 +360,15 @@ public class ClientConnectTest
}
catch (ExecutionException e)
{
// Expected path - java.net.ConnectException
assertExpectedError(e,wsocket,ConnectException.class);
if(OS.IS_WINDOWS)
{
// On windows, this is a SocketTimeoutException
assertExpectedError(e, wsocket, SocketTimeoutException.class);
} else
{
// Expected path - java.net.ConnectException
assertExpectedError(e,wsocket,ConnectException.class);
}
}
}

View File

@ -108,7 +108,7 @@ public class AnnotatedMaxMessageSizeTest
}
}
@Test
@Test(timeout=4000)
public void testEchoTooBig() throws IOException, Exception
{
BlockheadClient client = new BlockheadClient(serverUri);