[java-idp-integration-tests] branch master updated: IDP-923 - Set java.io.tmpdir system property.

Tom Zeller tzeller at dragonacea.biz
Tue May 31 18:59:58 EDT 2016


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

tzeller pushed a commit to branch master
in repository java-idp-integration-tests.

The following commit(s) were added to refs/heads/master by this push:
       new  17dab82   IDP-923 - Set java.io.tmpdir system property.
17dab82 is described below

commit 17dab82c69a31ecc27c48fa226aa4e52727dd2e6
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Tue May 31 17:59:05 2016 -0500

    IDP-923 - Set java.io.tmpdir system property.
    
    Set Java's default temp path to ${jetty.base}/tmp/ via command line
    option to the process that starts Jetty. We could set the system
    property in start.ini, but that causes a forked Jetty process to be
    started.
---
 .../net/shibboleth/idp/test/BaseIntegrationTest.java    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
index 257c715..3a7879e 100644
--- a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
@@ -260,6 +260,9 @@ public abstract class BaseIntegrationTest
     /** Path to jetty.home. */
     @NonnullAfterInit protected Path pathToJettyHome;
 
+    /** Path to tmp directory. */
+    @NonnullAfterInit protected Path pathToTmpDir;
+
     /** Pattern used when creating per test idp.home directory. Defaults to yyyyMMdd-HHmmssSS. **/
     @Nullable protected String idpHomePattern = "yyyyMMdd-HHmmssSS";
 
@@ -385,6 +388,10 @@ public abstract class BaseIntegrationTest
         // Path to conf/ldap.properties
         pathToLDAPProperties = Paths.get(pathToIdPHome.toAbsolutePath().toString(), "conf", "ldap.properties");
         Assert.assertTrue(pathToLDAPProperties.toFile().exists(), "Path to conf/ldap.properties not found");
+
+        // Path to jetty.base/tmp
+        pathToTmpDir = pathToJettyBase.resolve("tmp");
+        Assert.assertTrue(pathToTmpDir.toFile().exists(), "Path to tmp/ not found");
     }
 
     /**
@@ -557,6 +564,16 @@ public abstract class BaseIntegrationTest
     }
 
     /**
+     * Set default temp file path.
+     * 
+     * @throws Exception
+     */
+    @BeforeClass(enabled = true, dependsOnMethods = {"setUpPaths"})
+    public void setUpTmpDir() throws Exception {
+        serverCommands.add("-Djava.io.tmpdir=" + pathToTmpDir.toAbsolutePath().toFile());
+    }
+
+    /**
      * Set the {@link #IDP_XML_SECURITY_MANAGER_PROP_NAME} property to {@link #IDP_XML_SECURITY_MANAGER_PROP_VALUE}.
      * Save the previous value.
      */

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


More information about the commits mailing list