[jboss-cvs] Picketbox SVN: r47 - in trunk/security-jboss-sx: jbosssx/src/main/java/org/jboss/security/auth/login and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 1 12:49:16 EST 2010


Author: sguilhen at redhat.com
Date: 2010-03-01 12:49:16 -0500 (Mon, 01 Mar 2010)
New Revision: 47

Modified:
   trunk/security-jboss-sx/acl/src/main/java/org/jboss/security/acl/ACLProviderImpl.java
   trunk/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/login/SunConfigParser.jj
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/AbstractJBossSXTest.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/DelegatingPolicyTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/JBossSXTestDelegate.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NamespacePermissionCollection.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestableGroupTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestablePrincipalTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/PermissionName.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/SecurityActions.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestJCE.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestLoginModule.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/ThreadLocalTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TstTimedCache.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaas/helpers/SharedStateRetrievingLoginModule.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/AuthContextUnitTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/JASPILoginModuleDelgateUnitTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/TestLoginModule.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestClientAuthConfig.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestServerAuthConfig.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/ldap/OpenDSUnitTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/mapping/LdapAttributeMappingProviderUnitTestCase.java
   trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/securitycontext/SecurityContextTestCase.java
Log:
Fixed generics warnings and removed useless code from ACLProviderImpl

Modified: trunk/security-jboss-sx/acl/src/main/java/org/jboss/security/acl/ACLProviderImpl.java
===================================================================
--- trunk/security-jboss-sx/acl/src/main/java/org/jboss/security/acl/ACLProviderImpl.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/acl/src/main/java/org/jboss/security/acl/ACLProviderImpl.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -228,24 +228,20 @@
    public boolean isAccessGranted(Resource resource, Identity identity, ACLPermission permission)
          throws AuthorizationException
    {
-      if (this.strategy != null)
+      ACL acl = strategy.getACL(resource);
+      if (acl != null)
       {
-         ACL acl = strategy.getACL(resource);
-         if (acl != null)
+         ACLEntry entry = acl.getEntry(identity);
+         if (entry != null)
          {
-            ACLEntry entry = acl.getEntry(identity);
-            if (entry != null)
-            {
-               // check the permission associated with the identity.
-               return entry.checkPermission(permission);
-            }
-            // no entry for identity = deny access
-            return false;
+            // check the permission associated with the identity.
+            return entry.checkPermission(permission);
          }
-         else
-            throw new AuthorizationException("Unable to locate an ACL for the resource " + resource);
+         // no entry for identity = deny access
+         return false;
       }
-      throw new AuthorizationException("Unable to retrieve ACL: persistece strategy not set");
+      else
+         throw new AuthorizationException("Unable to locate an ACL for the resource " + resource);
    }
 
    /*

Modified: trunk/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/login/SunConfigParser.jj
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/login/SunConfigParser.jj	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/login/SunConfigParser.jj	2010-03-01 17:49:16 UTC (rev 47)
@@ -36,6 +36,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision: 16662 $
  */
+ at SuppressWarnings("all")
 public class SunConfigParser
 {
    private XMLLoginConfigImpl loginConfig;
@@ -183,7 +184,7 @@
    Token t = null;
    String appName;
    AppConfigurationEntry entry;
-   ArrayList entries = new ArrayList();
+   ArrayList<AppConfigurationEntry> entries = new ArrayList<AppConfigurationEntry>();
 }
 {
    t=<IDENTIFIER> { appName = t.image; } <OPEN_BKT>
@@ -205,7 +206,7 @@
 {
    Token t = null;
    String loginModuleClassName;
-   HashMap optionsMap = new HashMap();
+   HashMap<String, String> optionsMap = new HashMap<String, String>();
    LoginModuleControlFlag controlFlag;
    AppConfigurationEntry entry;
 }
@@ -240,7 +241,7 @@
    }
 }
 
-void moduleOptions(HashMap optionsMap) :
+void moduleOptions(HashMap<String, String> optionsMap) :
 {
    Token t;
    String name, value;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/AbstractJBossSXTest.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/AbstractJBossSXTest.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/AbstractJBossSXTest.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -40,7 +40,7 @@
       super(name); 
    }
    
-   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
    {
       return new JBossSXTestDelegate(clazz);
    }

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/DelegatingPolicyTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/DelegatingPolicyTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/DelegatingPolicyTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -67,12 +67,12 @@
 
       String provider = "org.jboss.security.jacc.DelegatingPolicy";
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
-      Class providerClass = loader.loadClass(provider);
+      Class<?> providerClass = loader.loadClass(provider);
       try
       {
          // Look for a ctor(Policy) signature
-         Class[] ctorSig = {Policy.class};
-         Constructor ctor = providerClass.getConstructor(ctorSig);
+         Class<?>[] ctorSig = {Policy.class};
+         Constructor<?> ctor = providerClass.getConstructor(ctorSig);
          Object[] ctorArgs = {oldPolicy};
          jaccPolicy = (Policy) ctor.newInstance(ctorArgs);
       }
@@ -179,7 +179,7 @@
       final EJBMethodPermission methodX = new EJBMethodPermission("someEJB", "methodX");
       final Subject caller = new Subject();
       caller.getPrincipals().add(new SimplePrincipal("callerX"));
-      Set principalsSet = caller.getPrincipals();
+      Set<Principal> principalsSet = caller.getPrincipals();
       Principal[] principals = new Principal[principalsSet.size()];
       principalsSet.toArray(principals);
       CodeSource cs = getClass().getProtectionDomain().getCodeSource();
@@ -190,9 +190,9 @@
                new SubjectDomainCombiner(caller));
       */
 
-      Boolean allowed = (Boolean) Subject.doAsPrivileged(caller, new PrivilegedAction()
+      Boolean allowed = (Boolean) Subject.doAsPrivileged(caller, new PrivilegedAction<Boolean>()
          {
-            public Object run()
+            public Boolean run()
             {
                AccessControlContext acc = AccessController.getContext();
                Boolean ok = Boolean.FALSE;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/JBossSXTestDelegate.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/JBossSXTestDelegate.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/JBossSXTestDelegate.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -31,7 +31,7 @@
  */
 public class JBossSXTestDelegate extends AbstractTestDelegate
 { 
-   public JBossSXTestDelegate(Class clazz)
+   public JBossSXTestDelegate(Class<?> clazz)
    {
       super(clazz); 
    } 

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NamespacePermissionCollection.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NamespacePermissionCollection.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NamespacePermissionCollection.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -26,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.SortedMap;
@@ -39,8 +40,10 @@
 public class NamespacePermissionCollection extends PermissionCollection
 { 
    private static final long serialVersionUID = 1L;
-   private TreeMap namespacePerms = new TreeMap();
-    private TreeMap namespaceKeys = new TreeMap(new PermissionName.NameLengthComparator());
+   private TreeMap<PermissionName, List<NamespacePermission>> namespacePerms = 
+      new TreeMap<PermissionName, List<NamespacePermission>>();
+   private TreeMap<PermissionName, PermissionName> namespaceKeys = 
+      new TreeMap<PermissionName, PermissionName>(new PermissionName.NameLengthComparator());
 
     /** Creates new NamespacePermission */
     public NamespacePermissionCollection()
@@ -55,10 +58,10 @@
             throw new IllegalArgumentException("Only NamespacePermission can be added, invalid="+permission);
         NamespacePermission np = (NamespacePermission) permission;
         PermissionName key = np.getFullName();
-        ArrayList tmp = (ArrayList) namespacePerms.get(key);
+        List<NamespacePermission> tmp = namespacePerms.get(key);
         if( tmp == null )
         {
-            tmp = new ArrayList();
+            tmp = new ArrayList<NamespacePermission>();
             namespacePerms.put(key, tmp);
             namespaceKeys.put(key, key);
         }
@@ -77,15 +80,15 @@
         NamespacePermission np = (NamespacePermission) permission;
         // See if there is an exact permission for the name
         PermissionName key = np.getFullName();
-        ArrayList tmp = (ArrayList) namespacePerms.get(key);
+        List<NamespacePermission> tmp = namespacePerms.get(key);
         if( tmp == null )
         {   // Find the closest parent position.
-            SortedMap headMap = namespacePerms.headMap(key);
+            SortedMap<PermissionName, List<NamespacePermission>> headMap = namespacePerms.headMap(key);
             try
             {
                 PermissionName lastKey = (PermissionName) headMap.lastKey();
                 if( lastKey.isParent(key) == true )
-                    tmp = (ArrayList) namespacePerms.get(lastKey);
+                    tmp = namespacePerms.get(lastKey);
                 else
                 {
                     PermissionName[] keys = {};
@@ -95,7 +98,7 @@
                         lastKey = keys[k];
                         if( lastKey.isParent(key) == true )
                         {
-                            tmp = (ArrayList) namespacePerms.get(lastKey);
+                            tmp = namespacePerms.get(lastKey);
                             break;
                         }
                     }
@@ -112,18 +115,23 @@
         // See if the permission is implied by any we found
         if( tmp != null )
             implies = isImplied(tmp, np);
-//System.out.println("NPC["+this+"].implies("+np+") -> "+implies);
+        //System.out.println("NPC["+this+"].implies("+np+") -> "+implies);
         return implies;
     }
 
-    public Enumeration elements()
+    public Enumeration<Permission> elements()
     {
-        Set s = namespaceKeys.keySet();
-        final Iterator iter = s.iterator();
-        Enumeration elements = new Enumeration()
+        Set<PermissionName> s = namespaceKeys.keySet();
+        final Iterator<PermissionName> iter = s.iterator();
+        Enumeration<Permission> elements = new Enumeration<Permission>()
         {
-            ArrayList activeEntry;
+            List<NamespacePermission> activeEntry;
             int index;
+            
+            /*
+             * (non-Javadoc)
+             * @see java.util.Enumeration#hasMoreElements()
+             */
             public boolean hasMoreElements()
             {
                 boolean hasMoreElements = true;
@@ -134,13 +142,18 @@
                 }
                 return hasMoreElements;
             }
-            public Object nextElement()
+            
+            /*
+             * (non-Javadoc)
+             * @see java.util.Enumeration#nextElement()
+             */
+            public NamespacePermission nextElement()
             {
-                Object next = null;
+               NamespacePermission next = null;
                 if( activeEntry == null )
                 {
                     Object key = iter.next();
-                    activeEntry = (ArrayList) namespacePerms.get(key);
+                    activeEntry = namespacePerms.get(key);
                     index = 0;
                     next = activeEntry.get(index ++);
                 }
@@ -155,7 +168,7 @@
     }
 
 
-    private boolean isImplied(ArrayList permissions, NamespacePermission np)
+    private boolean isImplied(List<NamespacePermission> permissions, NamespacePermission np)
     {
         boolean isImplied = false;
         for(int p = 0; p < permissions.size(); p ++)

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestableGroupTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestableGroupTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestableGroupTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -147,7 +147,7 @@
     private void testMembers(int grpNo)
     {
         String user = "user."+grpNo+'.';
-        HashSet memberSet = new HashSet();
+        HashSet<Principal> memberSet = new HashSet<Principal>();
         for(int m = 0; m < 4; m ++)
         {
             Principal p = new SimplePrincipal(user+m);
@@ -155,7 +155,7 @@
             memberSet.add(p);
         }
         
-        Enumeration members = group.members();
+        Enumeration<Principal> members = group.members();
         while( members.hasMoreElements() )
         {
             Principal member = (Principal) members.nextElement();

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestablePrincipalTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestablePrincipalTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/NestablePrincipalTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -125,7 +125,7 @@
     /** Test of members method, of class org.jboss.security.NestablePrincipal. */
     private void testMembers()
     {       
-        Enumeration members = principal.members();
+        Enumeration<Principal> members = principal.members();
         while( members.hasMoreElements() )
         {
             Principal user = (Principal) members.nextElement();

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/PermissionName.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/PermissionName.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/PermissionName.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -35,9 +35,11 @@
 @author Scott.Stark at jboss.org
 @version $Revision$
 */
-public class PermissionName implements Comparable, Serializable
+public class PermissionName implements Comparable<PermissionName>, Serializable
 {
-	/** The Properties used for the project directory heirarchical names */
+   private static final long serialVersionUID = -4344522894000320121L;
+
+   /** The Properties used for the project directory heirarchical names */
 	static Name emptyName;
 	static Properties nameSyntax = new Properties();
 	static
@@ -58,12 +60,10 @@
         length(longer names before shorter names) to ensure that the most
         precise names are seen first.
     */
-    public static class NameLengthComparator implements Comparator
+    public static class NameLengthComparator implements Comparator<PermissionName>
     {
-        public int compare(Object o1, Object o2)
+        public int compare(PermissionName p1, PermissionName p2)
         {
-            PermissionName p1 = (PermissionName) o1;
-            PermissionName p2 = (PermissionName) o2;
             // if p1 is longer than p2, its < p2 -> < 0
             int compare = p2.size() - p1.size();
             if( compare == 0 )
@@ -89,9 +89,8 @@
         this.name = name;
     }
 
-    public int compareTo(Object obj)
+    public int compareTo(PermissionName pn)
     {
-        PermissionName pn = (PermissionName) obj;
         /* Each level must be compared. The first level to not be equals
          determines the ordering of the names.
         */
@@ -106,11 +105,21 @@
         return compare;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     public boolean equals(Object obj)
     {
-        return compareTo(obj) == 0;
+       if(obj instanceof PermissionName)
+          return compareTo((PermissionName) obj) == 0;
+       return false;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     public int hashCode()
     {
         return name.hashCode();

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/SecurityActions.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/SecurityActions.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/SecurityActions.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -41,7 +41,7 @@
 {
    public static void addPrincipalToSubject(final Subject subj, final Principal p)
    {
-      AccessController.doPrivileged(new PrivilegedAction()
+      AccessController.doPrivileged(new PrivilegedAction<Object>()
       {
          public Object run()
          {
@@ -53,7 +53,7 @@
    
    public static void setJAASConfiguration(final Configuration configuration)
    {
-      AccessController.doPrivileged(new PrivilegedAction()
+      AccessController.doPrivileged(new PrivilegedAction<Object>()
       {
          public Object run()
          {
@@ -65,7 +65,7 @@
    
    public static void setPolicyContextID(final String contextID)
    {
-      AccessController.doPrivileged(new PrivilegedAction()
+      AccessController.doPrivileged(new PrivilegedAction<Object>()
       {
          public Object run()
          {

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestJCE.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestJCE.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestJCE.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -45,7 +45,7 @@
       Provider[] providers = Security.getProviders();
       for(int p = 0; p < providers.length; p ++)
       {
-         Iterator iter = providers[p].keySet().iterator();
+         Iterator<Object> iter = providers[p].keySet().iterator();
          System.out.println("Provider: "+providers[p].getInfo());
          while( iter.hasNext() )
          {
@@ -122,6 +122,8 @@
       System.out.println("key2.Algorithm = "+key.getAlgorithm());
       System.out.println("key2.Format = "+key.getFormat());
       System.out.println("key2.Encoded Size = "+kbytes.length);
+      System.out.println("keySpec.Algorithm = " + keySpec.getAlgorithm());
+      System.out.println("keySpec.Format = " + keySpec.getFormat());
    }
    
    public static void main(String[] args)
@@ -129,10 +131,9 @@
       try
       {
          System.setOut(System.err);
-         TestJCE tst = new TestJCE();
-         tst.showProviders();
+         TestJCE.showProviders();
          //tst.testKey();
-         tst.testBlowfish();
+         TestJCE.testBlowfish();
       }
       catch(Throwable t)
       {

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestLoginModule.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestLoginModule.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TestLoginModule.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -42,6 +42,7 @@
    {
    }
 
+   @SuppressWarnings("unchecked")
    public void initialize(Subject subject, CallbackHandler handler, Map sharedState, Map options)
    {
       this.subject = subject;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/ThreadLocalTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/ThreadLocalTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/ThreadLocalTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -21,6 +21,8 @@
 */
 package org.jboss.test;
 
+import java.security.Principal;
+
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
@@ -34,8 +36,8 @@
 */
 public class ThreadLocalTestCase extends TestCase
 {
-    private static InheritableThreadLocal thread_principal = new InheritableThreadLocal();
-    private static InheritableThreadLocal thread_credential = new InheritableThreadLocal();
+    private static InheritableThreadLocal<Principal> thread_principal = new InheritableThreadLocal<Principal>();
+    private static InheritableThreadLocal<Object> thread_credential = new InheritableThreadLocal<Object>();
     private static String USER = "jduke";
     private static String PASSWORD = "theduke";
 

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TstTimedCache.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TstTimedCache.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/TstTimedCache.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -91,7 +91,7 @@
             System.out.println("get(3) -> "+cache.get("3"));
             try
             {
-                Thread.currentThread().sleep(3*1000);
+                Thread.sleep(3*1000);
             }
             catch(InterruptedException e)
             {

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaas/helpers/SharedStateRetrievingLoginModule.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaas/helpers/SharedStateRetrievingLoginModule.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaas/helpers/SharedStateRetrievingLoginModule.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -39,7 +39,6 @@
 {
    private String username = null;
 
-   @SuppressWarnings("unchecked")
    @Override
    public boolean login() throws LoginException
    {

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/AuthContextUnitTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/AuthContextUnitTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/AuthContextUnitTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -220,11 +220,12 @@
     */
    private static class TestCallbackHandler implements CallbackHandler
    { 
-      public void setSecurityInfo(Principal p, Object cred)
-      {}
+      @SuppressWarnings("unused")
+      public void setSecurityInfo(Principal principal, Object credential)
+      {
+      }
       
-      public void handle(Callback[] arg0) 
-      throws IOException, UnsupportedCallbackException
+      public void handle(Callback[] arg0) throws IOException, UnsupportedCallbackException
       {
       } 
    } 

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/JASPILoginModuleDelgateUnitTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/JASPILoginModuleDelgateUnitTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/JASPILoginModuleDelgateUnitTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -53,6 +53,7 @@
  * @since Jul 27, 2007
  * @version $Revision$
  */
+ at SuppressWarnings("unchecked")
 public class JASPILoginModuleDelgateUnitTestCase extends TestCase
 {
    AuthConfigFactory factory = null;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/TestLoginModule.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/TestLoginModule.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/TestLoginModule.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -40,6 +40,7 @@
  *  @since  Jul 26, 2007 
  *  @version $Revision$
  */
+ at SuppressWarnings("unused")
 public class TestLoginModule implements LoginModule
 { 
    private Subject subject;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestClientAuthConfig.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestClientAuthConfig.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestClientAuthConfig.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -38,6 +38,7 @@
 public class TestClientAuthConfig implements ClientAuthConfig
 {
 
+   @SuppressWarnings("unchecked")
    public ClientAuthContext getAuthContext(String authContextID,
          Subject clientSubject, Map properties) 
    throws AuthException

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestServerAuthConfig.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestServerAuthConfig.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/authentication/jaspi/helpers/TestServerAuthConfig.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -36,6 +36,7 @@
  *  @since  Jul 11, 2007 
  *  @version $Revision$
  */
+ at SuppressWarnings("unchecked")
 public class TestServerAuthConfig implements ServerAuthConfig
 {
    public ServerAuthContext getAuthContext(String authContextID,

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/ldap/OpenDSUnitTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/ldap/OpenDSUnitTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/ldap/OpenDSUnitTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -106,7 +106,7 @@
    public void testLDAPAddDelete() throws Exception
    {
       String fileName = targetDir + "ldap" + fs + "example1.ldif";
-      boolean op = util.addLDIF(serverHost, port, adminDN, adminPW, new File(fileName).toURL());
+      boolean op = util.addLDIF(serverHost, port, adminDN, adminPW, new File(fileName).toURI().toURL());
       assertTrue(op);
       
       DirContext dc = null;

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/mapping/LdapAttributeMappingProviderUnitTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/mapping/LdapAttributeMappingProviderUnitTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/security/mapping/LdapAttributeMappingProviderUnitTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -74,7 +74,7 @@
       
       //Let us add the ldapAttributes.ldif
       String fileName = targetDir + "ldap" + fs + "ldapAttributes.ldif";
-      boolean op = util.addLDIF(serverHost, port, adminDN, adminPW, new File(fileName).toURL());
+      boolean op = util.addLDIF(serverHost, port, adminDN, adminPW, new File(fileName).toURI().toURL());
       assertTrue(op);
    }
    

Modified: trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/securitycontext/SecurityContextTestCase.java
===================================================================
--- trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/securitycontext/SecurityContextTestCase.java	2010-02-28 22:22:04 UTC (rev 46)
+++ trunk/security-jboss-sx/jbosssx/src/test/java/org/jboss/test/securitycontext/SecurityContextTestCase.java	2010-03-01 17:49:16 UTC (rev 47)
@@ -83,7 +83,7 @@
       JBossSecurityContext sc = getSC(securityDomain);
       ISecurityManagement ism = sc.getSecurityManagement();
       assertNotNull("Security Management is not null", ism);
-      MappingContext<RoleGroup> mc = sc.getMappingManager().getMappingContext(RoleGroup.class);
+      MappingContext<RoleGroup> mc = sc.getMappingManager().getMappingContext("role");
       assertNotNull("Mapping Context is not null", mc); 
       List<?> modules = mc.getModules();
       assertNotNull("Mapping modules not null", modules);




More information about the jboss-cvs-commits mailing list