jeremias    2005/01/24 02:45:11

  Added:       test/layoutengine/testcases external-graphic1.xml
                        background-image3.xml background-image1.xml
                        external-graphic2.xml background-image2.xml
  Log:
  Some tests for background images and external-graphic
  
  Revision  Changes    Path
  1.1                  xml-fop/test/layoutengine/testcases/external-graphic1.xml
  
  Index: external-graphic1.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 2005 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- $Id: external-graphic1.xml,v 1.1 2005/01/24 10:45:11 jeremias Exp $ -->
  <testcase>
    <info>
      <p>
        This test checks external-graphics.
      </p>
    </info>
    <fo>
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
        <fo:layout-master-set>
          <fo:simple-page-master master-name="normal" page-width="5in" 
page-height="5in">
            <fo:region-body/>
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="normal" white-space-collapse="true">
          <fo:flow flow-name="xsl-region-body">
            <fo:block>plain external-graphic</fo:block>
            <fo:block>
              <fo:external-graphic 
src="C:/Dev/FOP/main/xml-fop/test/resources/images/bgimg300dpi.jpg"/>EOG
            </fo:block>
            <fo:block>EOF</fo:block>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
    </fo>
    <checks>
      <eval expected="360000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipd"/>
      <eval expected="50214" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipda"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpda"/>
    </checks>
  </testcase>
  
  
  
  1.1                  xml-fop/test/layoutengine/testcases/background-image3.xml
  
  Index: background-image3.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 2005 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- $Id: background-image3.xml,v 1.1 2005/01/24 10:45:11 jeremias Exp $ -->
  <testcase>
    <info>
      <p>
        This test checks background images.
      </p>
    </info>
    <variables>
      <img>../../resources/images/bgimg300dpi.jpg</img>
    </variables>
    <fo>
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
        <fo:layout-master-set>
          <fo:simple-page-master master-name="normal" page-width="5in" 
page-height="5in" margin="20pt">
            <fo:region-body margin="0pt" border="solid 5pt" 
background-repeat="no-repeat" background-position-horizontal="center" 
background-position-vertical="center" background-image="##img"/>
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="normal" white-space-collapse="true">
          <fo:flow flow-name="xsl-region-body">
            <fo:block-container height="100%" width="100%" 
background-color="yellow">
            <fo:block background-repeat="no-repeat" 
background-position-horizontal="center" background-position-vertical="center" 
background-image="##img">
               normal block<fo:block/>
               normal block
            </fo:block>
            </fo:block-container>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
    </fo>
    <checks>
    </checks>
  </testcase>
  
  
  
  1.1                  xml-fop/test/layoutengine/testcases/background-image1.xml
  
  Index: background-image1.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 2005 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- $Id: background-image1.xml,v 1.1 2005/01/24 10:45:11 jeremias Exp $ -->
  <testcase>
    <info>
      <p>
        This test checks background images.
      </p>
    </info>
    <variables>
      <img>../../resources/images/bgimg300dpi.jpg</img>
    </variables>
    <fo>
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
        <fo:layout-master-set>
          <fo:simple-page-master master-name="normal" page-width="5in" 
page-height="5in">
            <fo:region-body/>
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="normal" white-space-collapse="true">
          <fo:flow flow-name="xsl-region-body">
            <fo:block-container left="10pt" top="10pt" width="100pt" 
height="20pt" absolute-position="absolute" background-color="blue" 
background-image="none">
              <fo:block margin="0pt">FOP is fun!</fo:block>
            </fo:block-container>
            <fo:block-container left="10pt" top="50pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-color="blue" background-repeat="no-repeat" background-image="##img">
              <fo:block margin="0pt">FOP is fun!</fo:block>
            </fo:block-container>
            <fo:block-container left="150pt" top="50pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-horizontal="left" background-position-vertical="top" 
background-color="blue" background-repeat="no-repeat" background-image="##img">
              <fo:block margin="0pt">left/top</fo:block>
            </fo:block-container>
            <fo:block-container left="10pt" top="150pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-horizontal="center" background-position-vertical="center" 
background-color="blue" background-repeat="no-repeat" background-image="##img">
              <fo:block margin="0pt">center/center</fo:block>
            </fo:block-container>
            <fo:block-container left="150pt" top="150pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-horizontal="right" background-position-vertical="bottom" 
background-color="blue" background-repeat="no-repeat" background-image="##img">
              <fo:block margin="0pt">right/bottom</fo:block>
            </fo:block-container>
            <fo:block-container left="10pt" top="250pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-horizontal="5pt" background-position-vertical="5pt" 
background-color="blue" background-repeat="no-repeat" background-image="##img">
              <fo:block margin="0pt">5pt/5pt</fo:block>
            </fo:block-container>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
    </fo>
    <checks>
    </checks>
  </testcase>
  
  
  
  1.1                  xml-fop/test/layoutengine/testcases/external-graphic2.xml
  
  Index: external-graphic2.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 2005 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- $Id: external-graphic2.xml,v 1.1 2005/01/24 10:45:11 jeremias Exp $ -->
  <testcase>
    <info>
      <p>
        This test checks external-graphics.
      </p>
    </info>
    <fo>
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
        <fo:layout-master-set>
          <fo:simple-page-master master-name="normal" page-width="5in" 
page-height="5in">
            <fo:region-body/>
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="normal" white-space-collapse="true">
          <fo:flow flow-name="xsl-region-body">
            <fo:block>height="40pt"</fo:block>
            <fo:block>
              <fo:external-graphic overflow="hidden" 
src="C:/Dev/FOP/main/xml-fop/test/resources/images/bgimg300dpi.jpg" 
height="40pt"/>EOG
            </fo:block>
            <fo:block>width="40pt"</fo:block>
            <fo:block>
              <fo:external-graphic overflow="hidden" 
src="C:/Dev/FOP/main/xml-fop/test/resources/images/bgimg300dpi.jpg" 
width="40pt"/>EOG
            </fo:block>
            <fo:block>EOF</fo:block>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
    </fo>
    <checks>
      <!-- first image -->
      <eval expected="360000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipd"/>
      <eval expected="44134" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipda"/>
      <eval expected="40000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpd"/>
      <eval expected="40000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpda"/>
      <!-- first image -->
      <eval expected="360000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ipd"/>
      <eval expected="50214" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@bpd"/>
      <eval expected="40000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@ipd"/>
      <eval expected="40000" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@ipda"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@bpd"/>
      <eval expected="46080" 
xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@bpda"/>
    </checks>
  </testcase>
  
  
  
  1.1                  xml-fop/test/layoutengine/testcases/background-image2.xml
  
  Index: background-image2.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 2005 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- $Id: background-image2.xml,v 1.1 2005/01/24 10:45:11 jeremias Exp $ -->
  <testcase>
    <info>
      <p>
        This test checks background images.
      </p>
    </info>
    <variables>
      <img>../../resources/images/bgimg300dpi.jpg</img>
    </variables>
    <fo>
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
        <fo:layout-master-set>
          <fo:simple-page-master master-name="normal" page-width="5in" 
page-height="5in">
            <fo:region-body/>
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="normal" white-space-collapse="true">
          <fo:flow flow-name="xsl-region-body">
            <fo:block-container left="10pt" top="10pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-color="blue" background-repeat="repeat-x" background-image="##img">
              <fo:block margin="0pt">repeat-x</fo:block>
            </fo:block-container>
            <fo:block-container left="150pt" top="10pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-color="blue" background-repeat="repeat-y" background-image="##img">
              <fo:block margin="0pt">repeat-y</fo:block>
            </fo:block-container>
            <fo:block-container left="10pt" top="110pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-color="blue" background-repeat="repeat" background-image="##img">
              <fo:block margin="0pt">repeat</fo:block>
            </fo:block-container>
            <fo:block-container left="10pt" top="210pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-vertical="75%" background-color="blue" 
background-repeat="repeat-x" background-image="##img">
              <fo:block margin="0pt">repeat-x and vertical: 75%</fo:block>
            </fo:block-container>
            <fo:block-container left="150pt" top="210pt" width="100pt" 
height="50pt" border="solid 5pt" padding="5pt" absolute-position="absolute" 
background-position-horizontal="75%" background-color="blue" 
background-repeat="repeat-y" background-image="##img">
              <fo:block margin="0pt">repeat-y and horizontal: 75%</fo:block>
            </fo:block-container>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
    </fo>
    <checks>
    </checks>
  </testcase>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to