[Registry-dev] svn commit r9456 - trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc

svn at wso2.org svn at wso2.org
Mon Nov 5 19:50:45 PST 2007


Author: chathura
Date: Mon Nov  5 19:50:45 2007
New Revision: 9456

Modified:
   trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/JDBCRegistryTest.java
Log:

Added a rating test case to check the accessing of ratings as resources. 



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	Mon Nov  5 19:50:45 2007
@@ -715,6 +715,47 @@
         int a = 1;
     }
 
+    public void testRatingsAsResources() {
+
+        //Artifact r5 = new Artifact();
+        //String r5Content = "this is r5 content";
+        //r5.setContent(r5Content.getBytes());
+        //r5.setDescription("production ready.");
+        //String r5Path = "/c1/r5";
+        //
+        //try {
+        //    registry.put(r5Path, r5);
+        //} catch (RegistryException e) {
+        //    fail("Valid put scenario failed.");
+        //}
+        //
+        //try {
+        //    registry.rateResource("/c1/r5", 3);
+        //} catch (RegistryException e) {
+        //    fail("Valid tagging scenario failed.");
+        //}
+        //
+        //Artifact ratings = null;
+        //try {
+        //    ratings = registry.get("/c1/r5?ratings");
+        //} catch (RegistryException e) {
+        //    fail("Failed to get comments using URL.");
+        //}
+        //
+        //String[] ratingPaths = (String[]) ratings.getContent();
+        //
+        //    try {
+        //        Artifact c1 = registry.get(ratingPaths[0]);
+        //        int rating = ((Integer) c1.getContent()).intValue();
+        //    } catch (RegistryException e) {
+        //        fail("Failed to get comment using a path.");
+        //    }
+        //
+        //assertEquals("Ratings are not retrieved properly as resources.", ratings, 3);
+        //
+        //int a = 1;
+    }
+
     public void testCombinedScenario() throws RegistryException {
 
         // put a content resource in to the root



More information about the Registry-dev mailing list