package edu.northwestern.bioinformatics.studycalendar.web.tools;

import edu.northwestern.bioinformatics.studycalendar.osgi.hostservices.HostBeans;
import edu.northwestern.bioinformatics.studycalendar.osgi.hostservices.internal.HostBeansImpl;
import edu.northwestern.bioinformatics.studycalendar.security.StubAuthenticationSystem;
import edu.northwestern.bioinformatics.studycalendar.security.plugin.AuthenticationSystem;
import edu.northwestern.bioinformatics.studycalendar.test.PscTestingBundleContext;
import org.acegisecurity.userdetails.UserDetailsService;
import org.acegisecurity.userdetails.memory.InMemoryDaoImpl;

/**
 * @author Rhett Sutphin
*/
public class WebTestingBundleContext extends PscTestingBundleContext {
    public WebTestingBundleContext() {
        reset();
    }

    public void reset() {
        testingDetails.clear();
        addService(AuthenticationSystem.class, new StubAuthenticationSystem());
        addService(HostBeans.class, new HostBeansImpl());
        addService(UserDetailsService.class, new InMemoryDaoImpl());
    }
}

@@ -236,16 +236,115 @@
 nsImpl;%0A
+import edu.northwestern.bioinformatics.studycalendar.security.FilterSecurityInterceptorConfigurer;%0A
 import e
@@ -415,32 +415,32 @@
 ticationSystem;%0A
-
 import edu.north
@@ -714,16 +714,213 @@
 DaoImpl;
+%0Aimport org.osgi.framework.InvalidSyntaxException;%0Aimport org.osgi.service.cm.Configuration;%0Aimport org.osgi.service.cm.ConfigurationAdmin;%0A%0Aimport java.io.IOException;%0Aimport java.util.Dictionary;
 %0A%0A/**%0A *
@@ -1271,24 +1271,24 @@
 ansImpl());%0A
-
         addS
@@ -1340,20 +1340,2097 @@
 DaoImpl());%0A
+        addService(ConfigurationAdmin.class, new MockConfigurationAdmin());%0A        addService(FilterSecurityInterceptorConfigurer.class, new FilterSecurityInterceptorConfigurer());%0A    %7D%0A%0A    private static class MockConfigurationAdmin implements ConfigurationAdmin %7B%0A        public Configuration createFactoryConfiguration(String s) throws IOException %7B%0A            return new MockConfiguration();%0A        %7D%0A%0A        public Configuration createFactoryConfiguration(String s, String s1) throws IOException %7B%0A            return new MockConfiguration();%0A        %7D%0A%0A        public Configuration getConfiguration(String s, String s1) throws IOException %7B%0A            return new MockConfiguration();%0A        %7D%0A%0A        public Configuration getConfiguration(String s) throws IOException %7B%0A            return new MockConfiguration();%0A        %7D%0A%0A        public Configuration%5B%5D listConfigurations(String s) throws IOException, InvalidSyntaxException %7B%0A            return new Configuration%5B%5D %7B new MockConfiguration() %7D;%0A        %7D%0A    %7D%0A%0A    private static class MockConfiguration implements Configuration %7B%0A        public String getPid() %7B%0A            throw new UnsupportedOperationException(%22getPid not implemented%22);%0A        %7D%0A%0A        public Dictionary getProperties() %7B%0A            throw new UnsupportedOperationException(%22getProperties not implemented%22);%0A        %7D%0A%0A        public void update(Dictionary dictionary) throws IOException %7B%0A            // do nothing%0A        %7D%0A%0A        public void delete() throws IOException %7B%0A            // do nothing%0A        %7D%0A%0A        public String getFactoryPid() %7B%0A            throw new UnsupportedOperationException(%22getFactoryPid not implemented%22);%0A        %7D%0A%0A        public void update() throws IOException %7B%0A            // do nothing%0A        %7D%0A%0A        public void setBundleLocation(String s) %7B%0A            throw new UnsupportedOperationException(%22setBundleLocation not implemented%22);%0A        %7D%0A%0A        public String getBundleLocation() %7B%0A            throw new UnsupportedOperationException(%22getBundleLocation not implemented%22);%0A        %7D%0A
     %7D%0A%7D%0A

Add more beans to testing context. #597.