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

pull/18464/head
Andy Wilkinson 5 years ago
parent abba4fa9c9
commit b8070a8339

@ -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);

Loading…
Cancel
Save