Commit b8070a83 authored by Andy Wilkinson's avatar Andy Wilkinson

Skip tests on Windows that exceed its file system's limitations

parent abba4fa9
......@@ -16,6 +16,7 @@
package org.springframework.boot.context.embedded;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
......@@ -110,4 +111,8 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
});
}
protected boolean isWindows() {
return File.separatorChar == '\\';
}
}
......@@ -90,10 +90,12 @@ class ApplicationBuilder {
resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt"));
resourcesJarStream.write("nested".getBytes());
resourcesJarStream.closeEntry();
resourcesJarStream.putNextEntry(
new ZipEntry("META-INF/resources/nested-reserved-!#$%&()*+,:=?@[]-meta-inf-resource.txt"));
resourcesJarStream.write("encoded-name".getBytes());
resourcesJarStream.closeEntry();
if (!isWindows()) {
resourcesJarStream.putNextEntry(
new ZipEntry("META-INF/resources/nested-reserved-!#$%&()*+,:=?@[]-meta-inf-resource.txt"));
resourcesJarStream.write("encoded-name".getBytes());
resourcesJarStream.closeEntry();
}
return resourcesJar;
}
}
......@@ -154,4 +156,8 @@ class ApplicationBuilder {
assertThat(execute.getExitCode()).isEqualTo(0);
}
private boolean isWindows() {
return File.separatorChar == '\\';
}
}
......@@ -18,6 +18,7 @@ package org.springframework.boot.context.embedded;
import java.util.Arrays;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
......@@ -56,6 +57,7 @@ public class EmbeddedServletContainerJarDevelopmentIntegrationTests
@Test
public void metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp() {
Assume.assumeFalse(isWindows());
ResponseEntity<String> entity = this.rest.getForEntity(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt",
String.class);
......
......@@ -18,6 +18,7 @@ package org.springframework.boot.context.embedded;
import java.util.Arrays;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
......@@ -56,6 +57,7 @@ public class EmbeddedServletContainerJarPackagingIntegrationTests
@Test
public void nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp() {
Assume.assumeFalse(isWindows());
ResponseEntity<String> entity = this.rest.getForEntity(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt",
String.class);
......
......@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
......@@ -62,6 +63,7 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests
@Test
public void metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp() {
Assume.assumeFalse(isWindows());
ResponseEntity<String> entity = this.rest.getForEntity(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt",
String.class);
......
......@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
......@@ -62,6 +63,7 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests
@Test
public void nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp() {
Assume.assumeFalse(isWindows());
ResponseEntity<String> entity = this.rest.getForEntity(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt",
String.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment