Create JUnit tests
[java-idp.git] / tests / edu / internet2 / middleware / shibboleth / serviceprovider / TestContextInitializer.java
index b52b4d5..27d8a36 100644 (file)
@@ -1,6 +1,10 @@
 package edu.internet2.middleware.shibboleth.serviceprovider;
 
+import java.io.File;
+
+import edu.internet2.middleware.shibboleth.common.Credentials;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
+import edu.internet2.middleware.shibboleth.serviceprovider.ServiceProviderConfig.ApplicationInfo;
 
 public class TestContextInitializer extends SPTestCase {
        private static ServiceProviderContext context   = ServiceProviderContext.getInstance();
@@ -20,15 +24,19 @@ public class TestContextInitializer extends SPTestCase {
      * Load the typical sample configuration file from the usual place.
      */
        public void testStandardConfiguration() throws ShibbolethConfigurationException {
-               String configFileName = "file:///usr/local/shibboleth-sp/etc/sp.xml";
+               String configFileName = new File("data/spconfig.xml").toURI().toString();
                initServiceProvider(configFileName);
+               ServiceProviderConfig config = context.getServiceProviderConfig();
+               Credentials credentials = config.getCredentials();
+               ApplicationInfo appinfo = config.getApplication("default");
        }
     
+       
     /**
      * Try to load a URL that doesn't point to a file.
      */
        public void testBadConfigurationName() {
-               String configFileName = "file:///usr/local/shibboleth-sp/etc/spp.xml";
+               String configFileName = new File("data/spconfig-bogus.xml").toURI().toString();;
                try {
             initServiceProvider(configFileName);
             fail();