[java-idp-testbed COMMIT] in /trunk: pom.xml src/main/java/Main.java

noreply at shibboleth.net noreply at shibboleth.net
Wed Jul 9 19:02:09 EDT 2014


Author: tzeller
Date: Wed Jul  9 19:02:08 2014
New Revision: 274

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=274&view=rev
Log:
IDP-436 
- Move test certificates and keys in idp-conf from src/main/resources to src/test/resources
- Change 'idp.home' to 'classpath:' in the testbed and integration tests
- Override the path to the keystore used by Jetty in the testbed
- Add a classpath example metadata provider to idp-conf/src/test/resources

Modified:
    trunk/pom.xml
    trunk/src/main/java/Main.java

Modified: trunk/pom.xml
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/pom.xml?rev=274&r1=273&r2=274&view=diff
==============================================================================
--- trunk/pom.xml (original)
+++ trunk/pom.xml Wed Jul  9 19:02:08 2014
@@ -48,12 +48,12 @@
             <groupId>${idp.groupId}</groupId>
             <artifactId>idp-conf</artifactId>
             <version>${idp.version}</version>
+            <type>test-jar</type>
         </dependency>
         <dependency>
             <groupId>${idp.groupId}</groupId>
             <artifactId>idp-conf</artifactId>
             <version>${idp.version}</version>
-            <type>test-jar</type>
         </dependency>
 
         <dependency>

Modified: trunk/src/main/java/Main.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/main/java/Main.java?rev=274&r1=273&r2=274&view=diff
==============================================================================
--- trunk/src/main/java/Main.java (original)
+++ trunk/src/main/java/Main.java Wed Jul  9 19:02:08 2014
@@ -44,7 +44,9 @@
             final ProtectionDomain protectionDomain = Main.class.getProtectionDomain();
             final URL location = protectionDomain.getCodeSource().getLocation();
 
-            PathPropertySupport.setupIdPHomeProperties();
+            // Set idp.home to "classpath:" so test credentials in idp-conf/src/test/resources can be found.
+            // PathPropertySupport.setupIdPHomeProperties();
+            System.setProperty("idp.home", "classpath:");
 
             // Determine path to jetty-base in the idp-distribution module.
             final Path pathToJettyBase =
@@ -65,10 +67,14 @@
             }
 
             // The keystore path defined in jetty-base/start.d/idp.ini is relative to jetty.base, which is not correct
-            // for the testbed. So replace "../" with "${idp.home}/".
+            // for the testbed. So replace "../" with path to idp-conf/src/test/resources
+            final Path pathToIdPConfTestResources =
+                    Paths.get(Paths.get("").toAbsolutePath().getParent().toAbsolutePath().toString(),
+                            "java-identity-provider", "idp-conf", "src", "test", "resources");
             final String idpIniJettyKeystorePath = configuration.getProperties().get("jetty.keystore.path");
             final String testbedJettyKeystorePath =
-                    idpIniJettyKeystorePath.replace("../", System.getProperty(PathPropertySupport.IDP_HOME) + "/");
+                    idpIniJettyKeystorePath
+                            .replace("../", pathToIdPConfTestResources.toAbsolutePath().toString() + "/");
             configuration.getProperties().put("jetty.keystore.path", testbedJettyKeystorePath);
 
             // Configure the Jetty server (with both the XML and properties file configurations).



More information about the commits mailing list