Bug 780211 (SOA-2594) - JcrTckTest is failing on IBM JDK
Summary: JcrTckTest is failing on IBM JDK
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2594
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0.ER4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: FUTURE
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-18 13:26 UTC by Jiri Pechanec
Modified: 2010-11-18 20:05 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-18 20:05:08 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker MODE-1023 0 None None None Never
Red Hat Issue Tracker MODE-1024 0 None None None Never
Red Hat Issue Tracker SOA-2594 0 None None None Never

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.


Note You need to log in before you can comment on or make changes to this bug.