dlestrat    2004/05/16 13:09:30

  Modified:    portal/src/test/org/apache/jetspeed/profiler
                        TestProfiler.java
  Log:
  Change to TestProfiler to leverage createSubject refactored in SecurityHelper.
  
  Revision  Changes    Path
  1.11      +4 -11     
jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/profiler/TestProfiler.java
  
  Index: TestProfiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/profiler/TestProfiler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestProfiler.java 30 Mar 2004 22:02:34 -0000      1.10
  +++ TestProfiler.java 16 May 2004 20:09:30 -0000      1.11
  @@ -36,6 +36,7 @@
   import org.apache.jetspeed.profiler.rules.impl.RoleFallbackProfilingRule;
   import org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule;
   import org.apache.jetspeed.request.RequestContext;
  +import org.apache.jetspeed.security.SecurityHelper;
   import org.apache.jetspeed.security.impl.UserPrincipalImpl;
   import org.picocontainer.MutablePicoContainer;
   
  @@ -243,7 +244,7 @@
   
           RequestContext request = new MockRequestContext("default-other");
           
  -        request.setSubject(createSubject("anon"));
  +        request.setSubject(SecurityHelper.createSubject("anon"));
           request.setLocale(new Locale("en", "US"));        
           request.setMediaType("HTML");
           request.setMimeType("text/html");
  @@ -320,14 +321,6 @@
           assertTrue("fallback count = 0, " + count, count == 0);
                   
       }
  -    
  -    private Subject createSubject(String principalName)
  -    {
  -        Principal principal = new UserPrincipalImpl(principalName);
  -        Set principals = new HashSet();
  -        principals.add(principal);
  -        return new Subject(true, principals, new HashSet(), new HashSet());        
  -    }
   
       public void testPage() throws Exception
       {
  @@ -335,7 +328,7 @@
   
           RequestContext request = new MockRequestContext();
       
  -        request.setSubject(createSubject("anon"));
  +        request.setSubject(SecurityHelper.createSubject("anon"));
           request.setLocale(new Locale("en", "US"));        
           request.setMediaType("HTML");
           request.setMimeType("text/html");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to