Andy,

I vaguely recall this was also discussed at the time. 

I just opened an internal defect, but I am not sure what it will take to 
get a fix since we are currently not blocked by this ourselves. I am not 
aware of our clients using xsd:yearMonthDuration, although that can change 
of course. We'll see what they say.

As for the experiments:

1) qexpr "'P2Y0M'^^xsd:yearMonthDuration - 'P1Y0M'^^xsd:yearMonthDuration"
: fails with the same NPE
2) qexpr "'P2Y4M'^^xsd:yearMonthDuration - 'P1Y2M'^^xsd:yearMonthDuration"
: fails with the same NPE
3) qexpr "'P1DT10H'^^xsd:dayTimeDuration - 'P1DT5H'^^xsd:dayTimeDuration 
": works fine
4)qexpr "'P2Y'^^xsd:yearMonthDuration + 'P1Y'^^xsd:yearMonthDuration": 
fails with the same NPE
5)qexpr "'P2Y0M'^^xsd:yearMonthDuration + 'P1Y0M'^^xsd:yearMonthDuration": 
fails with the same NPE
6)qexpr "'P2Y4M'^^xsd:yearMonthDuration + 'P1Y2M'^^xsd:yearMonthDuration": 
fails with the same NPE
7)qexpr "'P1DT10H'^^xsd:dayTimeDuration + 'P1DT5H'^^xsd:dayTimeDuration ": 
works fine

So, the problem seems to sit in xsd:yearMonthDuration

Simon




From:
Andy Seaborne <[email protected]>
To:
[email protected]
Date:
10/10/2012 03:27 PM
Subject:
Re: running dev tests



On 10/10/12 19:06, Simon Helsen wrote:
> thanks Andy. Now, I repeated the process with the latest, but there are 
2
> tests which suffer from the same problem and it looks like the check was
> added for one of them and it behaves as expected. This is what I see on
> the console:
>
> Running com.hp.hpl.jena.sparql.expr.TS_Expr
> 14:03:33 WARN  TestNodeValueOps          :: **** IBM JVM does not 
support
> xsd:ye
> arMonthDuration_xsd:dayTimeDuration

Good

> Tests run: 1023, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.75
> sec <<<
> FAILURE!

Bad.  I was too quick fixing one ... but hold on: nv_sub_22 is

'P2Y'^^xsd:yearMonthDuration  - 'P1Y'^^xsd:yearMonthDuration

which is XSD F&O section 10.6.2 op:subtract-yearMonthDurations
i.e. legal and defined.

is there a bug report to IBM Java about this?

Could you try the following expressions with arq.qexpr:

# sub_22
qexpr "'P2Y'^^xsd:yearMonthDuration - 'P1Y'^^xsd:yearMonthDuration"

# More fully specified
qexpr "'P2Y0M'^^xsd:yearMonthDuration - 'P1Y0M'^^xsd:yearMonthDuration"

# year and month
qexpr "'P2Y4M'^^xsd:yearMonthDuration - 'P1Y2M'^^xsd:yearMonthDuration"

# day-time
qexpr "'P1DT10H'^^xsd:dayTimeDuration - 'P1DT5H'^^xsd:dayTimeDuration "

The "+" versions should work as well:

qexpr "'P2Y'^^xsd:yearMonthDuration + 'P1Y'^^xsd:yearMonthDuration"

# More fully specified
qexpr "'P2Y0M'^^xsd:yearMonthDuration + 'P1Y0M'^^xsd:yearMonthDuration"

# year and month
qexpr "'P2Y4M'^^xsd:yearMonthDuration + 'P1Y2M'^^xsd:yearMonthDuration"

# day-time
qexpr "'P1DT10H'^^xsd:dayTimeDuration + 'P1DT5H'^^xsd:dayTimeDuration "


                 Andy

>
>
> 
------------------------------------------------------------------------------
> Test set: com.hp.hpl.jena.sparql.expr.TS_Expr
> 
-------------------------------------------------------------------------------
> Tests run: 1023, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.751
> sec <<< FAILURE!
> nv_sub_22(com.hp.hpl.jena.sparql.expr.TestNodeValueOps)  Time elapsed:
> 0.006 sec  <<< ERROR!
> java.lang.NullPointerException
>          at
> org.apache.xerces.jaxp.datatype.AbstractDurationImpl.addDuration(Unknown
> Source)
>          at
> org.apache.xerces.jaxp.datatype.AbstractDurationImpl.add(Unknown Source)
>          at javax.xml.datatype.Duration.subtract(Unknown Source)
>          at
> 
com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueOps.subtractionNV(NodeValueOps.java:185)
>          at
> 
com.hp.hpl.jena.sparql.expr.TestNodeValueOps.testSub(TestNodeValueOps.java:155)
>          at
> 
com.hp.hpl.jena.sparql.expr.TestNodeValueOps.testSub(TestNodeValueOps.java:147)
>          at
> 
com.hp.hpl.jena.sparql.expr.TestNodeValueOps.nv_sub_22(TestNodeValueOps.java:96)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
>          at
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
>          at java.lang.reflect.Method.invoke(Method.java:613)
>          at
> 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>          at
> 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>          at
> 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>          at
> 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>          at 
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>          at
> 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
>          at
> 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
>          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>          at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>          at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>          at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>          at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>          at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
>          at org.junit.runners.Suite.runChild(Suite.java:128)
>          at org.junit.runners.Suite.runChild(Suite.java:24)
>          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>          at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>          at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>          at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>          at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>          at
> 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>          at
> 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>          at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
>          at
> 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
>          at
> 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
>          at
> 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
>          at
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
>          at java.lang.reflect.Method.invoke(Method.java:613)
>          at
> 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
>          at
> 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
>          at
> 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
>          at
> 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
>          at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
>
>
>
>
> From:
> Andy Seaborne <[email protected]>
> To:
> [email protected]
> Date:
> 10/10/2012 09:31 AM
> Subject:
> Re: running dev tests
>
>
>
> On 10/10/12 14:06, Simon Helsen wrote:
>> maven version: 3.0.3 (I guess I could upgrade to 3.0.4, which seems to
> be
>> the latest)
>
> I'm running 3.0.4 (although my instinct is that this is not the issue
> because the error includes "maven-assembly-plugin:2.2.1" which is the
> same).  No idea currently where the .* comes from.
>
>>
>> The IBM JRE can be detected like this:
>>
>> private boolean isIBMJRE() {
>>           String vmName = System.getProperty("java.vm.name");
>>           return vmName != null && vmName.equals("IBM J9 VM");
>> }
>>
>
> Thanks - I've tweaked the test so it catches NPE and warns, but does not
> cause a test failure.
>
> If it is fixed so as to throw IllegalStateException, the test is silent.
>
>                   Andy
>
>
>
>



Reply via email to