1 package org.tigris.scarab.test.mocks; 2 3 48 49 import org.apache.commons.configuration.Configuration; 50 import org.apache.fulcrum.InitializationException; 51 import org.apache.fulcrum.InstantiationException; 52 import org.apache.fulcrum.Service; 53 import org.apache.fulcrum.ServiceManager; 54 import org.apache.fulcrum.security.SecurityService; 55 import org.apache.log4j.Category; 56 import org.tigris.scarab.services.security.ScarabSecurity; 57 58 62 public class MockFulcrumServiceManager implements ServiceManager { 63 64 public MockFulcrumServiceManager() { 65 super(); 66 } 68 69 public void init() throws InitializationException { 70 72 } 73 74 public Configuration getConfiguration() { 75 return null; 77 } 78 79 public void setConfiguration(Configuration configuration) { 80 82 } 83 84 public void setApplicationRoot(String applicationRoot) { 85 87 } 88 89 public boolean isRegistered(String serviceName) { 90 return false; 92 } 93 94 public void initService(String name) throws InitializationException { 95 97 } 98 99 public void shutdownService(String name) { 100 102 } 103 104 public void shutdownServices() { 105 107 } 108 109 public Service getService(String name) throws InstantiationException { 110 if(name.equals(ScarabSecurity.SERVICE_NAME)){ 111 return new MockScarabSecurity(); 112 } 113 else if (name.equals(SecurityService.SERVICE_NAME)){ 114 return new MockSecurityService(); 115 } 116 throw new InstantiationException ("Couldn't create mock version of " + name); 117 } 118 119 public Configuration getConfiguration(String name) { 120 return null; 122 } 123 124 public void setServiceObject(String key, Object value) { 125 127 } 128 129 public Object getServiceObject(String key) { 130 return null; 132 } 133 134 public String getRealPath(String path) { 135 return null; 137 } 138 139 public String getApplicationRoot() { 140 return null; 142 } 143 144 public Category getCategory() { 145 return null; 147 } 148 149 } 150 | Popular Tags |