Author: kstam
Date: Thu Aug  6 16:10:25 2009
New Revision: 801692

URL: http://svn.apache.org/viewvc?rev=801692&view=rev
Log:
SCOUT-86 Fixed test to show that only organizations owned by the publisher are 
retrieved.

Modified:
    
webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java

Modified: 
webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java
URL: 
http://svn.apache.org/viewvc/webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java?rev=801692&r1=801691&r2=801692&view=diff
==============================================================================
--- 
webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java
 (original)
+++ 
webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java
 Thu Aug  6 16:10:25 2009
@@ -145,7 +145,7 @@
         }
     }
     
-    @Test @Ignore
+    @Test
        public void testGetRegistryObjects() {
 
        login();
@@ -158,36 +158,40 @@
             if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
             {
                System.out.println("BR.size : " + br.getCollection().size());
-               Collection coll = br.getCollection();
-               Iterator iterator = coll.iterator();
+               Collection coll1 = br.getCollection();
+               Iterator iterator = coll1.iterator();
+               Collection<String> orgKeys = new ArrayList<String>();
                while (iterator.hasNext()) {
                        Organization org = (Organization) iterator.next();
                        System.out.println("BR " + 
org.getName().getValue(Locale.US));
+                       orgKeys.add(org.getKey().getId());
                }
 
                if (br.getCollection().size() == 0) {
                        fail("Found no organizations for user 1");
                }
+               
+               BulkResponse br2 = 
bqm2.getRegistryObjects(LifeCycleManager.ORGANIZATION);
+                if (br2.getStatus() == JAXRResponse.STATUS_SUCCESS)
+                {
+                       Collection coll = br2.getCollection();
+                       Iterator iterator2 = coll.iterator();
+                       while (iterator2.hasNext()) {
+                               Organization org = (Organization) 
iterator2.next();
+                               System.out.println("BR2 " + 
org.getName().getValue(Locale.US));
+                               if (orgKeys.contains(org.getKey().getId())) {
+                                       fail("Should not find organizations 
from user1");
+                               }
+                               
+                       }
+                }              
+               
+               deleteTempOrg(org1.getKey());
+               deleteTempOrg(org2.getKey());
 
             }
                
-               BulkResponse br2 = 
bqm2.getRegistryObjects(LifeCycleManager.ORGANIZATION);
-            if (br2.getStatus() == JAXRResponse.STATUS_SUCCESS)
-            {
-               if (br2.getCollection().size() != 0) {
-                       fail("There should be no found organizations for user 
2, found "
-                                       + br2.getCollection().size());
-               }
-               Collection coll = br2.getCollection();
-               Iterator iterator = coll.iterator();
-               while (iterator.hasNext()) {
-                       Organization org = (Organization) iterator.next();
-                       System.out.println("BR2 " + 
org.getName().getValue(Locale.US));
-               }
-            }          
                
-               deleteTempOrg(org1.getKey());
-               deleteTempOrg(org2.getKey());
         
                } catch (JAXRException e) {
                        e.printStackTrace();



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to