Bug 780211 (SOA-2594)

Summary: JcrTckTest is failing on IBM JDK
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: EDSAssignee: Van Halbert <vhalbert>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.1.0.ER4   
Target Milestone: ---   
Target Release: FUTURE   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2594
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-18 20:05:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 1 Randall Hauch 2010-11-18 16:12:20 UTC
The file system errors seem to be because of a smaller limit on the length of file paths.

The following error is more confusing:

junit.framework.AssertionFailedError: Conversion from a Name value to a Boolean value should throw a ValueFormatException.
	at org.apache.jackrabbit.test.api.NamePropertyTest.testGetBoolean(NamePropertyTest.java:77)
	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)

This code in NamePropertyTest.testGetBoolean() is as follows:

            Value val = PropertyUtil.getValue(prop);
            val.getBoolean();

and we only have one implementation of Value, called JcrValue. The getBooleanMethod() implementation delegates to the BooleanValueFactory in the graph module:

    public boolean getBoolean() throws ValueFormatException {
        try {
            boolean convertedValue = valueFactories.getBooleanFactory().create(value);
            return convertedValue;
        } catch (RuntimeException error) {
            throw createValueFormatException(boolean.class);
        }
    }

and the BooleanValueFactory.create(Object) method (since the type of 'value' is Object) does an instanceof check on the 'value' object. It should be a Name, but it must be something else. For example, if this is a String, then per the specification the conversion from a STRING type to a BOOLEAN type is to use the Boolean.valueOf(value) method, which of course returns true if the value is case-independently equal to "true", and false in all other cases.

The crazy thing is that the constructor for JcrValue will always convert the value object to the correct object type; i.e., in this case the NameFactory is used to create a Name object from the value. Thus the value should always be a Name.

I wonder if there is some difference with the IBM JDK in how switch statements behave.


Comment 2 Randall Hauch 2010-11-18 16:22:18 UTC
Maybe a more likely explanation is that the Property object used by the test is not necessarily what we're expecting.

Comment 3 Randall Hauch 2010-11-18 17:10:50 UTC
Link: Added: This issue related MODE-1023


Comment 4 Randall Hauch 2010-11-18 17:20:13 UTC
I've logged MODE-1023 as being related to this issue, and hopefully the changes will fix the NamePropertyTest failure on the IBM JDK. (I have no way of testing this locally, and I'm not sure the project should be testing on many different JDKs.)

Comment 6 Randall Hauch 2010-11-18 19:09:09 UTC
Link: Added: This issue related MODE-1024


Comment 7 Randall Hauch 2010-11-18 19:56:06 UTC
I logged MODE-1024 to deal with the File System connector unit test failures.

Comment 8 Van Halbert 2010-11-18 20:05:08 UTC
ModeShape has committed a fix to the 2.2.x branch.  Also, you'll want to read the ModeShape related jira's to become better familiar with the changes.