Skip to content

Commit

Permalink
merge from origin/trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
skynavga committed Dec 6, 2011
2 parents 238ddf8 + e140d36 commit e696ccb
Show file tree
Hide file tree
Showing 72 changed files with 2,615 additions and 461 deletions.
20 changes: 14 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ list of possible build targets.
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
<property name="javac.fork" value="no"/>
<property name="junit.fork" value="on"/>
<property name="junit.fork" value="yes"/>
<property name="junit.haltonfailure" value="off"/>
<property name="junit.printsummary" value="off"/>
<property name="junit.formatter.brief" value="on"/>
Expand Down Expand Up @@ -697,6 +697,9 @@ list of possible build targets.
<copy todir="${build.unit.tests.dir}">
<fileset dir="${test.dir}/java">
<include name="**/*.xsl"/>
<include name="**/*.txt"/>
<include name="**/*.afm"/>
<include name="**/*.fo"/>
</fileset>
</copy>
</target>
Expand Down Expand Up @@ -772,7 +775,10 @@ list of possible build targets.
<path id="standard-junit-classpath">
<pathelement location="${build.unit.tests.dir}"/>
<path refid="libs-tools-build-classpath"/>
<pathelement location="${build.dir}/fop.jar"/>
<fileset dir="${build.dir}">
<include name="fop.jar"/>
<include name="fop-hyph.jar"/>
</fileset>
</path>
<macrodef name="junit-run">
<attribute name="title"/>
Expand All @@ -796,7 +802,8 @@ list of possible build targets.
</sequential>
</macrodef>
<target name="junit-all" depends="junit-compile, junit-transcoder, junit-layout-hyphenation, setup-xml-schema" description="Runs FOP's JUnit basic tests" if="junit.present">
<junit dir="${basedir}" haltonfailure="yes" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
<junit dir="${basedir}" haltonfailure="yes" fork="${junit.fork}" forkmode="once"
errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
<sysproperty key="jawa.awt.headless" value="true"/>
<formatter type="brief" usefile="false" if="junit.formatter.brief.use"/>
<formatter type="plain" usefile="true"/>
Expand All @@ -819,8 +826,8 @@ list of possible build targets.
<junit-run title="standard layout engine" testsuite="org.apache.fop.layoutengine.LayoutEngineTestSuite" outfile="TEST-layoutengine-standard"/>
</target>
<target name="junit-layout-hyphenation" depends="hyphenation-present, junit-compile" if="hyphenation.present" description="Runs FOP's JUnit hyphenation layout tests">
<property name="fop.layoutengine.testset" value="hyphenation"/>
<junit-run title="hyphenation layout engine" testsuite="org.apache.fop.layoutengine.LayoutEngineTestSuite" outfile="TEST-layoutengine-hyphenation"/>
<junit-run title="hyphenation layout engine" testsuite="org.apache.fop.layoutengine.HyphenationLayoutTestCase"
outfile="TEST-layoutengine-hyphenation"/>
</target>
<target name="junit-layout" depends="junit-layout-standard, junit-layout-hyphenation" description="Runs all FOP's JUnit layout tests"/>
<target name="junit-fotree" depends="junit-compile" description="Runs FOP's FO tree JUnit tests" if="junit.present">
Expand Down Expand Up @@ -866,7 +873,8 @@ list of possible build targets.
<junit-run title="complexscripts" testsuite="org.apache.fop.complexscripts.ComplexScriptsTestSuite" outfile="TEST-complexscripts"/>
</target>
<target name="junit-reduced" depends="junit-userconfig, junit-basic, junit-transcoder, junit-text-linebreak, junit-fotree, junit-render-pdf, junit-complexscripts"/>
<target name="junit" depends="junit-all" description="Runs all of FOP's JUnit tests" if="junit.present">
<target name="junit" depends="junit-all" description="Runs all of FOP's JUnit tests"
if="junit.present">
<fail><condition><or><isset property="fop.junit.error"/><isset property="fop.junit.failure"/><not><isset property="hyphenation.present"/></not></or></condition>
NOTE:
**************************************************************************
Expand Down
75 changes: 75 additions & 0 deletions fop.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@ECHO OFF
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements. See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM $Id$

SETLOCAL ENABLEDELAYEDEXPANSION

rem %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME="%~dp0"

rem Code from Apache Ant project
rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
rem Could also do a "shift" and "%*" for all params, but apparently doesn't work
rem with Win9x.
set FOP_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.
:doneStart

set LOGCHOICE=
rem The default commons logger for JDK1.4 is JDK1.4Logger.
rem To use a different logger, uncomment the one desired below
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

set LOGLEVEL=
rem Logging levels
rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger.
rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties
rem file instead.
rem Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal".
rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO

set LIBDIR=%LOCAL_FOP_HOME%lib

set LOCALCLASSPATH=%FOP_HYPHENATION_PATH%
for %%l in (%LOCAL_FOP_HOME%build\*.jar %LIBDIR%\*.jar) do set LOCALCLASSPATH=!LOCALCLASSPATH!;%%l

set JAVAOPTS=-Denv.windir=%WINDIR%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
goto runFop

:noJavaHome
if "%JAVACMD%" == "" set JAVACMD=java

:runFop
rem echo "%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%

ENDLOCAL
48 changes: 2 additions & 46 deletions fop.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,7 @@ REM See the License for the specific language governing permissions and
REM limitations under the License.
REM $Id$

SETLOCAL ENABLEDELAYEDEXPANSION

rem %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME="%~dp0"

rem Code from Apache Ant project
rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
rem Could also do a "shift" and "%*" for all params, but apparently doesn't work
rem with Win9x.
set LOCAL_FOP_HOME=%~dp0
set FOP_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
Expand All @@ -35,41 +25,7 @@ set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.
:doneStart

set LOGCHOICE=
rem The default commons logger for JDK1.4 is JDK1.4Logger.
rem To use a different logger, uncomment the one desired below
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

set LOGLEVEL=
rem Logging levels
rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger.
rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties
rem file instead.
rem Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal".
rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO

set LIBDIR=%LOCAL_FOP_HOME%lib

set LOCALCLASSPATH=%FOP_HYPHENATION_PATH%
for %%l in (%LOCAL_FOP_HOME%build\*.jar %LIBDIR%\*.jar) do set LOCALCLASSPATH=!LOCALCLASSPATH!;%%l

set JAVAOPTS=-Denv.windir=%WINDIR%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
goto runFop

:noJavaHome
if "%JAVACMD%" == "" set JAVACMD=java

:runFop
rem echo "%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
call %LOCAL_FOP_HOME%\fop.bat %FOP_CMD_LINE_ARGS%

ENDLOCAL
38 changes: 38 additions & 0 deletions jacoco.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<project xmlns:jacoco="antlib:org.jacoco.ant" name="JaCoCo" default="coverage-report">
<import file="build.xml"/>
<property name="jacoco.report.dir" value="${build.dir}/report_jacoco"/>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath location="${jacocoant.jar}"/>
</taskdef>
<target name="test-coverage" depends="junit-compile, setup-xml-schema">
<jacoco:coverage destfile="${jacoco.report.dir}/jacoco.exec">
<junit dir="${basedir}" haltonfailure="yes" fork="on" forkmode="once">
<sysproperty key="jawa.awt.headless" value="true"/>
<classpath>
<path refid="standard-junit-classpath"/>
</classpath>
<batchtest>
<fileset dir="${build.unit.tests.dir}" includes="**/*TestCase.class"/>
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="coverage-report" depends="test-coverage"
description="Runs JaCoCo for a code coverage report">
<jacoco:report>
<executiondata>
<file file="${jacoco.report.dir}/jacoco.exec"/>
</executiondata>
<structure name="Apache FOP">
<classfiles>
<fileset dir="${build.classes.dir}"/>
</classfiles>
<sourcefiles>
<fileset dir="${src.java.dir}"/>
</sourcefiles>
</structure>
<html destdir="${jacoco.report.dir}"/>
</jacoco:report>
</target>
</project>
27 changes: 27 additions & 0 deletions lib/build/hamcrest.core-1.1.0.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD License

Copyright (c) 2000-2006, www.hamcrest.org
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.

Neither the name of Hamcrest nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
Binary file added lib/build/hamcrest.core-1.1.0.jar
Binary file not shown.
21 changes: 21 additions & 0 deletions lib/build/mockito-core-1.8.5.LICENCE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2007 Mockito contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
11 changes: 11 additions & 0 deletions lib/build/mockito-core-1.8.5.NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Mockito license - MIT.

Libraries used:

Cglib - Apache License 2.0
ASM - BSD license

Mockito all distribution:

Objenesis - MIT license
Hamcrest - BSD license
Binary file added lib/build/mockito-core-1.8.5.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions lib/build/objenesis-1.0.0.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2003-2008, Objenesis Team and all contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added lib/build/objenesis-1.0.0.jar
Binary file not shown.
36 changes: 34 additions & 2 deletions src/java/org/apache/fop/afp/AFPEventProducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ private Provider() {
* @return the event producer
*/
public static AFPEventProducer get(EventBroadcaster broadcaster) {
return (AFPEventProducer)broadcaster.getEventProducerFor(
AFPEventProducer.class);
return (AFPEventProducer) broadcaster.getEventProducerFor(AFPEventProducer.class);
}
}

Expand Down Expand Up @@ -81,4 +80,37 @@ public static AFPEventProducer get(EventBroadcaster broadcaster) {
* @event.severity ERROR
*/
void resourceEmbeddingError(Object source, String resourceName, Exception e);

/**
* A mandatory font configuration node is missing at location.
* @param source the event source
* @param missingConfig the expected configuration element
* @param location the position of the missing element within the config file.
* @event.severity ERROR
*/
void fontConfigMissing(Object source, String missingConfig, String location);

/**
* The character set given has an invalid name.
* @param source the event source
* @param msg the error message
* @event.severity ERROR
*/
void characterSetNameInvalid(Object source, String msg);

/**
* The code page for an AFP font could not be found.
* @param source the event source
* @param e the original exception
* @event.severity ERROR
*/
void codePageNotFound(Object source, Exception e);

/**
* This is a generic event for invalid configuration errors.
* @param source the event source
* @param e the original exception
* @event.severity ERROR
*/
void invalidConfiguration(Object source, Exception e);
}
4 changes: 4 additions & 0 deletions src/java/org/apache/fop/afp/AFPEventProducer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
<message key="warnMissingDefaultFont">No AFP default "any", {style}, {weight} font configured.</message>
<message key="characterSetEncodingError">An error occurred when attempting to encode character set {charSetName} with encoding scheme {encoding}.</message>
<message key="resourceEmbeddingError">An error occurs while embedding the resource named "{resourceName}".[ Reason: {e}]</message>
<message key="invalidConfiguration">There has been a configuration error.[ Reason: {e}]</message>
<message key="fontConfigMissing">The mandatory configuation node: '{missingConfig}' was not found at {location}.</message>
<message key="characterSetNameInvalid">The character set given has an invalid name. [ Reason: {msg} ]</message>
<message key="codePageNotFound">The code page for an AFP font cannot be found.[ Reason: {e}]</message>
</catalogue>
Loading

0 comments on commit e696ccb

Please sign in to comment.