Author: chathura
Date: Sat Dec 15 23:24:40 2007
New Revision: 11170
Log:
Changed the name of the ordering parameter of the Registry interface to
"recentFirst".
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
trunk/registry/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/JDBCRegistryTest.java
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
Sat Dec 15 23:24:40 2007
@@ -211,13 +211,13 @@
* @param to If given, logs for activities occured before the given date
will be returned. If
* null, there will not be a bound for the ending date.
*
- * @param descending If true, returned activities will be in the
descending order. If false,
+ * @param recentFirst If true, returned activities will be in the
descending order. If false,
* returned activities will be in the ascending order.
*
* @return Array of LogEntry objects representing the logs
*
* @throws RegistryException if there is a problem
*/
- LogEntry[] getLogs(String resourcePath, int action, String userName, Date
from, Date to, boolean descending)
+ LogEntry[] getLogs(String resourcePath, int action, String userName, Date
from, Date to, boolean recentFirst)
throws RegistryException;
}
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
Sat Dec 15 23:24:40 2007
@@ -404,7 +404,7 @@
String userName,
Date from,
Date to,
- boolean descending) throws RegistryException {
+ boolean recentFirst) throws RegistryException {
Abdera abdera = new Abdera();
AbderaClient abderaClient = new AbderaClient(abdera);
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
Sat Dec 15 23:24:40 2007
@@ -133,7 +133,7 @@
return null; //To change body of implemented methods use File |
Settings | File Templates.
}
- public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean descending)
+ public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean recentFirst)
throws RegistryException {
return new LogEntry[0]; //To change body of implemented methods use
File | Settings | File Templates.
}
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
Sat Dec 15 23:24:40 2007
@@ -297,7 +297,7 @@
resourceMap.remove(resourcePath);
}
- public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean descending)
+ public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean recentFirst)
throws RegistryException {
throw new UnsupportedOperationException(
"Logs are not supported in HashMap based in-memory registry.");
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
Sat Dec 15 23:24:40 2007
@@ -951,7 +951,7 @@
public LogEntry[] getLogs(String resourcePath,
int action,
String userName,
- Date from, Date to, boolean descending) throws
RegistryException {
+ Date from, Date to, boolean recentFirst) throws
RegistryException {
Connection conn = connectionFactory.getConnection();
@@ -959,7 +959,7 @@
try {
logEntryList =
- logsDAO.getLogs(resourcePath, action, userName, from, to,
descending, conn);
+ logsDAO.getLogs(resourcePath, action, userName, from, to,
recentFirst, conn);
} catch (SQLException e) {
String msg = "Could not get logs. Caused by: " + e.getMessage();
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
Sat Dec 15 23:24:40 2007
@@ -323,9 +323,9 @@
return registry.executeQuery(path, parameters);
}
- public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean descending)
+ public LogEntry[] getLogs(String resourcePath, int action, String
userName, Date from, Date to, boolean recentFirst)
throws RegistryException {
User.setCurrentUser(userID);
- return registry.getLogs(resourcePath, action, userName, from, to,
descending);
+ return registry.getLogs(resourcePath, action, userName, from, to,
recentFirst);
}
}
Modified:
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/JDBCRegistryTest.java
==============================================================================
---
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/JDBCRegistryTest.java
(original)
+++
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/JDBCRegistryTest.java
Sat Dec 15 23:24:40 2007
@@ -257,6 +257,28 @@
assertEquals("Content is not restored properly.", "R1 content",
restoredContent);
}
+ // todo: test this with persistence db
+ public void testPutOnSamePath() {
+
+ try {
+ Resource userProfile = new Resource();
+ userProfile.setContent("test".getBytes());
+
+ registry.put("/foo/bar", userProfile);
+
+ Resource userProfile2 = new Resource();
+ userProfile2.setContent("test".getBytes());
+ registry.put("/foo/bar", userProfile2);
+
+ Resource myUserProfile = registry.get("/foo/bar");
+ Object userData = myUserProfile.getContent();
+
+ int a = 1;
+ } catch (RegistryException e) {
+ e.printStackTrace();
+ }
+ }
+
//public void testDeleteWithVersioning() {
//
// String r1Content = "r1 content1";
@@ -354,7 +376,7 @@
assertTrue("Collection children are not restored properly.",
!containsString(restoredC10Children, "/c10/r2"));
}
-
+
public void testComments() {
// add a resource
@@ -918,7 +940,7 @@
assertEquals("/wso2/wsas/v1/r2",((String[])r2.getContent())[0]);
registry.restoreVersion("/wso2/wsas?v=2");
- r2= registry.get("/wso2/wsas/v1");
+ r2= registry.get("/wso2/wsas/v1");
//chcek whether the content is corrcet
assertEquals("/wso2/wsas/v1/r1",((String[])r2.getContent())[0]);
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev