From: Patrick Schmitz Date: Wed, 13 Jan 2010 20:14:00 +0000 (+0000) Subject: NOJIRA - Fixed typo bug in importer, added more stringent tests for readItems and... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=fd665e72c939a7b41c636c69bdb20597c5f88735;p=tmp%2Fjakarta-migration.git NOJIRA - Fixed typo bug in importer, added more stringent tests for readItems and readItemList. --- diff --git a/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java b/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java index bbb1f9a93..f2a117c83 100644 --- a/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java +++ b/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java @@ -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 res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart); int statusCode = res.getStatus(); diff --git a/services/organization/import/.project b/services/organization/import/.project index 245a8c24f..08d161391 100644 --- a/services/organization/import/.project +++ b/services/organization/import/.project @@ -3,6 +3,9 @@ org.collectionspace.services.organization.importer + org.collectionspace.services.client + org.collectionspace.services.common + org.collectionspace.services.organization.jaxb diff --git a/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java b/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java index 49d570dea..0d05865d8 100644 --- a/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java +++ b/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java @@ -117,7 +117,7 @@ public class OrgAuthorityBaseImport { } MultipartOutput multipart = OrgAuthorityClientUtils.createOrganizationInstance( vcsid, - refName, orgInfo, client.getCommonPartName() ); + refName, orgInfo, client.getItemCommonPartName() ); ClientResponse res = client.createItem(vcsid, multipart); int statusCode = res.getStatus();