incubator-jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r755080 - in /incubator/jspwiki/trunk/tests/java/org/apache/wiki: auth/login/ auth/permissions/ content/ filters/
Date Tue, 17 Mar 2009 02:23:06 GMT
Author: ajaquith
Date: Tue Mar 17 02:23:05 2009
New Revision: 755080

URL: http://svn.apache.org/viewvc?rev=755080&view=rev
Log:
Expanded generics use.

Modified:
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/AnonymousLoginModuleTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/CookieAssertionLoginModuleTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/UserDatabaseLoginModuleTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/WebContainerLoginModuleTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/AllPermissionCollectionTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/GroupPermissionTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/filters/FilterManagerTest.java

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/AnonymousLoginModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/AnonymousLoginModuleTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/AnonymousLoginModuleTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/AnonymousLoginModuleTest.java
Tue Mar 17 02:23:05 2009
@@ -20,6 +20,7 @@
  */
 package org.apache.wiki.auth.login;
 
+import java.security.Principal;
 import java.util.HashMap;
 import java.util.Properties;
 import java.util.Set;
@@ -68,7 +69,7 @@
             module.initialize(subject, handler, new HashMap<String, Object>(), new
HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "127.0.0.1" ) ) );
             assertFalse( principals.contains( Role.ANONYMOUS ) );
@@ -93,7 +94,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "127.0.0.1" ) ) );
             assertFalse( principals.contains( Role.ANONYMOUS ) );

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/CookieAssertionLoginModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/CookieAssertionLoginModuleTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/CookieAssertionLoginModuleTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/CookieAssertionLoginModuleTest.java
Tue Mar 17 02:23:05 2009
@@ -20,6 +20,7 @@
  */
 package org.apache.wiki.auth.login;
 
+import java.security.Principal;
 import java.util.HashMap;
 import java.util.Properties;
 import java.util.Set;
@@ -78,7 +79,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "Bullwinkle" ) ) );
             assertFalse( principals.contains( Role.ASSERTED ) );
@@ -105,7 +106,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "Bullwinkle" ) ) );
             assertFalse( principals.contains( Role.ANONYMOUS ) );

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/UserDatabaseLoginModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/UserDatabaseLoginModuleTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/UserDatabaseLoginModuleTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/UserDatabaseLoginModuleTest.java
Tue Mar 17 02:23:05 2009
@@ -20,6 +20,7 @@
  */
 package org.apache.wiki.auth.login;
 
+import java.security.Principal;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Properties;
@@ -65,7 +66,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "user", WikiPrincipal.LOGIN_NAME
) ) );
             assertFalse( principals.contains( Role.AUTHENTICATED ) );
@@ -104,7 +105,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( new WikiPrincipal( "user",  WikiPrincipal.LOGIN_NAME
) ) );
             assertFalse( principals.contains( Role.AUTHENTICATED ) );

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/WebContainerLoginModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/WebContainerLoginModuleTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/WebContainerLoginModuleTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/login/WebContainerLoginModuleTest.java
Tue Mar 17 02:23:05 2009
@@ -75,7 +75,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue(  principals.contains( principal ) );
             assertFalse( principals.contains( Role.ANONYMOUS ) );
@@ -109,7 +109,7 @@
                           new HashMap<String, Object>());
         module.login();
         module.commit();
-        Set principals = subject.getPrincipals();
+        Set<Principal> principals = subject.getPrincipals();
         assertEquals( 3, principals.size() );
         assertTrue( principals.contains( principal ) );
         assertFalse( principals.contains( Role.ANONYMOUS ) );
@@ -134,7 +134,7 @@
                               new HashMap<String, Object>());
             module.login();
             module.commit();
-            Set principals = subject.getPrincipals();
+            Set<Principal> principals = subject.getPrincipals();
             assertEquals( 1, principals.size() );
             assertTrue( principals.contains( principal ) );
             assertFalse( principals.contains( Role.AUTHENTICATED ) );

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/AllPermissionCollectionTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/AllPermissionCollectionTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/AllPermissionCollectionTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/AllPermissionCollectionTest.java
Tue Mar 17 02:23:05 2009
@@ -262,7 +262,7 @@
     private int count( AllPermissionCollection collection )
     {
         int i = 0;
-        Enumeration perms = collection.elements();
+        Enumeration<Permission> perms = collection.elements();
         while( perms.hasMoreElements() )
         {
             perms.nextElement();

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/GroupPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/GroupPermissionTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/GroupPermissionTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/permissions/GroupPermissionTest.java
Tue Mar 17 02:23:05 2009
@@ -319,7 +319,7 @@
     {
         try
         {
-            Boolean result = (Boolean)Subject.doAsPrivileged( subject, new PrivilegedAction()
+            Boolean result = (Boolean)Subject.doAsPrivileged( subject, new PrivilegedAction<Object>()
             {
                 public Object run()
                 {

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java Tue Mar
17 02:23:05 2009
@@ -97,7 +97,7 @@
         
         // Refmgr
         
-        Collection refs = m_engine.getReferenceManager().findCreated();
+        Collection<String> refs = m_engine.getReferenceManager().findCreated();
         
         assertTrue( "FooTest does not exist", refs.contains("FooTest") );
         assertFalse( "TestPage exists", refs.contains("TestPage") );
@@ -120,7 +120,7 @@
         
         assertEquals( "no rename", "[FooTest]", data.trim() );
         
-        Collection refs = m_engine.getReferenceManager().findReferrers("TestPage");
+        Collection<String> refs = m_engine.getReferenceManager().findReferrers("TestPage");
         
         assertNull( "oldpage", refs );
         
@@ -144,7 +144,7 @@
         String data = m_engine.getPureText("TestPage2", WikiProvider.LATEST_VERSION);
      
         assertEquals( "no rename", "FooTest", data.trim() );
-        Collection refs = m_engine.getReferenceManager().findReferrers("TestPage");
+        Collection<String> refs = m_engine.getReferenceManager().findReferrers("TestPage");
         
         assertNull( "oldpage", refs );
         
@@ -168,7 +168,7 @@
         String data = m_engine.getPureText("TestPage2", WikiProvider.LATEST_VERSION);
      
         assertEquals( "no rename", "[FooTest#heading1]", data.trim() );
-        Collection refs = m_engine.getReferenceManager().findReferrers("TestPage");
+        Collection<String> refs = m_engine.getReferenceManager().findReferrers("TestPage");
         
         assertNull( "oldpage", refs );
         
@@ -195,7 +195,7 @@
                       "[FooTest] [FooTest] [linktext|FooTest] FooTest [linktext|FooTest]
[FooTest#Anchor] [FooTest] FooTest [FooTest]", 
                       data.trim() );
 
-        Collection refs = m_engine.getReferenceManager().findReferrers("TestPage");
+        Collection<String> refs = m_engine.getReferenceManager().findReferrers("TestPage");
         
         assertNull( "oldpage", refs );
         
@@ -253,7 +253,7 @@
         att = m_engine.getAttachmentManager().getAttachmentInfo("TestPage/foo.txt");
         assertNull("testpage/foo.txt exists",att);
         
-        Collection refs = m_engine.getReferenceManager().findReferrers("TestPage/bar.jpg");
+        Collection<String> refs = m_engine.getReferenceManager().findReferrers("TestPage/bar.jpg");
     
         assertNull( "oldpage", refs );
     
@@ -305,7 +305,7 @@
         assertEquals("[|FooTest]", m_engine.getText("TestPage2").trim() );
     }
 
-    private void rename( String src, String dst ) throws WikiException
+    private void rename( String src, String dst ) throws Exception
     {
         WikiPage p = m_engine.getPage(src);
 

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/filters/FilterManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/filters/FilterManagerTest.java?rev=755080&r1=755079&r2=755080&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/filters/FilterManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/filters/FilterManagerTest.java Tue
Mar 17 02:23:05 2009
@@ -59,16 +59,16 @@
     {
         FilterManager m = new FilterManager( m_engine, props );
 
-        List l = m.getFilterList();
+        List<PageFilter> l = m.getFilterList();
 
         assertEquals("Wrong number of filters", 2, l.size());
 
-        Iterator i = l.iterator();
-        PageFilter f1 = (PageFilter)i.next();
+        Iterator<PageFilter> i = l.iterator();
+        PageFilter f1 = i.next();
 
         assertTrue("Not a Profanityfilter", f1 instanceof ProfanityFilter);
 
-        PageFilter f2 = (PageFilter)i.next();
+        PageFilter f2 = i.next();
 
         assertTrue("Not a Testfilter", f2 instanceof TestFilter);
     }
@@ -78,9 +78,9 @@
     {
         FilterManager m = new FilterManager( m_engine, props );
 
-        List l = m.getFilterList();
+        List<PageFilter> l = m.getFilterList();
 
-        Iterator i = l.iterator();
+        Iterator<PageFilter> i = l.iterator();
         i.next();
         TestFilter f2 = (TestFilter)i.next();
 



Mime
View raw message