[spring-extensions] branch maint-5 updated: JSE-30 Try to let HTTPResourceTest cleanup after itself
Rod Widdowson
rdw at steadingsoftware.com
Thu Dec 20 12:17:57 EST 2018
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch maint-5
in repository spring-extensions.
View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=6e6d3fe1790d686ae6267b51a2e3db2ae013ec89
The following commit(s) were added to refs/heads/maint-5 by this push:
new 6e6d3fe JSE-30 Try to let HTTPResourceTest cleanup after itself
6e6d3fe is described below
commit 6e6d3fe1790d686ae6267b51a2e3db2ae013ec89
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Dec 20 10:55:06 2018 +0000
JSE-30 Try to let HTTPResourceTest cleanup after itself
https://issues.shibboleth.net/jira/browse/JSE-30
Also whine if it fails.
---
.../shibboleth/ext/spring/resource/HTTPResourceTest.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java b/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
index ffe56e4..dfa80ca 100644
--- a/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
@@ -21,7 +21,13 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.PosixFileAttributes;
+import java.nio.file.attribute.PosixFilePermission;
+import java.nio.file.attribute.PosixFilePermissions;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.Set;
import net.shibboleth.ext.spring.util.SchemaTypeAwareXMLBeanDefinitionReader;
import net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder;
@@ -41,6 +47,8 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import com.google.common.collect.Sets;
+
/**
* Test for HTTPResource.
*/
@@ -187,16 +195,17 @@ public class HTTPResourceTest {
if (f.isDirectory()) {
emptyDir(f);
}
- f.delete();
+ Assert.assertTrue(f.delete());
}
- dir.delete();
+ Assert.assertTrue(dir.delete());
}
@Test public void springLoadFileCache() throws IOException {
File theDir = null;
- final Path p = Files.createTempDirectory("HTTPResourceTest");
GenericApplicationContext context = null;
try {
+ final Set<PosixFilePermission> prot = Sets.newHashSet(PosixFilePermission.values());
+ final Path p = Files.createTempDirectory("HTTPResourceTest", PosixFilePermissions.asFileAttribute(prot));
theDir = p.toFile();
context = getContext("classpath:net/shibboleth/ext/spring/resource/MemBackedHTTPBean.xml", null);
final Collection<TestHTTPResource> beans = context.getBeansOfType(TestHTTPResource.class).values();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list