portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1536817 [3/4] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-capability/src/main/java/org/apache/jetspeed/capabilities/impl/ components/jetspeed-capability/src/test/java/org/apache/jetspeed/capabilities/ components/jetspeed-cm/...
Date Tue, 29 Oct 2013 17:11:31 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/openid/OpenIDRelayingPartyServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/openid/OpenIDRelayingPartyServlet.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/openid/OpenIDRelayingPartyServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/openid/OpenIDRelayingPartyServlet.java Tue Oct 29 17:11:29 2013
@@ -16,23 +16,34 @@
  */
 package org.apache.jetspeed.openid;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-
-import javax.security.auth.Subject;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
+import com.google.step2.discovery.DefaultHostMetaFetcher;
+import com.google.step2.discovery.Discovery2;
+import com.google.step2.discovery.HostMetaFetcher;
+import com.google.step2.discovery.IdpIdentifier;
+import com.google.step2.discovery.LegacyXrdsResolver;
+import com.google.step2.discovery.ParallelHostMetaFetcher;
+import com.google.step2.discovery.SecureDiscoveryInformation;
+import com.google.step2.discovery.SecureUrlIdentifier;
+import com.google.step2.discovery.XrdDiscoveryResolver;
+import com.google.step2.http.DefaultHttpFetcher;
+import com.google.step2.xmlsimplesign.CachedCertPathValidator;
+import com.google.step2.xmlsimplesign.CertValidator;
+import com.google.step2.xmlsimplesign.DefaultCertValidator;
+import com.google.step2.xmlsimplesign.DefaultTrustRootsProvider;
+import com.google.step2.xmlsimplesign.TrustRootsProvider;
+import com.google.step2.xmlsimplesign.Verifier;
+import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.administration.PortalAuthenticationConfiguration;
+import org.apache.jetspeed.audit.AuditActivity;
+import org.apache.jetspeed.cache.UserContentCacheManager;
+import org.apache.jetspeed.components.ComponentManager;
+import org.apache.jetspeed.openid.step2.GoogleHostMetaFetcher;
+import org.apache.jetspeed.security.SecurityAttribute;
+import org.apache.jetspeed.security.SecurityAttributes;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.UserManager;
 import org.openid4java.OpenIDException;
 import org.openid4java.consumer.ConsumerManager;
 import org.openid4java.consumer.VerificationResult;
@@ -52,41 +63,25 @@ import org.openid4java.message.ax.FetchR
 import org.openid4java.message.sreg.SRegMessage;
 import org.openid4java.message.sreg.SRegRequest;
 import org.openid4java.message.sreg.SRegResponse;
-
-import org.apache.jetspeed.Jetspeed;
-import org.apache.jetspeed.PortalReservedParameters;
-import org.apache.jetspeed.administration.PortalAdministration;
-import org.apache.jetspeed.administration.PortalAuthenticationConfiguration;
-import org.apache.jetspeed.audit.AuditActivity;
-import org.apache.jetspeed.cache.UserContentCacheManager;
-import org.apache.jetspeed.components.ComponentManager;
-import org.apache.jetspeed.openid.OpenIDRegistrationConfiguration;
-import org.apache.jetspeed.openid.step2.GoogleHostMetaFetcher;
-import org.apache.jetspeed.security.SecurityAttribute;
-import org.apache.jetspeed.security.SecurityAttributes;
-import org.apache.jetspeed.security.User;
-import org.apache.jetspeed.security.UserManager;
-
-import com.google.step2.discovery.DefaultHostMetaFetcher;
-import com.google.step2.discovery.Discovery2;
-import com.google.step2.discovery.HostMetaFetcher;
-import com.google.step2.discovery.IdpIdentifier;
-import com.google.step2.discovery.LegacyXrdsResolver;
-import com.google.step2.discovery.ParallelHostMetaFetcher;
-import com.google.step2.discovery.SecureDiscoveryInformation;
-import com.google.step2.discovery.SecureUrlIdentifier;
-import com.google.step2.discovery.XrdDiscoveryResolver;
-import com.google.step2.http.DefaultHttpFetcher;
-import com.google.step2.xmlsimplesign.CachedCertPathValidator;
-import com.google.step2.xmlsimplesign.CertValidator;
-import com.google.step2.xmlsimplesign.DefaultCertValidator;
-import com.google.step2.xmlsimplesign.DefaultTrustRootsProvider;
-import com.google.step2.xmlsimplesign.TrustRootsProvider;
-import com.google.step2.xmlsimplesign.Verifier;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.security.auth.Subject;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+
 /**
  * Serves OpenID Relaying Party metadata and accepts
  * authorization from OpenID provider.
@@ -177,11 +172,11 @@ public class OpenIDRelayingPartyServlet 
         
         // configure portal components
         ComponentManager cm = Jetspeed.getComponentManager();
-        portalUserManager = (UserManager)cm.getComponent("org.apache.jetspeed.security.UserManager");
-        portalAdministration = (PortalAdministration)cm.getComponent("PortalAdministration");
-        portalAudit = (AuditActivity)cm.getComponent("org.apache.jetspeed.audit.AuditActivity");        
-        portalAuthenticationConfiguration = (PortalAuthenticationConfiguration)cm.getComponent("org.apache.jetspeed.administration.PortalAuthenticationConfiguration");
-        portalUserContentCacheManager = (UserContentCacheManager)cm.getComponent("userContentCacheManager");
+        portalUserManager = cm.lookupComponent("org.apache.jetspeed.security.UserManager");
+        portalAdministration = cm.lookupComponent("PortalAdministration");
+        portalAudit = cm.lookupComponent("org.apache.jetspeed.audit.AuditActivity");
+        portalAuthenticationConfiguration = cm.lookupComponent("org.apache.jetspeed.administration.PortalAuthenticationConfiguration");
+        portalUserContentCacheManager = cm.lookupComponent("userContentCacheManager");
 
         // registration configuration parameters
         if (Boolean.parseBoolean(config.getInitParameter(OpenIDConstants.ENABLE_REGISTRATION_CONFIG_INIT_PARAM_NAME)))

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/JetspeedPipelineMapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/JetspeedPipelineMapper.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/JetspeedPipelineMapper.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/JetspeedPipelineMapper.java Tue Oct 29 17:11:29 2013
@@ -16,12 +16,12 @@
  */
 package org.apache.jetspeed.pipeline;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.ComponentManager;
 
+import java.util.HashMap;
+import java.util.Map;
+
 
 /**
  * JetspeedPipelineMapper
@@ -85,7 +85,7 @@ public class JetspeedPipelineMapper impl
             return null;
         }
         
-        return (Pipeline) componentManager.getComponent(pipelineId);
+        return componentManager.lookupComponent(pipelineId);
     }
     
     public String getMappedPathByPipelineId(String pipelineId)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java Tue Oct 29 17:11:29 2013
@@ -137,7 +137,7 @@ public class JetspeedRequestContext impl
             PortalRequestFactory prf = null;
             try
             {
-                prf = (PortalRequestFactory)Jetspeed.getComponentManager().getComponent(PortalRequestFactory.class);
+                prf = Jetspeed.getComponentManager().lookupComponent(PortalRequestFactory.class);
             }
             catch (Throwable t)
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/LoginValidationValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/LoginValidationValveImpl.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/LoginValidationValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/LoginValidationValveImpl.java Tue Oct 29 17:11:29 2013
@@ -16,12 +16,6 @@
  */
 package org.apache.jetspeed.security.impl;
 
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.login.LoginConstants;
 import org.apache.jetspeed.pipeline.PipelineException;
@@ -34,6 +28,12 @@ import org.apache.jetspeed.security.Subj
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserCredential;
 import org.apache.jetspeed.security.UserManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
 
 /**
  * LoginValidationValve
@@ -102,7 +102,7 @@ public class LoginValidationValveImpl ex
                     String userName = (String)request.getSessionAttribute(LoginConstants.USERNAME);
                     if ( userName != null && !userName.equals(""))
                     {
-                        UserManager um = (UserManager)Jetspeed.getComponentManager().getComponent(UserManager.class);
+                        UserManager um = Jetspeed.getComponentManager().lookupComponent(UserManager.class);
                         if ( um != null )
                         {
                             User user = null;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/cas/CASPortalFilter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/cas/CASPortalFilter.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/cas/CASPortalFilter.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/cas/CASPortalFilter.java Tue Oct 29 17:11:29 2013
@@ -16,20 +16,6 @@
  */
 package org.apache.jetspeed.security.impl.cas;
 
-import java.io.IOException;
-import java.security.Principal;
-import java.util.List;
-
-import javax.security.auth.Subject;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalAdministration;
@@ -45,6 +31,19 @@ import org.apache.jetspeed.security.Subj
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
 
+import javax.security.auth.Subject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.List;
+
 
 public class CASPortalFilter implements Filter
 {
@@ -68,13 +67,13 @@ public class CASPortalFilter implements 
         {
             request = (HttpServletRequest)sRequest;
             ComponentManager cm = Jetspeed.getComponentManager();
-            UserManager userManager = (UserManager)cm.getComponent("org.apache.jetspeed.security.UserManager");
+            UserManager userManager = cm.lookupComponent("org.apache.jetspeed.security.UserManager");
             HttpSession session = request.getSession(true);
     		String userName = (String) session.getAttribute(CAS_FILTER_USER);	
     		System.out.println("user: " + userName); 
     		
-    		RoleManager roleManager = (RoleManager)cm.getComponent("org.apache.jetspeed.security.RoleManager");
-    		GroupManager groupManager = (GroupManager)cm.getComponent("org.apache.jetspeed.security.GroupManager");           
+    		RoleManager roleManager = cm.lookupComponent("org.apache.jetspeed.security.RoleManager");
+    		GroupManager groupManager = cm.lookupComponent("org.apache.jetspeed.security.GroupManager");
      		
     		User user = null;
     		try {
@@ -83,7 +82,7 @@ public class CASPortalFilter implements 
     		catch (SecurityException e) 
     		{
 				System.out.println("user: " + userName + " not in j2 db"); 
-				PortalAdministration portalAdministration = (PortalAdministration)cm.getComponent("PortalAdministration");
+				PortalAdministration portalAdministration = cm.lookupComponent("PortalAdministration");
 				try {
 					List roles = roleManager.getRoles("user");
 					List groups = groupManager.getGroups("");

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java Tue Oct 29 17:11:29 2013
@@ -16,19 +16,6 @@
  */
 package org.apache.jetspeed.security.impl.shibboleth;
 
-import java.io.IOException;
-import java.security.Principal;
-
-import javax.security.auth.Subject;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalAuthenticationConfiguration;
@@ -45,6 +32,18 @@ import org.apache.jetspeed.security.User
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.security.UserSubjectPrincipal;
 
+import javax.security.auth.Subject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.security.Principal;
+
 public class ShibbolethPortalFilter implements Filter
 {
 	protected String userNameHeader;
@@ -57,7 +56,7 @@ public class ShibbolethPortalFilter impl
 	public void doFilter(ServletRequest sRequest, ServletResponse sResponse, FilterChain filterChain) throws IOException, ServletException
 	{
         ComponentManager cm = Jetspeed.getComponentManager();
-		AuthenticationProvider authProvider = (AuthenticationProvider) cm.getComponent("org.apache.jetspeed.security.AuthenticationProvider");
+		AuthenticationProvider authProvider = cm.lookupComponent("org.apache.jetspeed.security.AuthenticationProvider");
 		if (sRequest instanceof HttpServletRequest)
 		{
 			HttpServletRequest request = (HttpServletRequest) sRequest;
@@ -66,8 +65,7 @@ public class ShibbolethPortalFilter impl
 			{
 				synchronized (sem)
 				{
-					ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
-							"org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
+					ShibbolethConfiguration config = cm.lookupComponent("org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
 					userNameHeader = config.getHeaderMapping().get(ShibbolethConfiguration.USERNAME);
 				}
 			}
@@ -91,9 +89,9 @@ public class ShibbolethPortalFilter impl
 						}
 					}
 				}
-				UserManager userManager = (UserManager) cm.getComponent("org.apache.jetspeed.security.UserManager");
-				AuditActivity audit = (AuditActivity) cm.getComponent("org.apache.jetspeed.audit.AuditActivity");
-				ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
+				UserManager userManager = cm.lookupComponent("org.apache.jetspeed.security.UserManager");
+				AuditActivity audit = cm.lookupComponent("org.apache.jetspeed.audit.AuditActivity");
+				ShibbolethConfiguration config = cm.lookupComponent(
 						"org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
 				boolean success = false;
 				if (config.isAuthenticate())
@@ -128,15 +126,15 @@ public class ShibbolethPortalFilter impl
 				if (success)
 				{
 					audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_SUCCESS, "ShibbolethFilter");
-					PortalAuthenticationConfiguration authenticationConfiguration = (PortalAuthenticationConfiguration)
-							cm.getComponent("org.apache.jetspeed.administration.PortalAuthenticationConfiguration");
+					PortalAuthenticationConfiguration authenticationConfiguration =
+							cm.lookupComponent("org.apache.jetspeed.administration.PortalAuthenticationConfiguration");
 					if (authenticationConfiguration.isCreateNewSessionOnLogin() && httpSession != null && !httpSession.isNew())
 					{
 						request.getSession().invalidate();
 					}
 					else
 					{
-                        UserContentCacheManager userContentCacheManager = (UserContentCacheManager)cm.getComponent("userContentCacheManager");
+                        UserContentCacheManager userContentCacheManager = cm.lookupComponent("userContentCacheManager");
                         userContentCacheManager.evictUserContentCache(username, request.getSession().getId());
 					}
 					subject = null;
@@ -170,7 +168,7 @@ public class ShibbolethPortalFilter impl
 				if (subject != null)
 				{
 					Principal principal = SubjectHelper.getPrincipal(subject, User.class);
-					ShibbolethConfiguration config = (ShibbolethConfiguration) Jetspeed.getComponentManager().getComponent(
+					ShibbolethConfiguration config = Jetspeed.getComponentManager().lookupComponent(
 							"org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
 					if (principal != null && principal.getName().equals(config.getGuestUser()))
 					{

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java Tue Oct 29 17:11:29 2013
@@ -767,7 +767,7 @@ public class JetspeedPowerToolImpl imple
 
     public Object getComponent(String name)
     {
-        return Jetspeed.getComponentManager().getComponent(name);
+        return Jetspeed.getComponentManager().lookupComponent(name);
     }
 
     public String getAbsoluteUrl(String relativePath)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java Tue Oct 29 17:11:29 2013
@@ -160,7 +160,7 @@ public class JetspeedVelocityViewServlet
             count++;
         
         }
-        decorationLocator = (TemplateLocator) cm.getComponent("DecorationLocator");
+        decorationLocator = cm.lookupComponent("DecorationLocator");
 
         // initialize thread safe velocity engine cache
         int cacheSize = (int) getLongInitParameter(config, CACHE_SIZE_PARAMETER, DEFAULT_CACHE_SIZE);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java Tue Oct 29 17:11:29 2013
@@ -17,13 +17,13 @@
 package org.apache.jetspeed;
 
 
+import org.apache.jetspeed.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.components.util.TransactionCacheEnabledSpringTestCase;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.jetspeed.components.portletregistry.PortletRegistry;
-import org.apache.jetspeed.components.util.TransactionCacheEnabledSpringTestCase;
-
 public class AbstractRequestContextTestCase extends TransactionCacheEnabledSpringTestCase
 {
     protected PortletRegistry portletRegistry;
@@ -31,7 +31,7 @@ public class AbstractRequestContextTestC
     protected void setUp() throws Exception
     {       
         super.setUp();
-        portletRegistry = (PortletRegistry) scm.getComponent("portletRegistry");
+        portletRegistry = scm.lookupComponent("portletRegistry");
     }   
     
     protected String[] getConfigurations()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestAggregator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestAggregator.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestAggregator.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestAggregator.java Tue Oct 29 17:11:29 2013
@@ -16,20 +16,12 @@
  */
 package org.apache.jetspeed.aggregator;
 
-import java.io.File;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import javax.security.auth.Subject;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.mock.web.MockServletConfig;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.capabilities.Capabilities;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
@@ -47,15 +39,19 @@ import org.apache.jetspeed.request.Reque
 import org.apache.jetspeed.request.RequestContextComponent;
 import org.apache.jetspeed.security.JSSubject;
 import org.apache.jetspeed.security.JetspeedSubjectFactory;
-import org.apache.jetspeed.security.SubjectHelper;
 import org.apache.jetspeed.security.impl.UserImpl;
 import org.apache.jetspeed.test.JetspeedTestCase;
 import org.apache.jetspeed.testhelpers.SpringEngineHelper;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.mock.web.MockServletConfig;
+import javax.security.auth.Subject;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 /**
  * <P>Test the aggregation service</P>
@@ -108,22 +104,21 @@ public class TestAggregator extends Jets
         engineHelper.setUp(getBaseDir());
         engine = (Engine) context.get(SpringEngineHelper.ENGINE_ATTR);
 
-        pageAggregator = (PageAggregator) engine.getComponentManager().getComponent(PageAggregator.class);
-        asyncPageAggregator = 
-            (PageAggregator) engine.getComponentManager().getComponent("org.apache.jetspeed.aggregator.AsyncPageAggregator");
-        portletAggregator = (PortletAggregator) engine.getComponentManager().getComponent(PortletAggregator.class);
+        pageAggregator = engine.getComponentManager().lookupComponent(PageAggregator.class);
+        asyncPageAggregator =
+                engine.getComponentManager().lookupComponent("org.apache.jetspeed.aggregator.AsyncPageAggregator");
+        portletAggregator = engine.getComponentManager().lookupComponent(PortletAggregator.class);
         
-        profiler = (Profiler) engine.getComponentManager().getComponent(Profiler.class);
-        capabilities = (Capabilities) engine.getComponentManager().getComponent(Capabilities.class);
-        navComponent = 
-            (NavigationalStateComponent) engine.getComponentManager().getComponent(NavigationalStateComponent.class);
+        profiler = engine.getComponentManager().lookupComponent(Profiler.class);
+        capabilities = engine.getComponentManager().lookupComponent(Capabilities.class);
+        navComponent = engine.getComponentManager().lookupComponent(NavigationalStateComponent.class);
 
         servletConfig = engine.getServletConfig();
         servletContext = servletConfig.getServletContext();
 
-        portletRegistry = (PortletRegistry) engine.getComponentManager().getComponent("portletRegistry");
-        portletFactory = (PortletFactory) engine.getComponentManager().getComponent("portletFactory");
-        rcc = (RequestContextComponent) engine.getComponentManager().getComponent("org.apache.jetspeed.request.RequestContextComponent");
+        portletRegistry = engine.getComponentManager().lookupComponent("portletRegistry");
+        portletFactory = engine.getComponentManager().lookupComponent("portletFactory");
+        rcc = engine.getComponentManager().lookupComponent("org.apache.jetspeed.request.RequestContextComponent");
 
         File paRootDir = null;
         paRootDir = new File("../../layout-portlets/target/jetspeed-layout-portlets");
@@ -136,7 +131,7 @@ public class TestAggregator extends Jets
         initPA("j2-admin", "/j2-admin", paRootDir);
  
         // j2-admin portlet needs user manager component, but the followings does not effect..
-//        userManager = (UserManager) engine.getComponentManager().getComponent(UserManager.class);
+//        userManager = (UserManager) engine.getComponentManager().lookupComponent(UserManager.class);
 //        paContext.setAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT, userManager);
 //        assertEquals(userManager, paContext.getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT));
     }
@@ -195,10 +190,10 @@ public class TestAggregator extends Jets
                 {
                     try {
                         PageManager pageManager = 
-                            (PageManager) engine.getComponentManager().getComponent(PageManager.class);
+                            engine.getComponentManager().lookupComponent(PageManager.class);
                         Page page = pageManager.getPage(testPage);
                         PageLayoutComponent pageLayoutComponent = 
-                            (PageLayoutComponent) engine.getComponentManager().getComponent(PageLayoutComponent.class);
+                            engine.getComponentManager().lookupComponent(PageLayoutComponent.class);
                         assertNotNull(page);
                         requestContext.setPage(pageLayoutComponent.newContentPage(page, null, null));
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java Tue Oct 29 17:11:29 2013
@@ -43,7 +43,7 @@ public class TestCluster extends Datasou
     {
         super.setUp();
 
-        single = (NodeManager) scm.getComponent("org.apache.jetspeed.cluster.NodeManager");
+        single = scm.lookupComponent("org.apache.jetspeed.cluster.NodeManager");
     }
   
     public static Test suite()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/TestNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/TestNavigationalState.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/TestNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/TestNavigationalState.java Tue Oct 29 17:11:29 2013
@@ -16,17 +16,10 @@
  */
 package org.apache.jetspeed.container.state;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-import javax.servlet.http.HttpServletRequest;
-
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpSession;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
 import org.apache.jetspeed.PortalContext;
 import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.container.PortletWindow;
@@ -43,8 +36,12 @@ import org.apache.jetspeed.test.Jetspeed
 import org.apache.jetspeed.testhelpers.SpringEngineHelper;
 import org.apache.jetspeed.window.MockPortletWindow;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpSession;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * TestPortletContainer
@@ -89,9 +86,9 @@ public class TestNavigationalState exten
         engineHelper = new SpringEngineHelper(context);
         engineHelper.setUp(getBaseDir());
         engine = (Engine) context.get(SpringEngineHelper.ENGINE_ATTR);
-        codec = (NavigationalStateCodec) engine.getComponentManager().getComponent("NavigationalStateCodec");
-        portalContext = (PortalContext) engine.getComponentManager().getComponent("PortalContext");  
-        cache = (JetspeedContentCache) engine.getComponentManager().getComponent("portletContentCache");
+        codec = engine.getComponentManager().lookupComponent("NavigationalStateCodec");
+        portalContext = engine.getComponentManager().lookupComponent("PortalContext");
+        cache = engine.getComponentManager().lookupComponent("portletContentCache");
     }
 
     public static Test suite()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java Tue Oct 29 17:11:29 2013
@@ -16,12 +16,12 @@
  */
 package org.apache.jetspeed.engine;
 
-import java.util.HashMap;
-
 import org.apache.jetspeed.components.ComponentManagement;
 import org.apache.jetspeed.test.JetspeedTestCase;
 import org.apache.jetspeed.testhelpers.SpringEngineHelper;
 
+import java.util.HashMap;
+
 /**
  * <p>
  * AbstractEngineTest
@@ -84,8 +84,8 @@ public abstract class AbstractEngineTest
         ComponentManagement cm = engine.getComponentManager();
         for (int i = 0; i < keys.length; i++)
         {
-            assertNotNull("Could not get component insatance " + keys[i], cm.getComponent(keys[i]));
-            System.out.println("Load componenet " + cm.getComponent(keys[i]).getClass() + " for key " + keys[i]);
+            assertNotNull("Could not get component instance " + keys[i], cm.getComponent(keys[i]));
+            System.out.println("Load component " + cm.getComponent(keys[i]).getClass() + " for key " + keys[i]);
         }
     }
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestConstraintsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestConstraintsAction.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestConstraintsAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestConstraintsAction.java Tue Oct 29 17:11:29 2013
@@ -16,14 +16,11 @@
  */
 package org.apache.jetspeed.layout;
 
-import java.io.File;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.mock.web.MockServletConfig;
+import com.mockrunner.mock.web.MockServletContext;
 import org.apache.jetspeed.components.ComponentManager;
 import org.apache.jetspeed.components.SpringComponentManager;
 import org.apache.jetspeed.components.factorybeans.ServletConfigFactoryBean;
@@ -45,11 +42,12 @@ import org.apache.jetspeed.test.Jetspeed
 import org.apache.jetspeed.testhelpers.AbstractTestPrincipal;
 import org.jmock.Mock;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.mock.web.MockServletConfig;
-import com.mockrunner.mock.web.MockServletContext;
+import javax.security.auth.Subject;
+import java.io.File;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Test Security Constraints Manipulation
@@ -94,8 +92,8 @@ public class TestConstraintsAction exten
                 
         cm = new SpringComponentManager(null, bootConfigs, appConfigs, servletContent, getBaseDir());
         cm.start();
-        valve = (LayoutValve) cm.getComponent("layoutValve");
-        pageManager = (PageManager) cm.getComponent("pageManager");
+        valve = cm.lookupComponent("layoutValve");
+        pageManager = cm.lookupComponent("pageManager");
     }
 
     protected void tearDown() throws Exception

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestLayout.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestLayout.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestLayout.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/TestLayout.java Tue Oct 29 17:11:29 2013
@@ -16,8 +16,7 @@
  */
 package org.apache.jetspeed.layout;
 
-import java.io.File;
-
+import com.mockrunner.mock.web.MockServletConfig;
 import org.apache.jetspeed.components.ComponentManager;
 import org.apache.jetspeed.components.SpringComponentManager;
 import org.apache.jetspeed.components.factorybeans.ServletConfigFactoryBean;
@@ -27,7 +26,7 @@ import org.apache.jetspeed.pipeline.Pipe
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.test.JetspeedTestCase;
 
-import com.mockrunner.mock.web.MockServletConfig;
+import java.io.File;
 
 /**
  * Test for Fragment placement
@@ -70,7 +69,7 @@ public class TestLayout extends Jetspeed
                 
         cm = new SpringComponentManager(null, bootConfigs, appConfigs, servletContent, ".");
         cm.start();
-        valve = (LayoutValve) cm.getComponent("layoutValve");
+        valve = cm.lookupComponent("layoutValve");
     }
 
     protected void tearDown() throws Exception

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/services/rest/TestPageLayoutService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/services/rest/TestPageLayoutService.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/services/rest/TestPageLayoutService.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/services/rest/TestPageLayoutService.java Tue Oct 29 17:11:29 2013
@@ -16,14 +16,11 @@
  */
 package org.apache.jetspeed.services.rest;
 
-import java.io.File;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-import javax.servlet.http.HttpServletRequest;
-
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.mock.web.MockServletConfig;
+import com.mockrunner.mock.web.MockServletContext;
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.components.ComponentManager;
 import org.apache.jetspeed.components.SpringComponentManager;
@@ -55,11 +52,12 @@ import org.jmock.core.constraint.IsEqual
 import org.jmock.core.matcher.InvokeAtLeastOnceMatcher;
 import org.jmock.core.stub.ReturnStub;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.mock.web.MockServletConfig;
-import com.mockrunner.mock.web.MockServletContext;
+import javax.security.auth.Subject;
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Test Page Layout REST Service
@@ -110,10 +108,10 @@ public class TestPageLayoutService exten
         cm = new SpringComponentManager(null, bootConfigs, appConfigs, servletContent, getBaseDir());
         cm.addComponent("javax.servlet.ServletConfig", servletConfig);
         cm.start();
-        valve = (LayoutValve) cm.getComponent("layoutValve");
-        pageManager = (PageManager) cm.getComponent("pageManager");
+        valve = cm.lookupComponent("layoutValve");
+        pageManager = cm.lookupComponent("pageManager");
         assertNotNull(pageManager);
-        layoutManager = (PageLayoutComponent)cm.getComponent("org.apache.jetspeed.layout.PageLayoutComponent");
+        layoutManager = cm.lookupComponent("org.apache.jetspeed.layout.PageLayoutComponent");
         assertNotNull(layoutManager);
 
         portletRegistry = createMockPortletRegistry();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManagerServer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManagerServer.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManagerServer.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManagerServer.java Tue Oct 29 17:11:29 2013
@@ -16,13 +16,6 @@
  */
 package org.apache.jetspeed.tools.pamanager;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.JexlHelper;
 import org.apache.commons.jexl.Script;
@@ -35,6 +28,13 @@ import org.apache.jetspeed.components.jn
 import org.apache.jetspeed.components.portletregistry.RegistryException;
 import org.apache.jetspeed.util.DirectoryHelper;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * PortletApplicationManagerServer
  * 
@@ -107,7 +107,7 @@ public class PortletApplicationManagerSe
         scm.start();
 
         // access portal application manager
-        portletApplicationManager = (PortletApplicationManagement)scm.getComponent("PAM");
+        portletApplicationManager = scm.lookupComponent("PAM");
         
         // create jexl context
         jexlContext = JexlHelper.createContext();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletApplicationManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletApplicationManager.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletApplicationManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletApplicationManager.java Tue Oct 29 17:11:29 2013
@@ -16,11 +16,24 @@
  */
 package org.apache.jetspeed.tools.pamanager;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.AbstractRequestContextTestCase;
+import org.apache.jetspeed.components.portletregistry.RegistryException;
+import org.apache.jetspeed.security.RoleManager;
+import org.apache.jetspeed.security.SecurityDomain;
+import org.apache.jetspeed.security.impl.SecurityDomainImpl;
+import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
+import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
+
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.InputStreamReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -31,20 +44,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.AbstractRequestContextTestCase;
-import org.apache.jetspeed.components.portletregistry.RegistryException;
-import org.apache.jetspeed.security.RoleManager;
-import org.apache.jetspeed.security.SecurityDomain;
-import org.apache.jetspeed.security.impl.SecurityDomainImpl;
-import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
-import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
 public class TestPortletApplicationManager extends AbstractRequestContextTestCase
 {
     private static final Log log = LogFactory.getLog(TestPortletApplicationManager.class);
@@ -154,10 +153,10 @@ public class TestPortletApplicationManag
 
         // setup test
         super.setUp();
-        portletApplicationManager = (PortletApplicationManagement)scm.getComponent("PAM");
+        portletApplicationManager = scm.lookupComponent("PAM");
         assertTrue(portletApplicationManager.isStarted());
-        Class<?> portletApplicationManagerClass = scm.getComponent("org.apache.jetspeed.tools.pamanager.PortletApplicationManager").getClass();
-        log.info("PortletApplicationManager class: "+portletApplicationManagerClass.getSimpleName());
+        Class<?> portletApplicationManagerClass = scm.lookupComponent("org.apache.jetspeed.tools.pamanager.PortletApplicationManager").getClass();
+        log.info("PortletApplicationManager class: " + portletApplicationManagerClass.getSimpleName());
         // unregister portlet application
         try
         {
@@ -168,15 +167,15 @@ public class TestPortletApplicationManag
         }
         // create standard default security domain and user role as necessary
         // for portlet application permissions
-        SecurityDomainAccessManager domainAccessManager = (SecurityDomainAccessManager)scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
+        SecurityDomainAccessManager domainAccessManager = scm.lookupComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
         if (domainAccessManager.getDomainByName(SecurityDomain.DEFAULT_NAME) == null)
         {
-            SecurityDomainStorageManager domainStorageManager = (SecurityDomainStorageManager)scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainStorageManager");
+            SecurityDomainStorageManager domainStorageManager = scm.lookupComponent("org.apache.jetspeed.security.spi.SecurityDomainStorageManager");
             SecurityDomainImpl defaultSecurityDomain = new SecurityDomainImpl();
             defaultSecurityDomain.setName(SecurityDomain.DEFAULT_NAME);
             domainStorageManager.addDomain(defaultSecurityDomain);
         }
-        RoleManager roleManager = (RoleManager)scm.getComponent("org.apache.jetspeed.security.RoleManager");
+        RoleManager roleManager = scm.lookupComponent("org.apache.jetspeed.security.RoleManager");
         if (!roleManager.roleExists("user"))
         {
             roleManager.addRole("user");

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java Tue Oct 29 17:11:29 2013
@@ -16,19 +16,8 @@
  */
 package org.apache.jetspeed.userinfo;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import javax.portlet.PortletRequest;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
 import org.apache.jetspeed.AbstractRequestContextTestCase;
 import org.apache.jetspeed.descriptor.JetspeedDescriptorService;
 import org.apache.jetspeed.descriptor.JetspeedDescriptorServiceImpl;
@@ -43,6 +32,15 @@ import org.apache.jetspeed.security.impl
 import org.apache.jetspeed.util.MultiFileChecksumHelper;
 import org.apache.pluto.container.impl.PortletAppDescriptorServiceImpl;
 
+import javax.portlet.PortletRequest;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * Unit test for {@link UserInfoManager}
@@ -61,8 +59,8 @@ public class TestUserInfoManager extends
     {
         super.setUp();
 
-        ums = (UserManager) scm.getComponent("org.apache.jetspeed.security.UserManager");
-        single = (UserInfoManager) scm.getComponent("org.apache.jetspeed.userinfo.MultiUserInfoManager");
+        ums = scm.lookupComponent("org.apache.jetspeed.security.UserManager");
+        single = scm.lookupComponent("org.apache.jetspeed.userinfo.MultiUserInfoManager");
     }
 
     public void tearDown() throws Exception

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java Tue Oct 29 17:11:29 2013
@@ -124,8 +124,8 @@ public class TestProfiler extends Dataso
         super.setUp();
         
         // Need to ensure required Security Domains are setup.
-        domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
-        domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
+        domainStorageManager =  scm.lookupComponent(SecurityDomainStorageManager.class.getName());
+        domainAccessManager = scm.lookupComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
 
         SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME); 
         if (domain == null){
@@ -142,10 +142,10 @@ public class TestProfiler extends Dataso
             domainStorageManager.addDomain(newDomain);
         }
         
-        this.profiler = (Profiler) scm.getComponent("profiler");
-        JetspeedProfilerImpl profilerImpl = (JetspeedProfilerImpl)scm.getComponent("profilerImpl");
+        this.profiler = scm.lookupComponent("profiler");
+        JetspeedProfilerImpl profilerImpl = scm.lookupComponent("profilerImpl");
         assertNotNull("profiler not found ", profiler);
-        ProfileResolvers resolvers = (ProfileResolvers)scm.getComponent("ProfileResolvers");
+        ProfileResolvers resolvers = scm.lookupComponent("ProfileResolvers");
         assertNotNull("resolvers not found ", resolvers);
         profilerImpl.setDefaultRule(JetspeedProfilerImpl.DEFAULT_RULE);
     }
@@ -185,7 +185,7 @@ public class TestProfiler extends Dataso
     public void firstTestSetup() throws Exception
     {
         System.out.println("firstTestSetup");
-        JetspeedSerializer serializer = (JetspeedSerializer)scm.getComponent("JetspeedSerializer");
+        JetspeedSerializer serializer = scm.lookupComponent("JetspeedSerializer");
         serializer.deleteData();
         serializer.importData(getBaseDir()+"target/test-classes/j2-seed.xml");
     }
@@ -193,7 +193,7 @@ public class TestProfiler extends Dataso
     public void lastTestTeardown() throws Exception
     {
         System.out.println("lastTestTeardown");
-        JetspeedSerializer serializer = (JetspeedSerializer)scm.getComponent("JetspeedSerializer");
+        JetspeedSerializer serializer = scm.lookupComponent("JetspeedSerializer");
         serializer.deleteData();
     }
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java Tue Oct 29 17:11:29 2013
@@ -16,10 +16,6 @@
  */
 package org.apache.jetspeed.components.portletentity;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
@@ -28,13 +24,16 @@ import org.apache.jetspeed.engine.MockJe
 import org.apache.jetspeed.om.page.impl.ContentFragmentImpl;
 import org.apache.jetspeed.om.portlet.InitParam;
 import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.Preference;
 import org.apache.jetspeed.om.portlet.Preferences;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
-
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
 
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
 /**
  * <p>
  * TestPortletEntityDAO
@@ -62,8 +61,8 @@ public class TestPortletEntityDAO extend
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.registry = (PortletRegistry) scm.getComponent("portletRegistry");
-        this.entityAccess = (PortletEntityAccessComponent) scm.getComponent("portletEntityAccess");
+        this.registry = scm.lookupComponent("portletRegistry");
+        this.entityAccess = scm.lookupComponent("portletEntityAccess");
 
         teardownTestData();
         setupTestData();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java Tue Oct 29 17:11:29 2013
@@ -40,11 +40,11 @@ public class TestPortletPreferencesProvi
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.prefsProvider = (PortletPreferencesProvider) scm.getComponent("org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider");
-        PortletPreferencesProvider temp = (PortletPreferencesProvider) scm.getComponent("portletPreferencesProvider");
+        this.prefsProvider = scm.lookupComponent("org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider");
+        PortletPreferencesProvider temp = scm.lookupComponent("portletPreferencesProvider");
         System.out.println("temp = " + temp);
         System.out.println("prefs = " + prefsProvider);
-        this.registry = (PortletRegistry) scm.getComponent("portletRegistry");
+        this.registry = scm.lookupComponent("portletRegistry");
 
 //        teardownTestData();
 //        setupTestData();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java Tue Oct 29 17:11:29 2013
@@ -16,10 +16,6 @@
  */
 package org.apache.jetspeed.components.portletregistry;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
@@ -30,6 +26,9 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
 import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
 
+import java.util.Collection;
+import java.util.Locale;
+
 /**
  * @author scott
  */
@@ -75,7 +74,7 @@ public abstract class AbstractRegistryTe
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.registry = (PortletRegistry) scm.getComponent("portletRegistry");
+        this.registry = scm.lookupComponent("portletRegistry");
 
         testPasses++;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java Tue Oct 29 17:11:29 2013
@@ -16,14 +16,6 @@
  */
 package org.apache.jetspeed.components.portletregistry;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
@@ -56,6 +48,13 @@ import org.apache.jetspeed.om.portlet.im
 import org.apache.jetspeed.util.JetspeedLocale;
 import org.apache.pluto.container.om.portlet.UserDataConstraint;
 
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+
 /**
  * <p>
  * TestPortletRegistryDAO
@@ -98,7 +97,7 @@ public class TestPortletRegistryDAO exte
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.portletRegistry = (PortletRegistry) scm.getComponent("portletRegistry");
+        this.portletRegistry = scm.lookupComponent("portletRegistry");
 
         buildTestData();
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java Tue Oct 29 17:11:29 2013
@@ -16,9 +16,6 @@
  */
 package org.apache.jetspeed.components.portletregistry;
 
-import java.util.Iterator;
-import java.util.Locale;
-
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
@@ -36,6 +33,9 @@ import org.apache.jetspeed.om.portlet.im
 import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
 import org.apache.ojb.broker.Identity;
 
+import java.util.Iterator;
+import java.util.Locale;
+
 /**
  * <p>
  * TestPortletRegistryDAO
@@ -58,7 +58,7 @@ public class TestRegistryCache extends D
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.portletRegistry = (PortletRegistry) scm.getComponent("portletRegistry");
+        this.portletRegistry = scm.lookupComponent("portletRegistry");
 
         buildTestData();
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java Tue Oct 29 17:11:29 2013
@@ -123,7 +123,7 @@ public abstract class BaseJetspeedPrinci
     {
     	if(jpmp==null)
     	{
-    		jpmp= (JetspeedPrincipalManagerProvider)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider");
+    		jpmp= Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider");
     	}
     	return jpmp;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java Tue Oct 29 17:11:29 2013
@@ -16,28 +16,19 @@
  */
 package org.apache.jetspeed.security;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.security.auth.Subject;
-
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
-import org.apache.jetspeed.security.GroupManager;
-import org.apache.jetspeed.security.JetspeedPermission;
-import org.apache.jetspeed.security.PasswordCredential;
-import org.apache.jetspeed.security.PermissionManager;
-import org.apache.jetspeed.security.RoleManager;
-import org.apache.jetspeed.security.User;
-import org.apache.jetspeed.security.UserManager;
-import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.impl.SecurityDomainImpl;
 import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
 import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 
+import javax.security.auth.Subject;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * @author <a href="mailto:sweaver@einnovation.com">Scott T. Weaver </a>
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
@@ -69,15 +60,15 @@ public class AbstractSecurityTestcase ex
 
         super.setUp();
 
-        ums = (UserManager) scm.getComponent("org.apache.jetspeed.security.UserManager");
-        gms = (GroupManager) scm.getComponent("org.apache.jetspeed.security.GroupManager");
-        rms = (RoleManager) scm.getComponent("org.apache.jetspeed.security.RoleManager");
+        ums = scm.lookupComponent("org.apache.jetspeed.security.UserManager");
+        gms = scm.lookupComponent("org.apache.jetspeed.security.GroupManager");
+        rms = scm.lookupComponent("org.apache.jetspeed.security.RoleManager");
                 
         // Authorization.
-        pms = (PermissionManager) scm.getComponent("org.apache.jetspeed.security.PermissionManager");
+        pms = scm.lookupComponent("org.apache.jetspeed.security.PermissionManager");
         
-        domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
-        domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
+        domainStorageManager = scm.lookupComponent(SecurityDomainStorageManager.class.getName());
+        domainAccessManager = scm.lookupComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
 
         // TODO: remove when default seed contains the default domain        
         SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME); 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicy.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicy.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicy.java Tue Oct 29 17:11:29 2013
@@ -16,20 +16,18 @@
  */
 package org.apache.jetspeed.security;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.jetspeed.security.impl.PassiveCallbackHandler;
+
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
 import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.Permission;
 import java.security.Policy;
 import java.security.PrivilegedAction;
 
-import javax.security.auth.login.LoginContext;
-import javax.security.auth.login.LoginException;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.security.impl.PassiveCallbackHandler;
-
 /**
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
  */
@@ -205,7 +203,7 @@ public class TestRdbmsPolicy extends Abs
     public void testPermissionWithSubjectInAccessControlContextAndDefaultPolicy()
     {
         System.out.println("\n\n\t\t[TestRdbmsPolicy] Test with default Policy enabled.");
-        AuthorizationProvider atzProvider = (AuthorizationProvider) scm.getComponent("org.apache.jetspeed.security.AuthorizationProvider");
+        AuthorizationProvider atzProvider = scm.lookupComponent("org.apache.jetspeed.security.AuthorizationProvider");
         atzProvider.useDefaultPolicy(true);
         testPermissionWithSubjectInAccessControlContext();
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/test/java/org/apache/jetspeed/serializer/TestSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/test/java/org/apache/jetspeed/serializer/TestSerializer.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/test/java/org/apache/jetspeed/serializer/TestSerializer.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/test/java/org/apache/jetspeed/serializer/TestSerializer.java Tue Oct 29 17:11:29 2013
@@ -22,7 +22,7 @@ public class TestSerializer extends Abst
 {        
     public void testImport() throws Exception
     {
-    	JetspeedSerializer serializer = (JetspeedSerializer)scm.getComponent("org.apache.jetspeed.serializer.JetspeedSerializer");
+    	JetspeedSerializer serializer = scm.lookupComponent("org.apache.jetspeed.serializer.JetspeedSerializer");
     	assertNotNull(serializer);
     	//serializer.importData("j2-seed.xml");
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java Tue Oct 29 17:11:29 2013
@@ -16,14 +16,6 @@
  */
 package org.apache.jetspeed.sso;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.security.auth.Subject;
-
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.security.GroupManager;
@@ -32,13 +24,20 @@ import org.apache.jetspeed.security.Pass
 import org.apache.jetspeed.security.PermissionManager;
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityDomain;
+import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
-import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.impl.SecurityDomainImpl;
 import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
 import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 
+import javax.security.auth.Subject;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * @author <a href="mailto:sweaver@einnovation.com">Scott T. Weaver </a>
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
@@ -75,14 +74,14 @@ public abstract class AbstractSecurityTe
 
         super.setUp();
 
-        ums = (UserManager) scm.getComponent("org.apache.jetspeed.security.UserManager");
-        gms = (GroupManager) scm.getComponent("org.apache.jetspeed.security.GroupManager");
-        rms = (RoleManager) scm.getComponent("org.apache.jetspeed.security.RoleManager");
+        ums = scm.lookupComponent("org.apache.jetspeed.security.UserManager");
+        gms = scm.lookupComponent("org.apache.jetspeed.security.GroupManager");
+        rms = scm.lookupComponent("org.apache.jetspeed.security.RoleManager");
                 
         // Authorization.
-        pms = (PermissionManager) scm.getComponent("org.apache.jetspeed.security.PermissionManager");
-        domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
-        domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
+        pms = scm.lookupComponent("org.apache.jetspeed.security.PermissionManager");
+        domainStorageManager = scm.lookupComponent(SecurityDomainStorageManager.class.getName());
+        domainAccessManager = scm.lookupComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
         
         // TODO: remove when default seed contains the default domain        
         SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME); 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java Tue Oct 29 17:11:29 2013
@@ -17,20 +17,12 @@
 
 package org.apache.jetspeed.sso;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.jetspeed.security.SecurityException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * @author   David Le Strat
@@ -70,7 +62,7 @@ public abstract class TestSSOComponent e
 
         try
         {
-            ssoManager = (SSOManager) scm.getComponent("org.apache.jetspeed.sso.SSOManager");
+            ssoManager = scm.lookupComponent("org.apache.jetspeed.sso.SSOManager");
         }
         catch (Exception ex)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java Tue Oct 29 17:11:29 2013
@@ -16,26 +16,23 @@
  */
 package org.apache.jetspeed.sso;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import javax.security.auth.Subject;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
 import org.apache.jetspeed.security.Group;
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.PasswordCredential;
 import org.apache.jetspeed.security.PrincipalTypeManager;
-import org.apache.jetspeed.security.Role;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.impl.RoleImpl;
 import org.apache.jetspeed.sso.impl.SSOUserImpl;
 
+import javax.security.auth.Subject;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
 /**
  * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
  * @version $Id$
@@ -491,7 +488,7 @@ X    void addUser(SSOSite site, Jetspeed
 
         try
         {
-            ssoManager = (SSOManager) scm.getComponent("org.apache.jetspeed.sso.SSOManager");
+            ssoManager = scm.lookupComponent("org.apache.jetspeed.sso.SSOManager");
         }
         catch (Exception ex)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/audit/TestAuditActivity.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/audit/TestAuditActivity.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/audit/TestAuditActivity.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/audit/TestAuditActivity.java Tue Oct 29 17:11:29 2013
@@ -16,6 +16,11 @@
  */
 package org.apache.jetspeed.audit;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.jetspeed.audit.impl.ActivityBean;
+import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -25,12 +30,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Properties;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.audit.impl.ActivityBean;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
-
 /**
  * Test Audit Activity
  * 
@@ -69,7 +68,7 @@ public class TestAuditActivity extends D
     {
         super.setUp();
         
-        this.audit = (AuditActivity) scm.getComponent("org.apache.jetspeed.audit.AuditActivity");
+        this.audit = scm.lookupComponent("org.apache.jetspeed.audit.AuditActivity");
         assertNotNull("audit activity service not found ", this.audit);
     }
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/statistics/TestStatistics.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/statistics/TestStatistics.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/statistics/TestStatistics.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/test/java/org/apache/jetspeed/statistics/TestStatistics.java Tue Oct 29 17:11:29 2013
@@ -16,6 +16,18 @@
  */
 package org.apache.jetspeed.statistics;
 
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.mockobjects.request.MockRequestContext;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.statistics.impl.StatisticsQueryCriteriaImpl;
+
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -28,20 +40,6 @@ import java.sql.SQLException;
 import java.util.List;
 import java.util.Properties;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
-import org.apache.jetspeed.mockobjects.request.MockRequestContext;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.statistics.impl.StatisticsQueryCriteriaImpl;
-
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-
 /**
  * TestStatistics
  * 
@@ -72,7 +70,7 @@ public class TestStatistics extends Data
     {
         super.setUp();
         
-        this.statistics = (PortalStatistics) scm.getComponent("PortalStatistics");
+        this.statistics = scm.lookupComponent("PortalStatistics");
         assertNotNull("statistics not found ", statistics);
     }
 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXException.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXException.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXException.java Tue Oct 29 17:11:29 2013
@@ -25,37 +25,31 @@ public class AJAXException extends Jetsp
     public AJAXException()
     {
         super();
-        // TODO Auto-generated constructor stub
     }
 
     public AJAXException(KeyedMessage keyedMessage, Throwable nested)
     {
         super(keyedMessage, nested);
-        // TODO Auto-generated constructor stub
     }
 
     public AJAXException(KeyedMessage typedMessage)
     {
         super(typedMessage);
-        // TODO Auto-generated constructor stub
     }
 
     public AJAXException(String msg, Throwable nested)
     {
         super(msg, nested);
-        // TODO Auto-generated constructor stub
     }
 
     public AJAXException(String message)
     {
         super(message);
-        // TODO Auto-generated constructor stub
     }
 
     public AJAXException(Throwable nested)
     {
         super(nested);
-        // TODO Auto-generated constructor stub
     }
 
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXRequest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXRequest.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXRequest.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXRequest.java Tue Oct 29 17:11:29 2013
@@ -16,17 +16,16 @@
  */
 package org.apache.jetspeed.ajax;
 
-import java.util.List;
-
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * Request used for AJAX services.
  * 
  * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
+ * @deprecated
  */
 public interface AJAXRequest
 {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXResponse.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXResponse.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXResponse.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXResponse.java Tue Oct 29 17:11:29 2013
@@ -21,7 +21,7 @@ package org.apache.jetspeed.ajax;
  * Response object used for AJAX services.
  * 
  * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
+ * @deprecated
  */
 public interface AJAXResponse
 {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXService.java?rev=1536817&r1=1536816&r2=1536817&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXService.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/ajax/AJAXService.java Tue Oct 29 17:11:29 2013
@@ -21,7 +21,7 @@ package org.apache.jetspeed.ajax;
  * a result object to converted into XML.
  * 
  * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
+ * @deprecated
  */
 public interface AJAXService
 {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message