Author: deepal
Date: Mon Jan 14 03:08:43 2008
New Revision: 12212

Log:

correcting the last updated user when creating a resource like
 /acb/xyz/c1/ra

Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
   trunk/registry/modules/core/src/test/java/org/wso2/registry/app/UserTest.java

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
      (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
      Mon Jan 14 03:08:43 2008
@@ -765,6 +765,7 @@
 
                 if (parentArtifact != null) {
                     path = parentArtifact.getPath();
+                    
parentArtifact.setLastUpdaterUserName(resource.getLastUpdaterUserName());
                     parentNextVersionNumber = updateDependencyTable(
                             parentArtifact, parentNextVersionNumber, false, 
connection);
 

Modified: 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/UserTest.java
==============================================================================
--- 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/UserTest.java   
    (original)
+++ 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/UserTest.java   
    Mon Jan 14 03:08:43 2008
@@ -40,6 +40,23 @@
         }
     }
 
+     public void testHierachicalResource() throws Exception{
+            Resource r1=new Resource();
+            String content="this is my content11";
+            r1.setContent(content.getBytes());
+
+            String path="/d1/d2/d3/r1";
+
+            try{
+                registry.put(path,r1);
+                r1 = registry.get("/d1/d2");
+                assertEquals(r1.getLastUpdaterUserName() ,"admin");
+            }catch(RegistryException e) {
+                fail("Couldn't put content to path /c1/r7");
+            }
+
+        }
+
     private  static Registry registry = null;
 
     public void testAddResouces1() throws Exception {
@@ -94,5 +111,7 @@
         }
     }
 
+    
+
 }
 

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to