ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r801692 - /webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java
Date Thu, 06 Aug 2009 16:10:25 GMT
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: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message