Remove code replaced by ShibbolethRunner
[java-idp.git] / tests / edu / internet2 / middleware / shibboleth / serviceprovider / TestContextInitializer.java
1 package edu.internet2.middleware.shibboleth.serviceprovider;
2
3 import java.io.File;
4
5 import edu.internet2.middleware.shibboleth.common.Credentials;
6 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
7 import edu.internet2.middleware.shibboleth.serviceprovider.ServiceProviderConfig.ApplicationInfo;
8
9 public class TestContextInitializer extends SPTestCase {
10         
11     /**
12      * Load the typical sample configuration file from the usual place.
13      */
14         public void testStandardConfiguration() throws ShibbolethConfigurationException {
15                 String configFileName = new File("data/spconfig.xml").toURI().toString();
16                 initServiceProvider(configFileName);
17                 ServiceProviderConfig config = context.getServiceProviderConfig();
18                 Credentials credentials = config.getCredentials();
19                 ApplicationInfo appinfo = config.getApplication("default");
20         }
21     
22         
23     /**
24      * Try to load a URL that doesn't point to a file.
25      */
26         public void testBadConfigurationName() {
27                 String configFileName = new File("data/spconfig-bogus.xml").toURI().toString();;
28                 try {
29             initServiceProvider(configFileName);
30             fail();
31         } catch (ShibbolethConfigurationException e) {
32             // Expected result
33         }
34         }
35 }