]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3365: RelationsCommon JAX-B schema type for the predicate element should be...
authorRichard Millet <richard.millet@berkeley.edu>
Sun, 9 Jan 2011 23:12:09 +0000 (23:12 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Sun, 9 Jan 2011 23:12:09 +0000 (23:12 +0000)
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java
services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/CollectionSpacePerformanceTest.java
services/jaxb/src/main/resources/relations_common.xsd
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationValidatorHandler.java

index 856e3e5c6fe0324603b2ef75cf3eb9d44df31b8d..08f6eab4741f83182782ef9c18376e7bb25a9461 100755 (executable)
@@ -116,7 +116,7 @@ public abstract class CollectionSpaceIntegrationTest {
      * @param rt the rt\r
      */\r
     void fillRelation(RelationsCommon relation, String documentId1, String documentType1,\r
-               String documentId2, String documentType2, RelationshipType rt)\r
+               String documentId2, String documentType2, String rt)\r
     {\r
         relation.setDocumentId1(documentId1);\r
         relation.setDocumentType1(documentType1);\r
index 74ab97e5b348307ff2bf83e5e91cd36f863fae2a..78cde6fe7abd13aed84127de1603ce8914a2757b 100755 (executable)
@@ -113,7 +113,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            RelationsCommon relation = new RelationsCommon();
            fillRelation(relation, collectionObjectCsid, CollectionobjectsCommon.class.getSimpleName(),
                        intakeCsid, IntakesCommon.class.getSimpleName(),
-                       RelationshipType.COLLECTIONOBJECT_INTAKE);
+                       RelationshipType.COLLECTIONOBJECT_INTAKE.toString());
            // Create the part and fill it with the relation object
            multipart = new MultipartOutput();
            commonPart = multipart.addPart(relation, MediaType.APPLICATION_XML_TYPE);
@@ -132,7 +132,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            //
            // Now try to retrieve the Intake record of the CollectionObject.
            //
-           String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.value();
+           String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.toString();
            ClientResponse<RelationsCommonList> resultResponse = relationClient.readList(
                        collectionObjectCsid,
                        CollectionobjectsCommon.class.getSimpleName(),
@@ -175,7 +175,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                }
                
                Assert.assertEquals(resultRelation.getDocumentId1(), collectionObjectCsid);
-               Assert.assertEquals(resultRelation.getRelationshipType(), RelationshipType.COLLECTIONOBJECT_INTAKE);
+               Assert.assertEquals(resultRelation.getRelationshipType(), RelationshipType.COLLECTIONOBJECT_INTAKE.toString());
                Assert.assertEquals(resultRelation.getDocumentId2(), intakeCsid);
             System.out.println();
                i++;            
index b6e161b385943d0d73cea5f5dff4225025b016f9..74d161446a80ac0eb87b5639d9661dff723d2f33 100644 (file)
@@ -126,7 +126,7 @@ public abstract class CollectionSpacePerformanceTest {
         relation.setDocumentId2(documentId2);\r
         relation.setDocumentType2(documentType2);\r
         \r
-        relation.setRelationshipType(rt);\r
+        relation.setRelationshipType(rt.toString());\r
     }\r
        \r
        /**\r
index ad46d4bc6c1bd5a9bf6f0b506a3dbee2479c15cd..58f91f10af0dae6a8c950731d1390dae0538a4d3 100644 (file)
                 <xs:element name="documentId2" type="xs:string" minOccurs="1"/>\r
                 <xs:element name="documentType2" type="xs:string" minOccurs="1"/>\r
                 <!-- type of relationship between two entities -->\r
-                <xs:element name="relationshipType" type="rel:RelationshipType" minOccurs="1"/>\r
+                <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
                 <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
             </xs:sequence>\r
         </xs:complexType>\r
     </xs:element>\r
 \r
     <!-- enumeration defining the type of relationship between two entities -->\r
+    <!-- REM: Deprecating this type as it is too restrictive for the "relations_common:relationshipType" field  and will be replaced with "xs:string" -->\r
     <xs:simpleType name="RelationshipType">\r
         <xs:restriction base="xs:string">\r
             <!-- Added for compatibility with current default value -->\r
index a12c5f291e6a592e9c57f1afb755b57686eca95d..04d624db3349a6d86b13bea11e665c96cbfb7f97 100644 (file)
@@ -851,7 +851,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
                 "SubjectType-" + identifier + "-type",
                 "Object-" + identifier,
                 "ObjectType-" + identifier + "-type",
-                RelationshipType.COLLECTIONOBJECT_INTAKE,
+                RelationshipType.COLLECTIONOBJECT_INTAKE.toString(),
                 RelationshipType.COLLECTIONOBJECT_INTAKE + ".displayName");
     }
 
@@ -868,7 +868,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
     private void fillRelation(RelationsCommon relation,
             String documentId1, String documentType1,
             String documentId2, String documentType2,
-            RelationshipType rt,
+            String rt,
             String rtDisplayName) {
         relation.setDocumentId1(documentId1);
         relation.setDocumentType1(documentType1);
index 01fc0228f612ab091d8f9fcd32183932abc6a1d9..5f2466d6a232b0a16f3785cff7a46a77a9f7fdc7 100644 (file)
@@ -34,6 +34,9 @@ public class RelationValidatorHandler extends ValidatorHandlerImpl<MultipartInpu
        try {\r
                RelationsCommon relationsCommon = (RelationsCommon)getCommonPart();\r
                assert(relationsCommon != null);\r
+               if (logger.isTraceEnabled() == true) {\r
+                       logger.trace(relationsCommon.toString());\r
+               }\r
                \r
                assert(relationsCommon.getDocumentId1() != null);\r
                assert(relationsCommon.getDocumentId1().length() != 0);\r