Author: [email protected]
Date: Wed Aug  3 15:16:05 2011
New Revision: 1244

Log:
[AMDATUAUTH-74] Fixed the georged password mismatch error by updating the 
password if the user did already exist. The test still fails, but this is due 
to another issue in the fs storage implementation of useradmin

Modified:
   
trunk/amdatu-auth/oauth-stores/consumer-store-fs/src/main/java/org/amdatu/authentication/oauth/consumerregistry/fs/service/FSConsumerRegistryImpl.java
   
trunk/amdatu-auth/test-integration/tests/src/test/java/org/amdatu/auth/test/integration/tests/util/AuthUtils.java

Modified: 
trunk/amdatu-auth/oauth-stores/consumer-store-fs/src/main/java/org/amdatu/authentication/oauth/consumerregistry/fs/service/FSConsumerRegistryImpl.java
==============================================================================
--- 
trunk/amdatu-auth/oauth-stores/consumer-store-fs/src/main/java/org/amdatu/authentication/oauth/consumerregistry/fs/service/FSConsumerRegistryImpl.java
      (original)
+++ 
trunk/amdatu-auth/oauth-stores/consumer-store-fs/src/main/java/org/amdatu/authentication/oauth/consumerregistry/fs/service/FSConsumerRegistryImpl.java
      Wed Aug  3 15:16:05 2011
@@ -35,9 +35,10 @@
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
 import org.osgi.service.log.LogService;
 
-public class FSConsumerRegistryImpl implements OAuthServiceConsumerRegistry {
+public class FSConsumerRegistryImpl implements ManagedService, 
OAuthServiceConsumerRegistry {
     /**
      * Configuration PID.
      */
@@ -51,7 +52,11 @@
     // Injected service dependencies
     private volatile LogService m_logService;
     private volatile BundleContext m_context;
-    private FSConsumerStorage m_storage;
+    private FSConsumerStorage m_storage;
+    
+    public void start() {
+        m_logService.log(LogService.LOG_DEBUG, "FSConsumerRegistryImpl service 
started");
+    }
 
     /**
      * Invoked since this is a managed service.
@@ -61,7 +66,7 @@
      * @throws ConfigurationException
      *         In case some Config Admin exception occurred
      */
-    public synchronized void updated(final Dictionary<String, Object> 
dictionary) throws ConfigurationException {
+    public synchronized void updated(final Dictionary dictionary) throws 
ConfigurationException {
         if (dictionary != null) {
             String dataDirectoryName = (String) dictionary.get(DATA_DIRECTORY);
             if (dataDirectoryName == null || "".equals(dataDirectoryName)) {

Modified: 
trunk/amdatu-auth/test-integration/tests/src/test/java/org/amdatu/auth/test/integration/tests/util/AuthUtils.java
==============================================================================
--- 
trunk/amdatu-auth/test-integration/tests/src/test/java/org/amdatu/auth/test/integration/tests/util/AuthUtils.java
   (original)
+++ 
trunk/amdatu-auth/test-integration/tests/src/test/java/org/amdatu/auth/test/integration/tests/util/AuthUtils.java
   Wed Aug  3 15:16:05 2011
@@ -103,6 +103,10 @@
         if (user != null) {
             user.getCredentials().put(LoginService.PASSWORD_CREDENTIAL_KEY, 
password);
             Assert.assertTrue("Test user '" + name + "' could not be created", 
userAdmin.getRole(name) != null);
+        } else {
+            // Else, update the password.
+            user = (User) userAdmin.getRole(name);
+            user.getCredentials().put(LoginService.PASSWORD_CREDENTIAL_KEY, 
password);
         }
     }
 
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to