Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-11650IT Failure JpaMetadataProviderTest All entries should be the CompositeMetadataProviderImpl
      KULRICE-3747Unit Test Failures in 1.0.1.1
      KULRICE-14166Java 8 breaks JPA unit tests due to result order
      KULRICE-7399fix unit test failures
      KULRICE-9939ComponentUtilsTest unit test failures
      KULRICE-10757LegacyDataAdapterLegacyDetectionTest Unit test failures
      KULRICE-10692AnnotationMetadataProviderImplTest.testOrderingOfInheritedProperties Unit Test Failure
      KULRICE-9908ComponentUtilsTest.initializationError unit test failures
      KULRICE-10415ViewIndexTest.testClearIndexesAfterRender unit test failure
      KULRICE-10758LegacyDetectorTest.testUseLegacy_InContext unit test failure
    • Rice Team:
      Middleware
    • Rice Module:
      KRAD
    • Sprint:
      Rice Sprint 2015-02-18, Rice Sprint 2015-03-04
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      1

      Issue Links

        Activity

        Show
        Shannon Hess added a comment - Link to failures: https://ci.kuali.org/view/rice/view/2.6/view/list/job/rice-2.6-test-unit/140/#showFailuresLink
        Hide
        Shannon Hess added a comment - - edited

        Error in build job:
        Error Message

        retrieval by last attribute name (dateProperty) failed
        Stacktrace
        
        java.lang.AssertionError: retrieval by last attribute name (dateProperty) failed
        	at org.junit.Assert.fail(Assert.java:88)
        	at org.junit.Assert.assertTrue(Assert.java:41)
        	at org.junit.Assert.assertNotNull(Assert.java:621)
        	at org.kuali.rice.krad.data.jpa.JpaMetadataProviderTest.testGetMetadataForRelationship_byLastAttribute_dateProperty(JpaMetadataProviderTest.java:403)
        

        I'm not able to reproduce this issue locally unless I make lastAttributeToRelationshipMap null when I debug the test. embedded is null so if both lastAttributeToRelationshipMap and embedded are null getRelationshipByLastAttributeInRelationship will return null and the error occurs. I'm trying to determine if this is what is happening when the job runs in CI and why that might be the case.

        		
        // Look locally
        if (lastAttributeToRelationshipMap != null) {
            relationship = lastAttributeToRelationshipMap.get(attributeName);
        }
        
        // if nothing found local, recurse into the embedded provider
        if (relationship == null && embedded != null) {
            relationship = embedded.getRelationshipByLastAttributeInRelationship(attributeName);
        }
        
        return relationship;
        
        Show
        Shannon Hess added a comment - - edited Error in build job: Error Message retrieval by last attribute name (dateProperty) failed Stacktrace java.lang.AssertionError: retrieval by last attribute name (dateProperty) failed at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertNotNull(Assert.java:621) at org.kuali.rice.krad.data.jpa.JpaMetadataProviderTest.testGetMetadataForRelationship_byLastAttribute_dateProperty(JpaMetadataProviderTest.java:403) I'm not able to reproduce this issue locally unless I make lastAttributeToRelationshipMap null when I debug the test. embedded is null so if both lastAttributeToRelationshipMap and embedded are null getRelationshipByLastAttributeInRelationship will return null and the error occurs. I'm trying to determine if this is what is happening when the job runs in CI and why that might be the case. // Look locally if (lastAttributeToRelationshipMap != null ) { relationship = lastAttributeToRelationshipMap.get(attributeName); } // if nothing found local, recurse into the embedded provider if (relationship == null && embedded != null ) { relationship = embedded.getRelationshipByLastAttributeInRelationship(attributeName); } return relationship;
        Hide
        Shannon Hess added a comment -

        Another thing - both testGetMetadataForRelationship_byLastAttribute_stringProperty and testGetMetadataForRelationship_byLastAttribute_primaryKeyProperty are both passing and they basically the same test as testGetMetadataForRelationship_byLastAttribute_dateProperty. The only difference being that dateProperty field is a Date in TestDataObject and the other properties are Strings.

        Show
        Shannon Hess added a comment - Another thing - both testGetMetadataForRelationship_byLastAttribute_stringProperty and testGetMetadataForRelationship_byLastAttribute_primaryKeyProperty are both passing and they basically the same test as testGetMetadataForRelationship_byLastAttribute_dateProperty. The only difference being that dateProperty field is a Date in TestDataObject and the other properties are Strings.
        Hide
        Claus Niesen added a comment -

        The test fails when running java 1.7. It passes in 1.8.

        At line 636 debug point in DataObjectMetadataImpl.getRelationshipByLastAttributeInRelationship I found that the lastAttributeToRelationshipMap differs

        Java 1.8:

        • date
        • primary
        • string
          Java 1.7
        • string
        • primary
          (date is missing)
        Show
        Claus Niesen added a comment - The test fails when running java 1.7. It passes in 1.8. At line 636 debug point in DataObjectMetadataImpl.getRelationshipByLastAttributeInRelationship I found that the lastAttributeToRelationshipMap differs Java 1.8: date primary string Java 1.7 string primary (date is missing)
        Hide
        Shannon Hess added a comment -

        The problem is in these lines of code:

        // last attribute in list linking the objects
        if (!rel.getAttributeRelationships().isEmpty()) {
            DataObjectAttributeRelationship relAttr = rel.getAttributeRelationships().get(0);
            lastAttributeToRelationshipMap.put(relAttr.getParentAttributeName(), rel);
        }
        

        It used to be:

        DataObjectAttributeRelationship relAttr = rel.getAttributeRelationships().get(rel.getAttributeRelationships().size() - 1);
        

        If you change it back to that, it fails in 1.8 locally and passes in CI. The date is overwritten with string due to the order of the map.

        Show
        Shannon Hess added a comment - The problem is in these lines of code: // last attribute in list linking the objects if (!rel.getAttributeRelationships().isEmpty()) { DataObjectAttributeRelationship relAttr = rel.getAttributeRelationships().get(0); lastAttributeToRelationshipMap.put(relAttr.getParentAttributeName(), rel); } It used to be: DataObjectAttributeRelationship relAttr = rel.getAttributeRelationships().get(rel.getAttributeRelationships().size() - 1); If you change it back to that, it fails in 1.8 locally and passes in CI. The date is overwritten with string due to the order of the map.
        Hide
        Shannon Hess added a comment -

        I talked to Jonathan and the relationship that needs to be added to lastAttributeToRelationshipMap is the last relationship in the primary key mapping. The one we're having problems with is the following in AnotherReferencedDataObject.java. Since dateProperty is the second part of the key it should be the one added to the lastAttributeToRelationshipMap.

        	@Id
        	@Column(name = "STR_PROP")
        	String stringProperty;
        
        	@Id
        	@Column(name = "DATE_PROP")
        	@Temporal(TemporalType.DATE)
        	Date dateProperty;
        

        In 1.8, the attributeRelationships are in the opposite order with dateProperty being first. I'm looking into EclipseLinkJpaMetadataProviderImpl.populateImplementationSpecificRelationshipLevelMetadata

        Show
        Shannon Hess added a comment - I talked to Jonathan and the relationship that needs to be added to lastAttributeToRelationshipMap is the last relationship in the primary key mapping. The one we're having problems with is the following in AnotherReferencedDataObject.java. Since dateProperty is the second part of the key it should be the one added to the lastAttributeToRelationshipMap. @Id @Column(name = "STR_PROP" ) String stringProperty; @Id @Column(name = "DATE_PROP" ) @Temporal(TemporalType.DATE) Date dateProperty; In 1.8, the attributeRelationships are in the opposite order with dateProperty being first. I'm looking into EclipseLinkJpaMetadataProviderImpl.populateImplementationSpecificRelationshipLevelMetadata
        Show
        Shannon Hess added a comment - https://github.com/kuali/rice/pull/68/

          People

          • Assignee:
            Shannon Hess
            Reporter:
            Shannon Hess
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile

                Structure Helper Panel