Author: deepal
Date: Thu Jan 17 03:15:08 2008
New Revision: 12404

Log:

added a new test case to test the tagging with APP 

Added:
   
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPBasedTagTest.java
Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
   
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/TagsTest.java

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
 Thu Jan 17 03:15:08 2008
@@ -328,7 +328,13 @@
     public TaggedResourcePath[] getResourcePathsWithTag(String tag) throws 
RegistryException {
         Abdera abdera = new Abdera();
         AbderaClient abderaClient = new AbderaClient(abdera);
-        ClientResponse clientResponse = abderaClient.get(baseURI +
+        String taggingUri;
+        if (baseURI.endsWith("/")) {
+            taggingUri = baseURI;
+        } else {
+           taggingUri = baseURI + "/";
+        }
+        ClientResponse clientResponse = abderaClient.get(taggingUri +
                 URL_SEPARATOR +
                 PARAMETER_TAG_PATHS +
                 ":" + tag , getAuthorization());

Added: 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPBasedTagTest.java
==============================================================================
--- (empty file)
+++ 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPBasedTagTest.java
        Thu Jan 17 03:15:08 2008
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.wso2.registry.app;
+
+import org.wso2.registry.RegistryException;
+import org.wso2.registry.Resource;
+import org.wso2.registry.Tag;
+import org.wso2.registry.jdbc.TagsTest;
+import org.wso2.registry.secure.SecureRegistry;
+
+import java.net.URL;
+
+public class APPBasedTagTest extends TagsTest {
+    RegistryServer server = new RegistryServer();
+
+    public void setUp() {
+        try {
+            if (registry == null) {
+                server.start();
+                registry = new RemoteRegistry(new 
URL("http://localhost:8081/wso2registry/atom";), "admin", "admin");
+            }
+        } catch (Exception e) {
+            fail("Failed to initialize the registry.");
+        }
+    }
+
+    public void testMultipleUserTags() {
+    }
+}

Modified: 
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/TagsTest.java
==============================================================================
--- 
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/TagsTest.java  
    (original)
+++ 
trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/TagsTest.java  
    Thu Jan 17 03:15:08 2008
@@ -30,8 +30,8 @@
      * Registry instance for use in tests. Note that there should be only one 
Registry instance in a
      * JVM.
      */
-    private static Registry registry = null;
-    private static RegistryRealm realm = null;
+    protected static Registry registry = null;
+    protected static RegistryRealm realm = null;
 
     public void setUp() {
         try {

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

Reply via email to