diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..80c51e7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: maven + directory: "/" + schedule: + interval: daily \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8390f04 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build + +on: + push: + branches: + - 'main' + - 'release/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Maven build + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + MAVEN_SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }} + run: | + echo "$MAVEN_SIGNING_KEY" > MAVEN_SIGNING_KEY_FILE.base64 + base64 --decode MAVEN_SIGNING_KEY_FILE.base64 > MAVEN_SIGNING_KEY_FILE.bin + gpg --batch --fast-import MAVEN_SIGNING_KEY_FILE.bin + ./mvnw deploy -s cd/settings.xml -P sign + - name: Sonar + env: + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent org.apache.maven.plugins:maven-surefire-plugin:test org.sonarsource.scanner.maven:sonar-maven-plugin:sonar diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index bc9c0b1..0000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Java CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn test diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..4219185 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,15 @@ +name: Pull Request CI + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Maven build + run: ./mvnw -B install diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..bf82ff0 Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..71658c6 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 +# +# https://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. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar diff --git a/CHANGELOG.md b/CHANGELOG.md index 32aded3..948de19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,57 @@ +# 3.6.0 (not released yet) + +- Dependency updates + +# 3.5.4 + +- Update to Jasper 6.20.3 + +# 3.5.3 + +- Update to Jasper 6.20.2 + +# 3.5.2 + +(release failed due to wrong ci config, use 3.5.3) + +# 3.5.1 + +- Update to Jasper 6.20.1 + +# 3.5.0 + +- Update to Jasper 6.20.0 + +# 3.4.1 + +- Update to Jasper 6.19.1 + +# 3.4.0 + +- Update to Jasper 6.19.0 + +# 3.3.1 + +- Update to Jasper 6.18.1 + +# 3.3.0 + +- Update to Jasper 6.18.0 + +# 3.2.0 + +- Update to Jasper 6.17.0 + +# 3.1.0 + +- Integrate with m2e. This fixes the "plugin execution not covered by a lifecycle configuration" message in eclipse. +- Update to Jasper 6.16.0 + +# 3.0 + +- Move plugin to pro-crafting. +- No other changes planned for this release. This one is intended for a clean migration. + # 2.8 - Update to Jasper 6.15 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7dc3b6f..2fbeef8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,3 @@ -To deploy, use `mvn clean deploy -P release` +For local builds, use `mvnw clean install`. + +For deployment, use `mvnw release:prepare`. diff --git a/README.md b/README.md index 80db87f..ec8e4ec 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,37 @@ +[![Version](https://img.shields.io/maven-central/v/com.pro-crafting.tools/jasperreports-plugin?logo=apache-maven&style=for-the-badge)](https://search.maven.org/artifact/com.pro-crafting.tools/jasperreports-pluginm) +[![GitHub Actions Status]()](https://github.com/pro-crafting/Jasper-report-maven-plugin/actions/workflows/build.yml) + JasperReports-plugin ============= -This maven compiles Jasper files to the target directory. +This maven plugin compiles Jasper files to the target directory. + +Migration to version 3 +---------- + +[alexnederlof](https://github.com/alexnederlof) is the original author of this plugin, but has not used it in years. The plugin got adopted by me ([Postremus](https://github.com/Postremus)) and migrated to the pro-crafting organization. +Main goal of the adoption is to always provide a version for the latest JasperReports release. + +For this reason, when migrating from jasperreports-plugin 2.8 to 3.0, you will need to keep these things in mind: -# 👋 This plugin is up for adoption -I've not used this plugin myself in years, so I'd like to hand this project over -to people who actually use it. If you are interested, please open an issue to -reach me. - Alex +1. First, you will need to change the groupdId in the plugin definition, as outlined in section [Usage](#usage) +2. Second, the plugin now gets compiled using jdk 17. Compatibility with java 1.8 is ensured, since the CI build now forces an `--release 8` flag. If any problems arise though, please let me know by opening an issue - we can always adjust that. Motivation ---------- The original jasperreports-maven-plugin from org.codehaus.mojo was a bit slow. This plugin is 10x faster. I tested it with 52 reports which took 48 seconds with the original plugin and only 4.7 seconds with this plugin. -Usage +Installation ----- -You can use the plugin by adding it to the plug-in section in your pom; +You can use the plugin by adding it to the plug-in section in your pom: ```xml - com.alexnederlof + com.pro-crafting.tools jasperreports-plugin - 2.8 + 3.5.1 process-sources @@ -48,6 +57,35 @@ You can use the plugin by adding it to the plug-in section in your pom; ``` +You might also need to add the following repositories section to your pom in order to correctly resolve all dependencies: + +```xml + + + jaspersoft-third-party + https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/ + + +``` + +If you are exporting pdfs, you need to prive the dependency on openpdf yourself starting with JasperReports 6.20.2. +See also issue [#351](https://github.com/TIBCOSoftware/jasperreports/issues/351) in the JasperReports repository. + +This plugin already provides the openpdf library - you won't have to add it for compilation of your reports. +However, the library needs to be present during report execution/filling time, e.g. it needs to be added to your deployed application. + +```xml + + + com.github.librepdf + openpdf + 1.3.30.jaspersoft.2 + + +``` + +Usage +----- If you want to pass any Jasper options to the compiler you can do so by adding them to the configuration like so: ```xml @@ -91,3 +129,21 @@ You can also use this alternative approach for JARs: ``` +JasperReports Compatibility +----- + +The following table shows which JasperReports version is included during compilation of each plugin version: + +| Plugin Version | JasperReports Version | +|----------------|-----------------------| +| 3.5.4 | 6.20.3 | +| 3.5.3 | 6.20.2 | +| 3.5.1 | 6.20.1 | +| 3.5.0 | 6.20.0 | +| 3.4.1 | 6.19.1 | +| 3.4.0 | 6.19.0 | +| 3.3.1 | 6.18.1 | +| 3.3.0 | 6.18.0 | +| 3.2.0 | 6.17.0 | +| 3.1.0 | 6.16.0 | +| 3.0.0 | 6.15.0 | diff --git a/cd/settings.xml b/cd/settings.xml new file mode 100644 index 0000000..16a854b --- /dev/null +++ b/cd/settings.xml @@ -0,0 +1,32 @@ + + + + ossrh + ${env.OSSRH_USERNAME} + ${env.OSSRH_TOKEN} + + + docker.io + ${env.DOCKER_IO_USERNAME} + ${env.DOCKER_IO_TOKEN} + + + + + + ossrh + + true + + + gpg + ${env.GPG_KEY_NAME} + ${env.GPG_PASSPHRASE} + + + + + diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..b7f0646 --- /dev/null +++ b/mvnw @@ -0,0 +1,287 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.1.1 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + printf '%s' "$(cd "$basedir"; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname $0)") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $wrapperUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + QUIET="--quiet" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + QUIET="" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" + fi + [ $? -eq 0 ] || rm -f "$wrapperJarPath" + elif command -v curl > /dev/null; then + QUIET="--silent" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + QUIET="" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L + fi + [ $? -eq 0 ] || rm -f "$wrapperJarPath" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=`cygpath --path --windows "$javaSource"` + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100755 index 0000000..474c9d6 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,187 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with 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, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.1.1 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index 6d975e8..45ae4b8 100644 --- a/pom.xml +++ b/pom.xml @@ -1,40 +1,57 @@ 4.0.0 - com.alexnederlof + + + com.pro-crafting + pc-parent + 12 + + + com.pro-crafting.tools jasperreports-plugin maven-plugin - 2.9-SNAPSHOT + 3.6.0-SNAPSHOT + jasperreport-plugin A Jasper compiler plugin - http://github.com/alexnederlof/Jasper-report-maven-plugin + https://github.com/pro-crafting/Jasper-report-maven-plugin - 1.8 - 1.8 + + 8 + 3.0.1 UTF-8 UTF-8 + + + 6.20.3 + 1.3.30.jaspersoft.2 + + 1.7.36 + 2.13.0 + 3.5.2 + 3.5.2 + 4.13.2 + 1.1 + 3.5.1 + + + 3.5.2 - 3.5.0 + 3.5.2 - scm:git:git@github.com:alexnederlof/Jasper-report-maven-plugin.git - http://github.com/alexnederlof/Jasper-report-maven-plugin - scm:git:git@github.com:alexnederlof/Jasper-report-maven-plugin.git + scm:git:https://github.com/pro-crafting/Jasper-report-maven-plugin.git + https://github.com/pro-crafting/Jasper-report-maven-plugin + scm:git:https://github.com/pro-crafting/Jasper-report-maven-plugin.git HEAD - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - @@ -68,95 +85,118 @@ Benjamin Wiedmann github@wied.it + + + Postremus + Martin Panzer + postremus1996@googlemail.com + +2 + + + junit junit - 4.13.2 + ${version.junit} test + - org.apache.maven.shared - maven-plugin-testing-harness - 1.1 + io.takari.maven.plugins + takari-plugin-integration-testing + ${tikari.version} + pom + test + + + + io.takari.maven.plugins + takari-plugin-testing + ${tikari.version} test org.codehaus.plexus plexus-utils - 3.3.0 + ${version.plexus-utils} test net.sf.jasperreports jasperreports - 6.15.0 + ${version.jasperreports} + + + net.sf.jasperreports + jasperreports-fonts + ${version.jasperreports} + + + net.sf.jasperreports + jasperreports-functions + ${version.jasperreports} - commons-lang - commons-lang - 2.6 + com.github.librepdf + openpdf + ${version.openpdf} org.apache.maven maven-plugin-api - 3.6.3 + ${version.maven-plugin-api} org.apache.maven.plugin-tools maven-plugin-annotations - 3.6.0 + ${version.maven-plugin-annotations} provided - - net.sf.jasperreports - jasperreports-fonts - 6.15.0 - - org.slf4j slf4j-simple - 1.7.30 + ${version.slf4j} org.codehaus.plexus plexus-compiler-api - 2.8.8 - - - javax.servlet - javax.servlet-api - 4.0.1 + ${version.plexus-compiler-api} + org.apache.maven.plugins maven-surefire-plugin - 2.22.0 - - false - + + + org.apache.maven.surefire + surefire-junit47 + ${version.maven-surefire-plugin} + + - org.apache.maven.plugins - maven-source-plugin - 3.0.1 + io.takari.maven.plugins + takari-lifecycle-plugin + 2.1.1 + true - attach-sources + testProperties + process-test-resources - jar-no-fork + testProperties @@ -164,7 +204,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 attach-javadocs @@ -193,71 +232,18 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://oss.sonatype.org/ - true - - org.apache.maven.plugins maven-plugin-plugin - 3.5.2 + ${version.maven-plugin-plugin} - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - main - https://repo.maven.apache.org/maven2/ - - - jasperreports - https://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases - jaspersoft-third-party https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/ - diff --git a/src/main/java/com/alexnederlof/jasperreport/CompileTask.java b/src/main/java/com/pro_crafting/tools/jasperreport/CompileTask.java similarity index 98% rename from src/main/java/com/alexnederlof/jasperreport/CompileTask.java rename to src/main/java/com/pro_crafting/tools/jasperreport/CompileTask.java index b13dbf5..7d5eb4e 100644 --- a/src/main/java/com/alexnederlof/jasperreport/CompileTask.java +++ b/src/main/java/com/pro_crafting/tools/jasperreport/CompileTask.java @@ -1,4 +1,4 @@ -package com.alexnederlof.jasperreport; +package com.pro_crafting.tools.jasperreport; /* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license diff --git a/src/main/java/com/alexnederlof/jasperreport/JasperReporter.java b/src/main/java/com/pro_crafting/tools/jasperreport/JasperReporter.java similarity index 99% rename from src/main/java/com/alexnederlof/jasperreport/JasperReporter.java rename to src/main/java/com/pro_crafting/tools/jasperreport/JasperReporter.java index ed6fe63..d8850be 100644 --- a/src/main/java/com/alexnederlof/jasperreport/JasperReporter.java +++ b/src/main/java/com/pro_crafting/tools/jasperreport/JasperReporter.java @@ -1,4 +1,4 @@ -package com.alexnederlof.jasperreport; +package com.pro_crafting.tools.jasperreport; /* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license diff --git a/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml new file mode 100644 index 0000000..0a19f6e --- /dev/null +++ b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml @@ -0,0 +1,17 @@ + + + + + + jasper + + + + + true + false + + + + + diff --git a/src/test/java/com/alexnederlof/jasperreport/JasperReportTest.java b/src/test/java/com/pro_crafting/tools/jasperreport/JasperReportTest.java similarity index 50% rename from src/test/java/com/alexnederlof/jasperreport/JasperReportTest.java rename to src/test/java/com/pro_crafting/tools/jasperreport/JasperReportTest.java index 5dfb1b1..3998aaf 100644 --- a/src/test/java/com/alexnederlof/jasperreport/JasperReportTest.java +++ b/src/test/java/com/pro_crafting/tools/jasperreport/JasperReportTest.java @@ -1,4 +1,4 @@ -package com.alexnederlof.jasperreport; +package com.pro_crafting.tools.jasperreport; /* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license @@ -11,43 +11,51 @@ * for the specific language governing permissions and limitations under the License. */ +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.io.File; -import java.io.FileFilter; import java.io.FileInputStream; -import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; -import net.sf.jasperreports.engine.DefaultJasperReportsContext; -import net.sf.jasperreports.engine.JRException; +import org.apache.maven.plugin.MojoExecutionException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import io.takari.maven.testing.TestResources; +import io.takari.maven.testing.executor.MavenExecution; +import io.takari.maven.testing.executor.MavenExecutionResult; +import io.takari.maven.testing.executor.MavenRuntime; +import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; +import io.takari.maven.testing.executor.MavenVersions; +import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.util.NullOutputStream; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.testing.AbstractMojoTestCase; -import org.codehaus.plexus.util.FileUtils; /** * Test the report generation. */ -public class JasperReportTest extends AbstractMojoTestCase { - - private static final String TARGET_EXAMPLE_FOLDER = "target/test-classes/exampleFolders"; - private static final String TARGET_EXAMPLE_OUT_FOLDER = "target/unitTestReports"; - private File examplesFolder; - private File sourceFolder; - private File destinationFolder; - - @Override - protected void setUp() throws Exception { - super.setUp(); - examplesFolder = new File(getBasedir(), TARGET_EXAMPLE_FOLDER); - assertTrue("The folder to copy the examples from doesn't exist", examplesFolder.exists()); +@RunWith(MavenJUnitTestRunner.class) +@MavenVersions("3.6.3") +public class JasperReportTest { + + @Rule + public final TestResources resources = new TestResources(); + + private final MavenRuntime mavenRuntime; + + public JasperReportTest(MavenRuntimeBuilder builder) throws Exception { + this.mavenRuntime = builder.build(); } @@ -58,17 +66,19 @@ protected void setUp() throws Exception { * @throws Exception * When an unexpexted error occures. */ + @Test public void testValidReportGeneration() throws Exception { - String pluginPom = getBasedir() + "/src/test/resources/testSampleReportsPom.xml"; + File basedir = this.resources.getBasedir("sampleReports"); - setupSourceAndDestinationFolder("/sampleReports", "/sampleReports_out"); + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); - getAndExecuteMojo(pluginPom); + File sourceFolder = new File(basedir, "src/main/jasperreports"); + File destinationFolder = new File(basedir, "target/classes/jasper"); assertEquals("Files from sourcefolder do not correspond to files in the destinationFolder", sourceFolder.listFiles().length, destinationFolder.listFiles().length); assertAllFilesAreCompiled(sourceFolder, destinationFolder); - } /** @@ -78,87 +88,63 @@ public void testValidReportGeneration() throws Exception { * @throws Exception * When an unexpexted error occures. */ + @Test public void testGivenAdditionalPropertiesAreSetWhenTestingValidReportGenerationExpectNoErrorOnCompilation() throws Exception { - String pluginPom = getBasedir() + "/src/test/resources/testSampleReportsWithAdditionalPropertiesPom.xml"; - setupSourceAndDestinationFolder("/sampleReports", "/sampleReports_out"); + File basedir = this.resources.getBasedir("sampleReportsWithAdditionalProperties"); - getAndExecuteMojo(pluginPom); - String defaultPdfFontName = DefaultJasperReportsContext.getInstance() - .getProperty("net.sf.jasperreports.default.pdf.font.name"); - String pdfEmbeddedValue = DefaultJasperReportsContext.getInstance() - .getProperty("net.sf.jasperreports.default.pdf.embedded"); + runSampleReportsWithAdditionalProperties(basedir); + } + + + private void runSampleReportsWithAdditionalProperties(File basedir) throws Exception, MojoExecutionException { + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File sourceFolder = new File(basedir, "src/main/jasperreports"); + File destinationFolder = new File(basedir, "target/classes/jasper"); assertEquals("Files from sourcefolder do not correspond to files in the destinationFolder", sourceFolder.listFiles().length, destinationFolder.listFiles().length); assertAllFilesAreCompiled(sourceFolder, destinationFolder); - assertTrue(defaultPdfFontName != null); - assertTrue("default pdf font name has not been set properly", defaultPdfFontName.compareTo("Courier") == 0); - assertTrue("net.sf.jasperreports.default.pdf.embedded has not been set properly", - pdfEmbeddedValue.compareTo("true") == 0); + result.assertLogText("net.sf.jasperreports.default.pdf.font.name=Courier"); + result.assertLogText("net.sf.jasperreports.default.pdf.embedded=true"); } + @Test public void testGivenAdditionalPropertiesAreSetWhenTestingValidReportGenerationAndExportToPdfExpectNoErrors() throws Exception { // compile reports with modified default font property first - testGivenAdditionalPropertiesAreSetWhenTestingValidReportGenerationExpectNoErrorOnCompilation(); + File basedir = this.resources.getBasedir("sampleReportsWithAdditionalProperties"); + + runSampleReportsWithAdditionalProperties(basedir); // now based on the templates, create PDF's + File destinationFolder = new File(basedir, "target/classes/jasper"); assertTrue("Destination is not a directory", destinationFolder.isDirectory()); - List testFiles = Arrays.asList(destinationFolder.listFiles(new FileFilter() { - @Override - public boolean accept(File pathname) { - return pathname.toString() - .contains("PlainTextReportWithDefaultFontReport"); - } - })); + List testFiles = Arrays.asList(destinationFolder.listFiles( + pathname -> pathname.toString().contains("PlainTextReportWithDefaultFontReport"))); - if (testFiles.size() != 1) { - fail("Expected exactly one testfile to be found in directory"); - } + assertEquals("Expected exactly one testfile to be found in directory", 1, testFiles.size()); - createPdf("PlainTextReportWithDefaultFontReport.jasper"); + createPdf(destinationFolder, "PlainTextReportWithDefaultFontReport.jasper"); } - private void createPdf(String filename) { - File file = new File(destinationFolder.getPath() + "/" + filename); - try { - JasperPrint print = JasperFillManager.fillReport(new FileInputStream(file), new HashMap()); - JasperExportManager.exportReportToPdfStream(print, new NullOutputStream()); + private void createPdf(File destinationFolder, String filename) throws Exception { + File file = new File(destinationFolder, filename); + JasperPrint print; + try (InputStream inputStream = new FileInputStream(file)) { + print = JasperFillManager.fillReport(new FileInputStream(file), new HashMap<>()); } - catch (IOException e) { - fail("Unable to create exportfile: Errormessage:" + e.getMessage()); - } - catch (JRException e) { - fail("Unable to create pdf: Errormessage:" + e.getMessage()); - } - catch (IllegalArgumentException e) { - fail("Unable to create pdf: IllegalArgumentException:" + e.getMessage()); - } - + JasperExportManager.exportReportToPdfStream(print, new NullOutputStream()); } - private void getAndExecuteMojo(String pluginPom) throws Exception, MojoExecutionException { - JasperReporter mojo = (JasperReporter) lookupMojo("jasper", pluginPom); - assertNotNull(mojo); - mojo.execute(); - } + private MavenExecutionResult getAndExecuteMojo(File basedir) throws Exception, MojoExecutionException { + MavenExecution execution = this.mavenRuntime.forProject(basedir); - /** - * Create the source and destination folder. If the destination folder already exsist is shall - * be deleted. Otherwise the tests can't run properly. - */ - private void setupSourceAndDestinationFolder(String sourceFolderName, String destinationFolderName) - throws IOException { - sourceFolder = new File(getBasedir(), TARGET_EXAMPLE_FOLDER + sourceFolderName); - destinationFolder = new File(getBasedir(), TARGET_EXAMPLE_OUT_FOLDER + destinationFolderName); - if (destinationFolder.exists()) { - FileUtils.deleteDirectory(destinationFolder); - } - assertTrue("Source folder doesn't exist: " + sourceFolder.getAbsolutePath(), sourceFolder.exists()); - assertFalse("Destination folder shouldn't exist", destinationFolder.exists()); + return execution.execute("process-sources"); } /** @@ -168,7 +154,7 @@ private void setupSourceAndDestinationFolder(String sourceFolderName, String des private void assertAllFilesAreCompiled(File sourceFolder, File destinationFolder) { assertTrue("Source folder is not a directory", sourceFolder.isDirectory()); assertTrue("Destination is not a directory", destinationFolder.isDirectory()); - Set filenames = new HashSet(); + Set filenames = new HashSet<>(); for (File file : sourceFolder.listFiles()) { if (file.isFile()) { filenames.add(getNameWithoutSuffix(file, ".jrxml")); @@ -184,38 +170,46 @@ private void assertAllFilesAreCompiled(File sourceFolder, File destinationFolder private String getNameWithoutSuffix(File file, String suffix) { return file.getName() - .substring(0, file.getName() - .indexOf(suffix)); + .substring(0, file.getName() + .indexOf(suffix)); } - /** - * Test that an invalid Jasper file should stop the build completely by throwing an - * {@link MojoExecutionException}. - * - * @throws Exception - * When an unexpected error occurs. - */ - public void testInvalidFilesStopBuild() throws Exception { - setupSourceAndDestinationFolder("/brokenReports", "/brokenReports_out"); - try { - getAndExecuteMojo(getBasedir() + "/src/test/resources/testBrokenReportsPom.xml"); - fail("An exception should have been thrown"); - } - catch (MojoExecutionException e) { - assertEquals(JasperReporter.ERROR_JRE_COMPILE_ERROR, e.getMessage()); - } - } + /** + * Test that an invalid Jasper file should stop the build completely by throwing an + * {@link MojoExecutionException}. + * + * @throws Exception + * When an unexpected error occurs. + */ + @Test + public void testInvalidFilesStopBuild() throws Exception { + + File basedir = this.resources.getBasedir("brokenReports"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + + result.assertLogText("BUILD FAILURE"); + result.assertLogText(JasperReporter.ERROR_JRE_COMPILE_ERROR); + + File destinationFolder = new File(basedir, "target/classes/jasper"); + assertTrue("Output folder should be empty", destinationFolder.list().length == 0); + } /** * Test that skipping the plugin does not compile any Jasper file. * - * @throws Exception - * When an unexpected error occurs. + * @throws Exception + * When an unexpected error occurs. */ + @Test public void testSkipDoesntCompile() throws Exception { - setupSourceAndDestinationFolder("/sampleReports", "/skipReports_out"); - getAndExecuteMojo(getBasedir() + "/src/test/resources/testSkipSampleReportsPom.xml"); - assertFalse("Output folder should not exist", destinationFolder.exists()); + File basedir = this.resources.getBasedir("skipSampleReports"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File destinationFolder = new File(basedir, "target/classes/jasper"); + assertFalse("Output folder should not exist", destinationFolder.exists()); } /** @@ -224,9 +218,14 @@ public void testSkipDoesntCompile() throws Exception { * @throws Exception * When an unexpected error occurs. */ + @Test public void testWrongSuffixDoesntCompile() throws Exception { - setupSourceAndDestinationFolder("/wrongExtensions", "/wrongExtensions_out"); - getAndExecuteMojo(getBasedir() + "/src/test/resources/testWrongExtensionsPom.xml"); + File basedir = this.resources.getBasedir("wrongExtensions"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File destinationFolder = new File(basedir, "target/classes/jasper"); assertTrue("Output folder should be empty", destinationFolder.list().length == 0); } @@ -236,10 +235,14 @@ public void testWrongSuffixDoesntCompile() throws Exception { * @throws Exception * When an unexpected error occurs. */ + @Test public void testEmptyDoesNothing() throws Exception { - createTheEmptyFolderIfItDoesntExist(); - setupSourceAndDestinationFolder("/emptyFolder", "/emptyFolder_out"); - getAndExecuteMojo(getBasedir() + "/src/test/resources/testEmptyFolderPom.xml"); + File basedir = this.resources.getBasedir("emptyFolder"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File destinationFolder = new File(basedir, "target/classes/jasper"); assertTrue("Output folder should be empty", destinationFolder.list().length == 0); } @@ -249,14 +252,14 @@ public void testEmptyDoesNothing() throws Exception { * @throws Exception * When an unexpected error occurs. */ + @Test public void testNonExistentFolderStopBuild() throws Exception { - try { - getAndExecuteMojo(getBasedir() + "/src/test/resources/testNonExistentFolderPom.xml"); - fail("An exception should have been thrown"); - } - catch (IllegalArgumentException e) { - assertTrue(e.getMessage().contains("nonExistentFolder")); - } + File basedir = this.resources.getBasedir("nonExistentFolder"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + + result.assertLogText("BUILD FAILURE"); + result.assertLogText("nonExistentFolder"); } /** @@ -265,21 +268,15 @@ public void testNonExistentFolderStopBuild() throws Exception { * @throws Exception * When an unexpected error occurs. */ + @Test public void testNonExistentFolderAllowed() throws Exception { - setupSourceAndDestinationFolder("/emptyFolder", "/emptyFolder_out"); - getAndExecuteMojo(getBasedir() + "/src/test/resources/testNonExistentFolderAllowedPom.xml"); - assertTrue("Output folder should be empty", destinationFolder.list().length == 0); - } + File basedir = this.resources.getBasedir("nonExistentFolderAllowed"); - /** - * The empty folder we test on is not transported by Git. We therefor have to create it manually - * to do the test. - */ - private void createTheEmptyFolderIfItDoesntExist() { - sourceFolder = new File(getBasedir(), TARGET_EXAMPLE_FOLDER + "/emptyFolder"); - if (!sourceFolder.exists()) { - sourceFolder.mkdir(); - } + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File destinationFolder = new File(basedir, "target/classes/jasper"); + assertTrue("Output folder should be empty", destinationFolder.list().length == 0); } /** @@ -289,9 +286,14 @@ private void createTheEmptyFolderIfItDoesntExist() { * @throws Exception * When an unexpected error occurs. */ + @Test public void testFolderStructure() throws Exception { - setupSourceAndDestinationFolder("/folderStructure", "/folderStructure_out"); - getAndExecuteMojo(getBasedir() + "/src/test/resources/testFolderStructurePom.xml"); + File basedir = this.resources.getBasedir("folderStructure"); + + MavenExecutionResult result = getAndExecuteMojo(basedir); + result.assertErrorFreeLog(); + + File destinationFolder = new File(basedir, "target/classes/jasper"); Set filenames = detectFolderStructure(destinationFolder); String relativePath = destinationFolder.getAbsolutePath() + '/'; String fileMissing = "A file in the folderstructure is missing"; @@ -308,7 +310,7 @@ public void testFolderStructure() throws Exception { } private Set detectFolderStructure(File folderToSearch) { - Set set = new HashSet(); + Set set = new HashSet<>(); for (File f : folderToSearch.listFiles()) { if (f.isDirectory()) { set.addAll(detectFolderStructure(f)); diff --git a/src/test/resources/testEmptyFolderPom.xml b/src/test/projects/brokenReports/pom.xml similarity index 71% rename from src/test/resources/testEmptyFolderPom.xml rename to src/test/projects/brokenReports/pom.xml index c63584c..072e194 100644 --- a/src/test/resources/testEmptyFolderPom.xml +++ b/src/test/projects/brokenReports/pom.xml @@ -10,26 +10,24 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/emptyFolder - target/unitTestReports/emptyFolder_out - diff --git a/src/test/resources/exampleFolders/brokenReports/AlterDesignReport.jrxml b/src/test/projects/brokenReports/src/main/jasperreports/AlterDesignReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/brokenReports/AlterDesignReport.jrxml rename to src/test/projects/brokenReports/src/main/jasperreports/AlterDesignReport.jrxml diff --git a/src/test/resources/testSampleReportsPom.xml b/src/test/projects/emptyFolder/pom.xml similarity index 71% rename from src/test/resources/testSampleReportsPom.xml rename to src/test/projects/emptyFolder/pom.xml index 58b567d..072e194 100644 --- a/src/test/resources/testSampleReportsPom.xml +++ b/src/test/projects/emptyFolder/pom.xml @@ -10,26 +10,24 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/sampleReports - target/unitTestReports/sampleReports_out - diff --git a/src/test/resources/exampleFolders/wrongExtensions/.hiddenTestFile b/src/test/projects/emptyFolder/src/main/jasperreports/.gitkeep similarity index 100% rename from src/test/resources/exampleFolders/wrongExtensions/.hiddenTestFile rename to src/test/projects/emptyFolder/src/main/jasperreports/.gitkeep diff --git a/src/test/resources/testBrokenReportsPom.xml b/src/test/projects/folderStructure/pom.xml similarity index 71% rename from src/test/resources/testBrokenReportsPom.xml rename to src/test/projects/folderStructure/pom.xml index 958bf0e..072e194 100644 --- a/src/test/resources/testBrokenReportsPom.xml +++ b/src/test/projects/folderStructure/pom.xml @@ -10,26 +10,24 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/brokenReports - target/unitTestReports/brokenReports_out - diff --git a/src/test/resources/exampleFolders/folderStructure/LandscapeReport.jrxml b/src/test/projects/folderStructure/src/main/jasperreports/LandscapeReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/folderStructure/LandscapeReport.jrxml rename to src/test/projects/folderStructure/src/main/jasperreports/LandscapeReport.jrxml diff --git a/src/test/resources/exampleFolders/folderStructure/level.1/level.2.1/LateOrdersReport.jrxml b/src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.1/LateOrdersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/folderStructure/level.1/level.2.1/LateOrdersReport.jrxml rename to src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.1/LateOrdersReport.jrxml diff --git a/src/test/resources/exampleFolders/folderStructure/level.1/level.2.2/Level.3/LineChartReport.jrxml b/src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.2/Level.3/LineChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/folderStructure/level.1/level.2.2/Level.3/LineChartReport.jrxml rename to src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.2/Level.3/LineChartReport.jrxml diff --git a/src/test/resources/exampleFolders/folderStructure/level.1/level.2.2/MasterReport.jrxml b/src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.2/MasterReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/folderStructure/level.1/level.2.2/MasterReport.jrxml rename to src/test/projects/folderStructure/src/main/jasperreports/level.1/level.2.2/MasterReport.jrxml diff --git a/src/test/resources/testNonExistentFolderPom.xml b/src/test/projects/nonExistentFolder/pom.xml similarity index 74% rename from src/test/resources/testNonExistentFolderPom.xml rename to src/test/projects/nonExistentFolder/pom.xml index 4781e84..1806791 100644 --- a/src/test/resources/testNonExistentFolderPom.xml +++ b/src/test/projects/nonExistentFolder/pom.xml @@ -10,6 +10,10 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT @@ -18,17 +22,12 @@ process-sources - compile + jasper - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/nonExistentFolder - target/unitTestReports/emptyFolder_out + nonExistentFolder diff --git a/src/test/resources/testNonExistentFolderAllowedPom.xml b/src/test/projects/nonExistentFolderAllowed/pom.xml similarity index 75% rename from src/test/resources/testNonExistentFolderAllowedPom.xml rename to src/test/projects/nonExistentFolderAllowed/pom.xml index 365144c..ff41628 100644 --- a/src/test/resources/testNonExistentFolderAllowedPom.xml +++ b/src/test/projects/nonExistentFolderAllowed/pom.xml @@ -10,25 +10,26 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/nonExistentFolder - target/unitTestReports/emptyFolder_out + nonExistentFolder false diff --git a/src/test/resources/testFolderStructurePom.xml b/src/test/projects/sampleReports/pom.xml similarity index 71% rename from src/test/resources/testFolderStructurePom.xml rename to src/test/projects/sampleReports/pom.xml index 5a35a36..072e194 100644 --- a/src/test/resources/testFolderStructurePom.xml +++ b/src/test/projects/sampleReports/pom.xml @@ -10,26 +10,24 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/folderStructure - target/unitTestReports/folderStructure_out - diff --git a/src/test/resources/exampleFolders/sampleReports/AddressReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/AddressReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/AddressReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/AddressReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/AddressesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/AddressesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/AddressesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/AddressesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/AllChartsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/AllChartsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/AllChartsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/AllChartsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/AlterDesignReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/AlterDesignReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/AlterDesignReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/AlterDesignReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/AreaChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/AreaChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/AreaChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/AreaChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/Bar3DChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/Bar3DChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/Bar3DChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/Bar3DChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/BarChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/BarChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/BarChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/BarChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/BarbecueReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/BarbecueReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/BarbecueReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/BarbecueReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/BubbleChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/BubbleChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/BubbleChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/BubbleChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/CandlestickChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/CandlestickChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/CandlestickChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/CandlestickChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/CsvDataSourceReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/CsvDataSourceReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/CsvDataSourceReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/CsvDataSourceReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/CsvQueryExecuterReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/CsvQueryExecuterReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/CsvQueryExecuterReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/CsvQueryExecuterReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/CustomersReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/CustomersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/CustomersReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/CustomersReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/DataSourceReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/DataSourceReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/DataSourceReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/DataSourceReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/DocumentsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/DocumentsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/DocumentsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/DocumentsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/FirstJasper.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/FirstJasper.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/FirstJasper.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/FirstJasper.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/FontsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/FontsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/FontsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/FontsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/GanttChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/GanttChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/GanttChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/GanttChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/GenericElementReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/GenericElementReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/GenericElementReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/GenericElementReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HeadingsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HeadingsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HeadingsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HeadingsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HibernateQueryReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HibernateQueryReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HibernateQueryReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HibernateQueryReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HighLowChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HighLowChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HighLowChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HighLowChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HorizontalListReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HorizontalListReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HorizontalListReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HorizontalListReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HorizontalReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HorizontalReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HorizontalReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HorizontalReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/HyperlinkReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/HyperlinkReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/HyperlinkReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/HyperlinkReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/I18nReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/I18nReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/I18nReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/I18nReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ImagesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ImagesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ImagesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ImagesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/JChartsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/JChartsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/JChartsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/JChartsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/JFreeChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/JFreeChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/JFreeChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/JFreeChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/JsonCustomersReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/JsonCustomersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/JsonCustomersReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/JsonCustomersReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/JsonOrdersReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/JsonOrdersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/JsonOrdersReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/JsonOrdersReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/LandscapeReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/LandscapeReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/LandscapeReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/LandscapeReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/LateOrdersReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/LateOrdersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/LateOrdersReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/LateOrdersReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/LineChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/LineChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/LineChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/LineChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ListReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ListReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ListReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ListReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MacroReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MacroReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MacroReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MacroReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MapReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MapReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MapReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MapReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MarkupReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MarkupReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MarkupReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MarkupReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MasterReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MasterReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MasterReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MasterReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MeterChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MeterChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MeterChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MeterChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/MultipleAxisChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/MultipleAxisChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/MultipleAxisChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/MultipleAxisChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/NoPageBreakReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/NoPageBreakReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/NoPageBreakReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/NoPageBreakReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/OrdersReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/OrdersReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/OrdersReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/OrdersReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ParagraphsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ParagraphsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ParagraphsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ParagraphsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/PdfEncryptReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/PdfEncryptReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/PdfEncryptReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/PdfEncryptReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/Pie3DChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/Pie3DChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/Pie3DChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/Pie3DChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/PieChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/PieChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/PieChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/PieChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/PlainTextReportWithDefaultFontReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/PlainTextReportWithDefaultFontReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/PlainTextReportWithDefaultFontReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/PlainTextReportWithDefaultFontReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ProductReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ProductReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ProductReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ProductReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ProductsReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ProductsReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ProductsReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ProductsReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/QueryReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/QueryReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/QueryReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/QueryReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/Report1.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/Report1.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/Report1.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/Report1.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/Report2.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/Report2.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/Report2.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/Report2.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/Report3.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/Report3.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/Report3.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/Report3.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/RotationReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/RotationReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/RotationReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/RotationReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ScatterChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ScatterChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ScatterChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ScatterChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ShapesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ShapesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ShapesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ShapesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/SpiderChart.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/SpiderChart.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/SpiderChart.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/SpiderChart.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StackedAreaChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StackedAreaChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StackedAreaChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StackedAreaChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StackedBar3DChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StackedBar3DChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StackedBar3DChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StackedBar3DChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StackedBarChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StackedBarChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StackedBarChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StackedBarChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StretchReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StretchReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StretchReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StretchReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StyledTextReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StyledTextReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StyledTextReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StyledTextReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/StylesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/StylesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/StylesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/StylesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/TableReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/TableReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/TableReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/TableReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/TabularReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/TabularReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/TabularReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/TabularReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/TextReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/TextReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/TextReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/TextReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/ThermometerChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/ThermometerChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/ThermometerChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/ThermometerChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/TimeSeriesChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/TimeSeriesChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/TimeSeriesChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/TimeSeriesChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/UnicodeReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/UnicodeReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/UnicodeReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/UnicodeReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/VirtualizerReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/VirtualizerReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/VirtualizerReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/VirtualizerReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XYAreaChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XYAreaChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XYAreaChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XYAreaChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XYBarChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XYBarChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XYBarChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XYBarChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XYBarChartTimePeriodReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XYBarChartTimePeriodReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XYBarChartTimePeriodReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XYBarChartTimePeriodReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XYBarChartTimeSeriesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XYBarChartTimeSeriesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XYBarChartTimeSeriesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XYBarChartTimeSeriesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XYLineChartReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XYLineChartReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XYLineChartReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XYLineChartReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XlsDataSourceReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XlsDataSourceReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XlsDataSourceReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XlsDataSourceReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XlsFeaturesReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XlsFeaturesReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XlsFeaturesReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XlsFeaturesReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XlsFormulaReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XlsFormulaReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XlsFormulaReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XlsFormulaReport.jrxml diff --git a/src/test/resources/exampleFolders/sampleReports/XlsxDataSourceReport.jrxml b/src/test/projects/sampleReports/src/main/jasperreports/XlsxDataSourceReport.jrxml similarity index 100% rename from src/test/resources/exampleFolders/sampleReports/XlsxDataSourceReport.jrxml rename to src/test/projects/sampleReports/src/main/jasperreports/XlsxDataSourceReport.jrxml diff --git a/src/test/resources/testSampleReportsWithAdditionalPropertiesPom.xml b/src/test/projects/sampleReportsWithAdditionalProperties/pom.xml similarity index 79% rename from src/test/resources/testSampleReportsWithAdditionalPropertiesPom.xml rename to src/test/projects/sampleReportsWithAdditionalProperties/pom.xml index a391a83..8678db4 100644 --- a/src/test/resources/testSampleReportsWithAdditionalPropertiesPom.xml +++ b/src/test/projects/sampleReportsWithAdditionalProperties/pom.xml @@ -10,25 +10,26 @@ language governing permissions and limitations under the License. --> + 4.0.0 + com.pro-crafting.tools + project-to-test + 1.0-SNAPSHOT + com.pro-crafting.tools jasperreports-plugin + ${it-plugin.version} process-sources - compile + jasper - true - 4 - .jasper - .jrxml - target/test-classes/exampleFolders/sampleReports - target/unitTestReports/sampleReports_out + true true diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/AddressReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/AddressReport.jrxml new file mode 100755 index 0000000..7ec9842 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/AddressReport.jrxml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "EEE, MMM d, yyyy" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5)]]> + + + + + + + + + <band height="100"> + <elementGroup> + <line> + <reportElement x="0" y="0" width="555" height="1"/> + </line> + <image scaleImage="Clip"> + <reportElement x="0" y="5" width="165" height="40" key="TransparentImage"/> + <imageExpression class="java.lang.String"><![CDATA["jasperreports.png"]]></imageExpression> + <hyperlinkTooltipExpression><![CDATA["The JasperReports Logo"]]></hyperlinkTooltipExpression> + </image> + </elementGroup> + <textField isBlankWhenNull="true"> + <reportElement style="Serif_Bold" x="180" y="5" width="375" height="35"/> + <textElement textAlignment="Right"> + <font size="22"/> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA[$P{ReportTitle}]]></textFieldExpression> + </textField> + <staticText> + <reportElement style="Sans_Italic" x="180" y="40" width="375" height="15"/> + <textElement textAlignment="Right"> + <font size="12"/> + </textElement> + <text><![CDATA[(c)2001-2009 by teodord]]></text> + </staticText> + <textField evaluationTime="Report"> + <reportElement x="255" y="55" width="100" height="40"/> + <textElement textAlignment="Justified"/> + <textFieldExpression class="java.lang.String"><![CDATA["There are " + String.valueOf($V{REPORT_COUNT}) + " orders on this report, with a total freight of " + new DecimalFormat("0.00").format($V{FreightSumReport}.doubleValue())]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/FontsReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/FontsReport.jrxml new file mode 100644 index 0000000..1ef5491 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/FontsReport.jrxml @@ -0,0 +1,149 @@ + + + + <band height="782"> + <staticText> + <reportElement x="0" y="50" width="150" height="40"/> + <textElement/> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="50" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="50" width="150" height="40"/><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="100" width="150" height="40"/> + <textElement> + <font size="12"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="100" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="100" width="150" height="40"/><textElement><font size="14"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="150" width="150" height="40"/> + <textElement> + <font fontName="Gentium" size="12"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="150" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="150" width="150" height="40"/><textElement><font fontName="Gentium" size="12"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="200" width="150" height="40"/> + <textElement> + <font fontName="Gentium" size="12" isBold="true" isItalic="true"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="200" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="200" width="150" height="40"/><textElement><font fontName="Gentium" size="12" isBold="true" isItalic="true"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="250" width="150" height="40"/> + <textElement> + <font fontName="DejaVu Serif" size="12" isBold="false"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="250" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="250" width="150" height="40"/><textElement><font fontName="DejaVu Serif" size="12" isBold="false"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="300" width="150" height="40"/> + <textElement> + <font fontName="DejaVu Serif" size="12" isBold="true"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="300" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="300" width="150" height="40"/><textElement><font fontName="DejaVu Serif" size="12" isBold="true"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="350" width="150" height="40"/> + <textElement> + <font fontName="Monospaced" size="12" isItalic="true" isUnderline="true" pdfFontName="Courier-Oblique"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="350" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="350" width="150" height="40"/><textElement><font fontName="Monospaced" size="12" isItalic="true" isUnderline="true" pdfFontName="Courier-Oblique"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="400" width="150" height="40"/> + <textElement> + <font fontName="Monospaced" size="12" isBold="true" isStrikeThrough="true" pdfFontName="Courier-Bold"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="400" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="400" width="150" height="40"/><textElement><font fontName="Monospaced" size="12" isBold="true" isStrikeThrough="true" pdfFontName="Courier-Bold"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement x="0" y="450" width="150" height="40" forecolor="#FF0000"/> + <textElement> + <font size="14"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="450" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="450" width="150" height="40" forecolor="red"/><textElement><font size="14"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement mode="Opaque" x="0" y="500" width="150" height="40" forecolor="#00FF00" backcolor="#FFFF00"/> + <textElement> + <font fontName="Serif" size="12" isBold="true" pdfFontName="Times-Bold"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="500" width="390" height="40"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="500" width="150" height="40" forecolor="green" backcolor="#FFFF00" mode="Opaque"/><textElement><font fontName="Serif" size="12" isBold="true" pdfFontName="Times-Bold"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement mode="Opaque" x="0" y="550" width="150" height="90" forecolor="#0000FF" backcolor="#FFDD99"/> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font fontName="SansSerif" size="12" isBold="false" isItalic="true" pdfFontName="Sans.Slanted" isPdfEmbedded="true"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="550" width="390" height="90"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="550" width="150" height="90" forecolor="blue" backcolor="#FFDD99" mode="Opaque"/><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="SansSerif" size="12" isBold="false" pdfFontName="Sans.Slanted" isPdfEmbedded="true"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + <staticText> + <reportElement mode="Opaque" x="0" y="650" width="150" height="90" forecolor="#FF0000" backcolor="#99DDFF"/> + <textElement textAlignment="Right" verticalAlignment="Bottom"> + <font fontName="SansSerif" size="12" isBold="true" pdfFontName="DejaVu Sans Bold" isPdfEmbedded="true"/> + </textElement> + <text><![CDATA[The quick brown fox jumps over the lazy dog.]]></text> + </staticText> + <staticText> + <reportElement x="160" y="650" width="390" height="90"/> + <textElement/> + <text><![CDATA[<staticText><reportElement x="0" y="650" width="150" height="90" forecolor="red" backcolor="#99DDFF" mode="Opaque"/><textElement textAlignment="Right" verticalAlignment="Bottom"><font fontName="SansSerif" size="12" isBold="true" pdfFontName="DejaVu Sans Bold" isPdfEmbedded="true"/></textElement><text>The quick brown fox jumps over the lazy dog.</text></staticText>]]></text> + </staticText> + </band> + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/GanttChartReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/GanttChartReport.jrxml new file mode 100644 index 0000000..7108653 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/GanttChartReport.jrxml @@ -0,0 +1,150 @@ + + + + + <band height="782"> + <image scaleImage="Clip" onErrorType="Icon" isLazy="true"> + <reportElement x="0" y="0" width="150" height="40"/> + <imageExpression class="java.lang.String"><![CDATA["http://jasperreports.sourceforge.net/jasperreports.png"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="0" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip" onErrorType="Icon" isLazy="true"><reportElement x="0" y="0" width="150" height="40"/><imageExpression class="java.lang.String">"http://jasperreports.sourceforge.net/jasperreports.png"</imageExpression></image>]]></text> + </staticText> + <image> + <reportElement x="0" y="50" width="150" height="40"/> + <box> + <pen lineWidth="0.5"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["dukesign.jpg"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="50" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="RetainShape"><reportElement x="0" y="50" width="150" height="40"/><box><pen lineWidth="0.5"/></box><imageExpression>"dukesign.jpg"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip"> + <reportElement x="0" y="100" width="150" height="40" mode="Opaque" backcolor="yellow"/> + <box padding="5"> + <pen lineWidth="0.5"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["dukesign.jpg"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="100" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="0" y="100" width="150" height="40" mode="Opaque" backcolor="yellow"/><box padding="5"/><pen lineWidth="0.5"/></box><imageExpression>"dukesign.jpg"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="FillFrame"> + <reportElement x="0" y="150" width="150" height="40"/> + <box> + <pen lineWidth="0.5"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["dukesign.jpg"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="150" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="FillFrame" isUsingCache="true"><reportElement x="0" y="150" width="150" height="40"/><box><pen lineWidth="0.5"/></box><imageExpression>"dukesign.jpg"</imageExpression></image>]]></text> + </staticText> + <image hAlign="Center" isUsingCache="false"> + <reportElement x="0" y="200" width="150" height="40"/> + <box> + <pen lineWidth="0.5"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["dukesign.jpg"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="200" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="RetainShape" hAlign="Center" isUsingCache="false"><reportElement x="0" y="200" width="150" height="40"/><box><pen lineWidth="0.5"/></box><imageExpression>"dukesign.jpg"</imageExpression></image>]]></text> + </staticText> + <rectangle> + <reportElement x="0" y="250" width="150" height="40" backcolor="#ffdddd"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <image> + <reportElement x="5" y="255" width="70" height="30"/> + <graphicElement/> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="250" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="RetainShape"><reportElement x="5" y="255" width="70" height="30"/><graphicElement/><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <rectangle> + <reportElement x="0" y="300" width="150" height="40" backcolor="#ffdddd"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <image scaleImage="Clip"> + <reportElement x="5" y="305" width="70" height="30" backcolor="#ffdddd"/> + <graphicElement/> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="300" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="5" y="305" width="70" height="30"/><graphicElement/><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <rectangle> + <reportElement x="0" y="350" width="150" height="40" backcolor="#ffdddd"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <image> + <reportElement mode="Opaque" x="5" y="355" width="30" height="30" backcolor="#ddffdd"/> + <graphicElement/> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="350" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="RetainShape"><reportElement x="5" y="355" width="30" height="30" mode="Opaque" backcolor="#DDFFDD"/><graphicElement/><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <rectangle> + <reportElement x="0" y="400" width="150" height="40" backcolor="#ffdddd"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <image scaleImage="Clip" hAlign="Center" vAlign="Middle"> + <reportElement mode="Opaque" x="5" y="405" width="120" height="30" backcolor="#ddffdd"/> + <graphicElement/> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="400" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip" hAlign="Center" vAlign="Middle"><reportElement x="5" y="405" width="120" height="30" mode="Opaque" backcolor="#DDFFDD"/><graphicElement/><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip"> + <reportElement x="50" y="455" width="50" height="30" forecolor="#ff0000"/> + <box> + <pen lineWidth="0.5"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="450" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="50" y="455" width="50" height="30" forecolor="red"/><box><pen lineWidth="0.5"/></box><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip"> + <reportElement x="50" y="505" width="50" height="30" forecolor="#ff0000"/> + <box> + <pen lineWidth="1" lineStyle="Dashed"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="500" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="50" y="505" width="50" height="30" forecolor="red"/><box><pen lineWidth="1" lineStyle="Dashed"/></box><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip"> + <reportElement x="50" y="555" width="50" height="30" forecolor="#ff0000"/> + <box> + <pen lineWidth="1"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="550" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="50" y="555" width="50" height="30" forecolor="red"/><box><pen lineWidth="1"/></box><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip"> + <reportElement x="50" y="605" width="50" height="30" forecolor="#ff0000"/> + <box> + <pen lineWidth="2"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="600" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip"><reportElement x="50" y="605" width="50" height="30" forecolor="red"/><box><pen lineWidth="2"/></box><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image scaleImage="Clip" hAlign="Right"> + <reportElement x="50" y="655" width="50" height="30" forecolor="#ff0000"/> + <box> + <pen lineWidth="4"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["transparent.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="650" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image scaleImage="Clip" hAlign="Right" vAlign="Top"><reportElement x="50" y="655" width="50" height="30" forecolor="red"/><box><pen lineWidth="4"/></box><imageExpression>"transparent.gif"</imageExpression></image>]]></text> + </staticText> + <image> + <reportElement x="50" y="705" width="6" height="6" forecolor="#ff00"/> + <box> + <pen lineWidth="4"/> + </box> + <imageExpression class="java.lang.String"><![CDATA["1redpixel.gif"]]></imageExpression> + </image> + <staticText> + <reportElement x="160" y="700" width="390" height="40"/> + <textElement/> + <text><![CDATA[<image><reportElement x="50" y="705" width="6" height="6" forecolor="green"/><box><pen lineWidth="4"/></box><imageExpression>"1redpixel.gif"</imageExpression></image>]]></text> + </staticText> + </band> + + + + + + + + + + + + + "dukesign.jpg"]]> + + + + + + + + + + + + "dukesign.jpg"]]> + + + + + + + + + + + + "dukesign.jpg"]]> + + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JChartsReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JChartsReport.jrxml new file mode 100644 index 0000000..e9959dd --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JChartsReport.jrxml @@ -0,0 +1,49 @@ + + + + + + + + <band height="742"> + <line> + <reportElement x="0" y="0" width="515" height="1"/> + <graphicElement/> + </line> + <line> + <reportElement x="0" y="3" width="515" height="1"/> + <graphicElement/> + </line> + <staticText> + <reportElement x="0" y="10" width="515" height="30"/> + <textElement> + <font size="22"/> + </textElement> + <text><![CDATA[jCharts 0.6.0 - Sample Chart Report]]></text> + </staticText> + <textField hyperlinkType="Reference"> + <reportElement x="0" y="40" width="515" height="20"/> + <textElement/> + <textFieldExpression class="java.lang.String"><![CDATA["http://jcharts.sourceforge.net"]]></textFieldExpression> + <hyperlinkReferenceExpression><![CDATA["http://jcharts.sourceforge.net"]]></hyperlinkReferenceExpression> + </textField> + <line> + <reportElement x="0" y="60" width="515" height="1"/> + <graphicElement/> + </line> + <line> + <reportElement x="0" y="63" width="515" height="1"/> + <graphicElement/> + </line> + <image scaleImage="Clip" hAlign="Center"> + <reportElement x="0" y="70" width="515" height="350"/> + <graphicElement/> + <imageExpression class="java.awt.Image"><![CDATA[$V{ChartImage}]]></imageExpression> + </image> + </band> + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JFreeChartReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JFreeChartReport.jrxml new file mode 100644 index 0000000..2231b5b --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JFreeChartReport.jrxml @@ -0,0 +1,39 @@ + + + + + + + + <band height="742"> + <line> + <reportElement x="0" y="0" width="515" height="1"/> + <graphicElement/> + </line> + <staticText> + <reportElement x="0" y="10" width="515" height="30"/> + <textElement textAlignment="Center"> + <font size="22"/> + </textElement> + <text><![CDATA[JFreeChart Sample]]></text> + </staticText> + <textField> + <reportElement x="0" y="50" width="515" height="50"/> + <textElement textAlignment="Center"> + <font size="12"/> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA["This sample uses JFreeChart Version 1.0.0-pre2\n" + "Written by David Gilbert (david.gilbert@object-refinery.com) and others.\n" + "(C)opyright 2000-2004, by Object Refinery Limited and Contributors."]]></textFieldExpression> + </textField> + <image scaleImage="Clip" hAlign="Center" hyperlinkType="Reference"> + <reportElement x="0" y="110" width="515" height="300"/> + <graphicElement/> + <imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$V{Chart}]]></imageExpression> + <hyperlinkReferenceExpression><![CDATA["http://www.jfree.org/jfreechart"]]></hyperlinkReferenceExpression> + </image> + </band> + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JsonCustomersReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JsonCustomersReport.jrxml new file mode 100755 index 0000000..8055494 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/JsonCustomersReport.jrxml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + <band height="40"> + <staticText> + <reportElement style="Title" x="0" y="0" width="555" height="20"/> + <textElement textAlignment="Center" verticalAlignment="Middle"/> + <text><![CDATA[Shipped Orders]]></text> + </staticText> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/LineChartReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/LineChartReport.jrxml new file mode 100644 index 0000000..241232f --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/LineChartReport.jrxml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + <band height="40"> + <line> + <reportElement x="0" y="0" width="515" height="1"/> + <graphicElement/> + </line> + <staticText> + <reportElement x="0" y="10" width="515" height="30" style="Sans_Normal"/> + <textElement textAlignment="Center"> + <font size="22"/> + </textElement> + <text><![CDATA[Addresses Report]]></text> + </staticText> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MacroReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MacroReport.jrxml new file mode 100644 index 0000000..d93ce67 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MacroReport.jrxml @@ -0,0 +1,209 @@ + + + + + + + + element containing styled text. elements are introduced by setting the attribute available for the tag to and by formatting the text content using nested tags and simple HTML tags, including .]]> + + + + + + + $P{RtfText} + + + + + + + $P{HtmlText} + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MasterReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MasterReport.jrxml new file mode 100755 index 0000000..01ab586 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/MasterReport.jrxml @@ -0,0 +1,105 @@ + + + + + + + <band height="250"> + <rectangle> + <reportElement mode="Opaque" x="0" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="40" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="80" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="120" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="160" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="200" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="0" y="5" width="255" height="40" backcolor="#FFFF88" positionType="Float"/> + <textElement/> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using default tab stop width of 40 pixels. The following names are tab stop aligned to the left, while the overall text alignment is also left:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="300" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="340" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="380" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="420" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="460" y="0" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="500" y="0" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="300" y="5" width="255" height="40" backcolor="#FFFF88" positionType="Float"/> + <textElement textAlignment="Right"/> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using default tab stop width of 40 pixels. The following names are tab stop aligned to the left, while the overall text alignment is right:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="0" y="50" width="33" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="33" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="40" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="80" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="120" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="160" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="200" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="0" y="55" width="255" height="40" backcolor="#88FFFF" positionType="Float"/> + <textElement textAlignment="Left"> + <paragraph lineSpacing="Proportional" lineSpacingSize="2"> + <tabStop position="33" alignment="Center"/> + </paragraph> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using a custom tab stop centered at position 33. The rest of the names are tab stop aligned to the left, while the overall text alignment is also left:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="300" y="50" width="33" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="333" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="340" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="380" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="420" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="460" y="50" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="500" y="50" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="300" y="55" width="255" height="40" backcolor="#88FFFF" positionType="Float"/> + <textElement textAlignment="Right"> + <paragraph lineSpacing="Fixed" lineSpacingSize="20"> + <tabStop position="33" alignment="Center"/> + </paragraph> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using a custom tab stop centered at position 33. The rest of the names are tab stop aligned to the left, while the overall text alignment is right:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="0" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="40" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="80" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="120" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="160" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="200" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="0" y="105" width="255" height="40" backcolor="#88FF88" positionType="Float"/> + <textElement> + <paragraph> + <tabStop alignment="Right" position="40"/> + <tabStop alignment="Right" position="80"/> + <tabStop alignment="Right" position="120"/> + <tabStop alignment="Right" position="160"/> + <tabStop alignment="Right" position="200"/> + </paragraph> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using custom tab stops right aligned and 40 pixels apart. The overall text alignment is left:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="300" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="340" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="380" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="420" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="460" y="100" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="500" y="100" width="40" height="5" backcolor="#FFAAAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="300" y="105" width="255" height="40" backcolor="#88FF88" positionType="Float"/> + <textElement textAlignment="Right"> + <paragraph> + <tabStop alignment="Right" position="40"/> + <tabStop alignment="Right" position="80"/> + <tabStop alignment="Right" position="120"/> + <tabStop alignment="Right" position="160"/> + <tabStop alignment="Right" position="200"/> + </paragraph> + </textElement> + <textFieldExpression class="java.lang.String"><![CDATA["Text field element using custom tab stops right aligned and 40 pixels apart. The overall text alignment is also right:\n\tpig\tchicken\tsheep\thorse\tgoat\n\tlion\tgiraffe\thippopotamus\tleopard\telephant\thyena\n\tparis\tlondon\trome\tamsterdam\toslo"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="0" y="150" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="40" y="150" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="80" y="150" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="0" y="155" width="150" height="40" backcolor="#FF88FF" positionType="Float"/> + <textElement/> + <textFieldExpression class="java.lang.String"><![CDATA["A\n\tB\t\tB2\tB3 thisisalongwordnotfittinginoneline\n\t\tC\tC2\nD\tD2\tD3"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="405" y="150" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="445" y="150" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="485" y="150" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="405" y="155" width="150" height="40" backcolor="#FF88FF" positionType="Float"/> + <textElement textAlignment="Right"/> + <textFieldExpression class="java.lang.String"><![CDATA["A\n\tB\t\tB2\tB3 thisisalongwordnotfittinginoneline\n\t\tC\tC2\nD\tD2\tD3"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="0" y="200" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="40" y="200" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="80" y="200" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="0" y="205" width="150" height="40" backcolor="#FF88FF" positionType="Float"/> + <textElement/> + <textFieldExpression class="java.lang.String"><![CDATA["A\n\tB\t\tB2\tB3_thisisalongwordnotfittinginoneline\n\t\tC\tC2\nD\tD2\tD3"]]></textFieldExpression> + </textField> + <rectangle> + <reportElement mode="Opaque" x="405" y="200" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="445" y="200" width="40" height="5" backcolor="#AAFFAA" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <rectangle> + <reportElement mode="Opaque" x="485" y="200" width="40" height="5" backcolor="#AAAAFF" positionType="Float"/> + <graphicElement> + <pen lineWidth="0"/> + </graphicElement> + </rectangle> + <textField textAdjust="StretchHeight"> + <reportElement mode="Opaque" x="405" y="205" width="150" height="40" backcolor="#FF88FF" positionType="Float"/> + <textElement textAlignment="Right"/> + <textFieldExpression class="java.lang.String"><![CDATA["A\n\tB\t\tB2\tB3_thisisalongwordnotfittinginoneline\n\t\tC\tC2\nD\tD2\tD3"]]></textFieldExpression> + </textField> + </band> + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/PdfEncryptReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/PdfEncryptReport.jrxml new file mode 100755 index 0000000..8688584 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/PdfEncryptReport.jrxml @@ -0,0 +1,22 @@ + + + + + + <band height="782"> + <staticText> + <reportElement positionType="Float" x="0" y="0" width="555" height="100"/> + <textElement textAlignment="Center"> + <font size="14"/> + </textElement> + <text><![CDATA[The generated PDF document is encrypted using a 128 bit key. +User password: jasper +Owner password: reports]]></text> + </staticText> + </band> + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/Pie3DChartReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/Pie3DChartReport.jrxml new file mode 100644 index 0000000..1bc83e0 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/Pie3DChartReport.jrxml @@ -0,0 +1,348 @@ + + + element containing styled text. elements are introduced by setting the attribute available for the tag to and by formatting the text content using nested tags and simple HTML tags, including .]]> + + + + + + + ^ logo and some superscript text and subscript text."]]> + + + + + + + style tag used to format the text content inside a styled text element: + +fontName + + + + + +pdfFontName +pdfEncoding +isPdfEmbedded + +]]> + + + + + + + <font size="12"> +<font color="red"> +<font face="DejaVu Serif"> +bold <b> italic <i> underlined <u> +an empty line follows (<br/>): +
+<sup> and <sub> +
+A bulleted list: +
  • item 1 <li>
  • +
    +<a href="http://www.google.com"> +]]> +
    + + + + + + + + + + + + + + + + + + 1\n\n\n\n\n"]]> + + + +
    diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/StylesReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/StylesReport.jrxml new file mode 100755 index 0000000..5cc7ab6 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/StylesReport.jrxml @@ -0,0 +1,79 @@ + + + + + + + , centered, border"]]> + + + + "Serif Note: font face = DejaVu Serif, font size = 10, orange on dark gray, centered, border" + + + + + diff --git a/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/TableReport.jrxml b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/TableReport.jrxml new file mode 100755 index 0000000..4911d31 --- /dev/null +++ b/src/test/projects/sampleReportsWithAdditionalProperties/src/main/jasperreports/TableReport.jrxml @@ -0,0 +1,293 @@ + + + + + +