On 29.09.2006 17:16:28 Andrejus Chaliapinas wrote:
> > Normally, I just construct the FO part in the test case and then run the
> > thing once so I get the current area tree XML. I obviously get an error
> > if I have no checks, because we don't want any test cases without checks.
> > When I have a first area tree XML I create the first checks I can build.
> > I don't have to have every check there from the beginning. I add more
> > checks as I progress with the implementation/fix. So, while this is a
> > test-first approach, it is not necessarily also a all-checks-first
> > approach. :-) The test case grows with you. ;-)
> 
> But if you first construct FO part and run testcase without any checks - how
> you could be sure that produced Area Tree is correct?

You check that by comparing the effective values with what you would
expect from FO you've written. The easier the FO is the easier it is to
determine the right checks.

An example, if you have a plain fo:block with 12pt font. Given that you
have a line-height of 1.2 (the default) you get 1.2 * 12pt = 14400mpt.
You'll find that value in a bpd attribute later.

> And if then later want to expand your FO part - do you need again remove all
> checks, run your testcase, get new Area Tree and return checks back with
> additional ones?

If you change so much that the whole area tree becomes different, yes.
If you just change the color of a word only a little attribute in the
tree is changed.

> Sorry, I don't get it right now.
> 
> Also I've noticed that in LayoutEngineTestSuite class there is such call:
> new File("test/layoutengine/disabled-testcase2filename.xsl")
> 
> and my Eclipse Ant hangs on that, cause tries to prefix that name with
> current eclipse directory (d:\eclipse in my case) and not with actual
> basedir of my project. So my proposal would be (of cause if I don't miss any
> other setting somewhere) to change a little main build.xml file and have
> instead of this part:

Are you not running the org.apache.fop.layoutengine.LayoutEngineTestSuite
using Eclipse's own JUnit support? That's the easiest way. Choosing the
default working directory, everything works fine and you really only run
the tests you need. It seems to me you're running the junit tasks from
within Eclipse.

>   <target name="junit-layout-standard" depends="junit-compile"
> if="junit.present" description="Runs FOP's standard JUnit layout tests">
>     <echo message="Running standard layout engine tests ${basedir}"/>
>     <junit haltonfailure="${junit.haltonfailure}" fork="${junit.fork}"
> errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
> 
> this one (with basedir specified for junit invocation):
> 
>   <target name="junit-layout-standard" depends="junit-compile"
> if="junit.present" description="Runs FOP's standard JUnit layout tests">
>     <echo message="Running standard layout engine tests ${basedir}"/>
>     <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}"
> fork="${junit.fork}" errorproperty="fop.junit.error"
> failureproperty="fop.junit.failure">
> 
> In that case it runs normally in my environment.

I'll look into that.


Jeremias Maerki

Reply via email to