TestFonts failing on my laptop

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TestFonts failing on my laptop

pj.fanning
Hi,
The new test, TestFonts, is failing on my laptop.
https://svn.apache.org/viewvc?view=revision&revision=1801329

I have a Mac and the font size seems to be 399 instead of the 312 expected in the test.

java.lang.AssertionError: expected:<399.0> but was:<312.0>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:553)
        at org.junit.Assert.assertEquals(Assert.java:683)
        at org.apache.poi.sl.TestFonts.resizeToFitTextHSLF(TestFonts.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TestFonts failing on my laptop

pj.fanning
I'm temporarily commented out the assertion that was failing.
https://svn.apache.org/viewvc?view=revision&revision=1801395
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TestFonts failing on my laptop

kiwiwings
In reply to this post by pj.fanning
Although the .ttf-Font is provided, the rendering can be quite different. [1]
That's the reason, why I'm trying to also execute the Job on the Windows machines too -
currently I'm playing around with Jenkins pipeline syntax.

What happens if you change something in GraphicsEnvironment.prefer*() ?

So as a quick fix, I would simply allow a few values.
Ignoring the returned value makes the whole test futile.

Andi


[1] https://stackoverflow.com/questions/26063828

On 7/10/17 12:02 AM, pj.fanning wrote:
> Hi,
> The new test, TestFonts, is failing on my laptop.
> https://svn.apache.org/viewvc?view=revision&revision=1801329
>
> I have a Mac and the font size seems to be 399 instead of the 312 expected
> in the test.
>



signature.asc (495 bytes) Download Attachment
Loading...