[java-identity-provider] branch main updated: Fix build

Rod Widdowson rdw at steadingsoftware.com
Wed Sep 9 09:25:54 UTC 2020


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=7aaa11ae6ba076841627d45d5e20771a66c70911

The following commit(s) were added to refs/heads/main by this push:
       new  7aaa11ae6 Fix build
7aaa11ae6 is described below

commit 7aaa11ae6ba076841627d45d5e20771a66c70911
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Sep 9 10:25:22 2020 +0100

    Fix build
    
    Unpick Readonlyness before deleteing our pseudo-idp-home
---
 .../idp/installer/plugin/BasePluginTest.java       | 33 +++++-----------------
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/BasePluginTest.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/BasePluginTest.java
index c8524fd23..50188dfe2 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/BasePluginTest.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/BasePluginTest.java
@@ -30,6 +30,9 @@ import org.springframework.core.io.ClassPathResource;
 import org.testng.annotations.AfterSuite;
 import org.testng.annotations.BeforeSuite;
 
+import net.shibboleth.idp.installer.InstallerSupport;
+import net.shibboleth.idp.installer.plugin.impl.PluginInstaller;
+
 /**
  * set up state for testing.
  */
@@ -38,7 +41,7 @@ public class BasePluginTest {
 
     private static Logger log = LoggerFactory.getLogger(BasePluginTest.class);
     private static Path idpHome;
-    
+
     @BeforeSuite public void setupIdpHome() throws IOException {
         idpHome = Files.createTempDirectory("PluginTests");
         Path from = new ClassPathResource("idphome-test").getFile().toPath();
@@ -63,38 +66,16 @@ public class BasePluginTest {
             }
         });
     }
-    
+
     @AfterSuite public void teardownIdPHome() throws IOException {
-        
         if (idpHome == null) {
             return;
         }
-        
-        Files.walkFileTree(idpHome, new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                Files.delete(file);
-                log.trace("Deleted {}", file);
-                return FileVisitResult.CONTINUE;
-            }
-            
-            @Override
-            public FileVisitResult postVisitDirectory(Path directory, IOException exc) throws IOException {
-                try {
-                    log.trace("Deleting {}", directory);
-                    Files.delete(directory);
-                    log.trace("Deleted {}", directory);
-                }
-                catch (final IOException foo) {
-                    log.warn("Problem cleaning up {}",directory, foo);
-                }
-                return FileVisitResult.CONTINUE;
-            }
-        });
+        InstallerSupport.setReadOnly(idpHome, false);
+        PluginInstaller.deleteTree(idpHome);
     }
 
     protected Path getIdpHome() {
         return idpHome;
     }
-
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list