]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA - Fixed typo bug in importer, added more stringent tests for readItems and...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Wed, 13 Jan 2010 20:14:00 +0000 (20:14 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Wed, 13 Jan 2010 20:14:00 +0000 (20:14 +0000)
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/organization/import/.project
services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java

index bbb1f9a93937c58a77682b622b8dda1118cc59c4..f2a117c83f4af5dff18ec1526cea6332b4e04793 100644 (file)
@@ -399,7 +399,13 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         OrganizationsCommon organization = (OrganizationsCommon) extractPart(input,
                 client.getItemCommonPartName(), OrganizationsCommon.class);
         Assert.assertNotNull(organization);
-
+        boolean showFull = true;
+        if(showFull && logger.isDebugEnabled()){
+            logger.debug(testName + ": returned payload:");
+            logger.debug(objectAsXmlString(organization,
+                    OrganizationsCommon.class));
+        }
+        Assert.assertEquals(organization.getInAuthority(), knownResourceId);
     }
 
     // Failure outcomes
@@ -528,19 +534,23 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         }
         Assert.assertEquals( nItemsReturned, nItemsToCreateInList);
 
-        // Optionally output additional data about list members for debugging.
-        boolean iterateThroughList = false;
-        if (iterateThroughList && logger.isDebugEnabled()) {
-            int i = 0;
-            for (OrganizationsCommonList.OrganizationListItem item : items) {
+        int i = 0;
+        for (OrganizationsCommonList.OrganizationListItem item : items) {
+               Assert.assertTrue((null != item.getRefName()), "Item refName is null!");
+               Assert.assertTrue((null != item.getDisplayName()), "Item refName is null!");
+               // Optionally output additional data about list members for debugging.
+               boolean showDetails = true;
+               if (showDetails && logger.isDebugEnabled()) {
                 logger.debug("  " + testName + ": list-item[" + i + "] csid=" +
                         item.getCsid());
-                logger.debug("  " + testName + ": list-item[" + i + "] shortName=" +
+                logger.debug("  " + testName + ": list-item[" + i + "] refName=" +
+                        item.getRefName());
+                logger.debug("  " + testName + ": list-item[" + i + "] displayName=" +
                         item.getDisplayName());
                 logger.debug("  " + testName + ": list-item[" + i + "] URI=" +
                         item.getUri());
-                i++;
             }
+            i++;
         }
     }
 
@@ -811,7 +821,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         MultipartOutput multipart = 
                OrgAuthorityClientUtils.createOrganizationInstance(
                        knownResourceId, createRefName(NON_EXISTENT_ID),
-                       nonexOrgMap, client.getCommonPartName() );
+                       nonexOrgMap, client.getItemCommonPartName() );
         ClientResponse<MultipartInput> res =
                 client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
         int statusCode = res.getStatus();
index 245a8c24f0077e88da993e82f45330f2daf78461..08d1613911b18579f487f27e4cc73d00f7a7d2df 100644 (file)
@@ -3,6 +3,9 @@
        <name>org.collectionspace.services.organization.importer</name>\r
        <comment></comment>\r
        <projects>\r
+               <project>org.collectionspace.services.client</project>\r
+               <project>org.collectionspace.services.common</project>\r
+               <project>org.collectionspace.services.organization.jaxb</project>\r
        </projects>\r
        <buildSpec>\r
                <buildCommand>\r
index 49d570dea59059cc751d8af0f22d100c413ea7d2..0d05865d87c36f8155715a3b900169131c17ee42 100644 (file)
@@ -117,7 +117,7 @@ public class OrgAuthorityBaseImport {
        }
        MultipartOutput multipart = 
                OrgAuthorityClientUtils.createOrganizationInstance( vcsid, 
-                               refName, orgInfo, client.getCommonPartName() );
+                               refName, orgInfo, client.getItemCommonPartName() );
        ClientResponse<Response> res = client.createItem(vcsid, multipart);
 
        int statusCode = res.getStatus();