You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by Simon Pepping <sp...@leverkruid.eu> on 2010/11/10 20:55:35 UTC

Failure in FOP's junit tests in headless mode [was: Re: DO NOT REPLY [Bug 42408] [PATCH] Headless problem in transcoders]

I ran fop's junit tests in headless mode with current batik. Only two
errors result, from the same piece of code. This is much better than
with batik-all-1.7.jar.

The remaining error occurs XGC, see the stack trace below. It occurs
when batik's paint method is called with the graphics object. This
object's getDeviceConfiguration method tries to get a screen device,
which is not available in headless mode. Is there a way to run this
test in headless mode?

Simon

On Wed, Nov 10, 2010 at 10:08:26AM -0500, bugzilla@apache.org wrote:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=42408
> 
> --- Comment #17 from Simon Pepping <sp...@apache.org> 2010-11-10 10:08:17 EST ---
> I applied the patch, built batik-all.jar, inserted it into the fop lib
> directory, and ran fop's junit tests in a graphics environment. I got
> no errors. Then I ran fop's junit tests in headless mode. I got one
> error, which is the same error I get without the patch. This indicates
> the patch did not correct the piece of code that uses a display in
> fop's junit tests.
> 
> The offending method that calls
> HeadlessGraphicsEnvironment.getDefaultScreenDevice is a method in
> xmlgraphics-commons, java2d.ps.PSGraphics2D.getDeviceConfiguration.
> Maybe fop's headless junit test problem is not a batik problem, but a
> XGC problem.
> 
>     [junit] No X11 DISPLAY variable was set, but this program performed an
> operation which requires it.
>     [junit] java.awt.HeadlessException: 
>     [junit] No X11 DISPLAY variable was set, but this program performed an
> operation which requires it.
>     [junit]     at
> sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:82)
>     [junit]     at
> org.apache.xmlgraphics.java2d.ps.PSGraphics2D.getDeviceConfiguration(PSGraphics2D.java:824)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestination(Unknown Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestinationColorModel(Unknown
> Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(Unknown
> Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(Unknown
> Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.renderable.FilterChainRable8Bit.paintRable(Unknown
> Source)
>     [junit]     at
> org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
>     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> Source)
>     [junit]     at
> org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
>     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> Source)
>     [junit]     at
> org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
>     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> Source)
>     [junit]     at
> org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
>     [junit]     at
> org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(Unknown Source)
>     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> Source)
>     [junit]     at
> org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
>     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> Source)
>     [junit]     at
> org.apache.fop.render.ps.AbstractPSTranscoder.transcode(AbstractPSTranscoder.java:154)
>     [junit]     at
> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
>     [junit]     at
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
>     [junit]     at
> org.apache.fop.AbstractBasicTranscoderTestCase.testGenericPDFTranscoder(AbstractBasicTranscoderTestCase.java:70)

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: Failure in FOP's junit tests in headless mode [was: Re: DO NOT REPLY [Bug 42408] [PATCH] Headless problem in transcoders]

Posted by Simon Pepping <sp...@leverkruid.eu>.
That is unfortunately beyond my capacities. I created bug 50253 for
this issue.

Simon

On Thu, Nov 11, 2010 at 10:25:13AM +0100, Jeremias Maerki wrote:
> I guess we need to do something similar as we have in PDFGraphics2D
> which constructs its own GraphicsConfiguration object instead of relying
> on the screen configuration.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: Failure in FOP's junit tests in headless mode [was: Re: DO NOT REPLY [Bug 42408] [PATCH] Headless problem in transcoders]

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I guess we need to do something similar as we have in PDFGraphics2D
which constructs its own GraphicsConfiguration object instead of relying
on the screen configuration.

On 10.11.2010 20:55:35 Simon Pepping wrote:
> I ran fop's junit tests in headless mode with current batik. Only two
> errors result, from the same piece of code. This is much better than
> with batik-all-1.7.jar.
> 
> The remaining error occurs XGC, see the stack trace below. It occurs
> when batik's paint method is called with the graphics object. This
> object's getDeviceConfiguration method tries to get a screen device,
> which is not available in headless mode. Is there a way to run this
> test in headless mode?
> 
> Simon
> 
> On Wed, Nov 10, 2010 at 10:08:26AM -0500, bugzilla@apache.org wrote:
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=42408
> > 
> > --- Comment #17 from Simon Pepping <sp...@apache.org> 2010-11-10 10:08:17 EST ---
> > I applied the patch, built batik-all.jar, inserted it into the fop lib
> > directory, and ran fop's junit tests in a graphics environment. I got
> > no errors. Then I ran fop's junit tests in headless mode. I got one
> > error, which is the same error I get without the patch. This indicates
> > the patch did not correct the piece of code that uses a display in
> > fop's junit tests.
> > 
> > The offending method that calls
> > HeadlessGraphicsEnvironment.getDefaultScreenDevice is a method in
> > xmlgraphics-commons, java2d.ps.PSGraphics2D.getDeviceConfiguration.
> > Maybe fop's headless junit test problem is not a batik problem, but a
> > XGC problem.
> > 
> >     [junit] No X11 DISPLAY variable was set, but this program performed an
> > operation which requires it.
> >     [junit] java.awt.HeadlessException: 
> >     [junit] No X11 DISPLAY variable was set, but this program performed an
> > operation which requires it.
> >     [junit]     at
> > sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:82)
> >     [junit]     at
> > org.apache.xmlgraphics.java2d.ps.PSGraphics2D.getDeviceConfiguration(PSGraphics2D.java:824)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.getDestination(Unknown Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.getDestinationColorModel(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.renderable.FilterChainRable8Bit.paintRable(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source)
> >     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
> >     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
> >     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
> >     [junit]     at
> > org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(Unknown Source)
> >     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> > Source)
> >     [junit]     at
> > org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source)
> >     [junit]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown
> > Source)
> >     [junit]     at
> > org.apache.fop.render.ps.AbstractPSTranscoder.transcode(AbstractPSTranscoder.java:154)
> >     [junit]     at
> > org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
> >     [junit]     at
> > org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
> >     [junit]     at
> > org.apache.fop.AbstractBasicTranscoderTestCase.testGenericPDFTranscoder(AbstractBasicTranscoderTestCase.java:70)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: general-help@xmlgraphics.apache.org




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org