[java-idp-testbed COMMIT] in /trunk/src: main/java/Main.java main/java/common/PathPropertySupport.java main/resources...

noreply at shibboleth.net noreply at shibboleth.net
Sat May 3 18:19:37 EDT 2014


Author: scantor
Date: Sat May  3 18:19:36 2014
New Revision: 212

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=212&view=rev
Log:
- handle idp.home on Windows by creating an unmolested idp.home.raw for use with path calls
- clean out some old files
- rename app.home to testbed.home

Modified:
    trunk/src/main/java/Main.java
    trunk/src/main/java/common/PathPropertySupport.java
    trunk/src/main/resources/system/conf/testbed-beans.xml
    trunk/src/main/resources/system/conf/testbed-ldap.xml
    trunk/src/main/resources/test/jetty-realm.properties
    trunk/src/main/webapp/WEB-INF/web.xml
    trunk/src/test/java/idp/AbstractFlowTest.java

Modified: trunk/src/main/java/Main.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/main/java/Main.java?rev=212&r1=211&r2=212&view=diff
==============================================================================
--- trunk/src/main/java/Main.java (original)
+++ trunk/src/main/java/Main.java Sat May  3 18:19:36 2014
@@ -20,7 +20,6 @@
 import java.nio.file.Paths;
 import java.security.ProtectionDomain;
 
-import org.eclipse.jetty.security.HashLoginService;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.util.resource.Resource;
 import org.eclipse.jetty.webapp.WebAppContext;
@@ -38,28 +37,21 @@
         try {
             // Hack. If protection domain location ends with ".war", then assume we are running from a CLI, otherwise
             // assume we are running from within Eclipse.
-            ProtectionDomain protectionDomain = Main.class.getProtectionDomain();
-            URL location = protectionDomain.getCodeSource().getLocation();
+            final ProtectionDomain protectionDomain = Main.class.getProtectionDomain();
+            final URL location = protectionDomain.getCodeSource().getLocation();
 
-            String idpHome = PathPropertySupport.setupIdPHomeProperty();
-
-            PathPropertySupport.setupIdPProperties(idpHome);
-            
-            PathPropertySupport.setupAppHomeProperty();
+            PathPropertySupport.setupIdPHomeProperties();
+            PathPropertySupport.setupIdPProperties();
+            PathPropertySupport.setupTestbedHomeProperty();
             
             // Configure Jetty from jetty.xml.
-            Path pathToJettyXML = Paths.get(idpHome, "system", "conf", "jetty.xml");
-            Resource fileserver_xml = Resource.newResource(pathToJettyXML.toString());
-            XmlConfiguration configuration = new XmlConfiguration(fileserver_xml.getInputStream());
-            Server server = (Server) configuration.configure();
+            final Path pathToJettyXML =
+                    Paths.get(System.getProperty(PathPropertySupport.IDP_HOME_RAW), "system", "conf", "jetty.xml");
+            final Resource fileserver_xml = Resource.newResource(pathToJettyXML.toString());
+            final XmlConfiguration configuration = new XmlConfiguration(fileserver_xml.getInputStream());
+            final Server server = (Server) configuration.configure();
 
-            Path pathToRealm = Paths.get(idpHome, "test", "jetty-realm.properties");
-            HashLoginService loginService = new HashLoginService();
-            loginService.setName("Shib Testbed Web Authentication");
-            loginService.setConfig(pathToRealm.toString());
-            server.addBean(loginService);
-
-            WebAppContext webapp = new WebAppContext();
+            final WebAppContext webapp = new WebAppContext();
             webapp.setContextPath("/");
             server.setHandler(webapp);
             if (protectionDomain.getCodeSource().getLocation().toString().endsWith(".war")) {
@@ -72,8 +64,9 @@
 
             server.start();
             server.join();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
-}
+    
+}

Modified: trunk/src/main/java/common/PathPropertySupport.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/main/java/common/PathPropertySupport.java?rev=212&r1=211&r2=212&view=diff
==============================================================================
--- trunk/src/main/java/common/PathPropertySupport.java (original)
+++ trunk/src/main/java/common/PathPropertySupport.java Sat May  3 18:19:36 2014
@@ -25,7 +25,6 @@
 import java.nio.file.Paths;
 import java.util.Properties;
 
-import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 /**
@@ -33,60 +32,65 @@
  */
 public class PathPropertySupport {
 
-    /** The name of the system property defining the path to configuration files for the IdP. Defaults to 'idp.home'. */
+    /** The name of the system property defining the normalized path to configuration files for the IdP. */
     public final static String IDP_HOME = "idp.home";
 
+    /** The name of the system property defining the raw path to configuration files for the IdP. */
+    public final static String IDP_HOME_RAW = "idp.home.raw";
+
+    /** The name of the system property defining the normalized path to testbed-only configuration. */

[... 234 lines stripped ...]


More information about the commits mailing list