You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2021/04/07 21:40:34 UTC
svn commit: r1888488 [2/2] - in /poi/trunk: ./ examples/ excelant/
integrationtest/ legal/ main/ ooxml-schema/ ooxml/ poi-examples/
poi-examples/src/main/java9/ poi-excelant/ poi-excelant/src/main/java9/
poi-excelant/src/test/java/org/apache/poi/ss/exc...
Modified: poi/trunk/poi-ooxml/build.gradle
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/build.gradle?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/build.gradle (original)
+++ poi/trunk/poi-ooxml/build.gradle Wed Apr 7 21:40:33 2021
@@ -15,8 +15,52 @@
limitations under the License.
==================================================================== */
+import java.util.regex.Pattern
+
+plugins {
+ id 'java'
+ id 'maven-publish'
+ id 'java-library'
+}
+
+final String JAVA9_SRC = 'src/main/java9'
+final String JAVA9_OUT = "${buildDir}/classes/java9/main/"
+final String TEST9_SRC = 'src/test/java9'
+final String TEST9_OUT = "${buildDir}/classes/java9/test/"
+final String VERSIONS9 = 'META-INF/versions/9'
+
+sourceSets {
+ main {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
+ }
+ }
+ test {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(TEST9_OUT, builtBy: 'cacheTest9')
+ }
+ }
+}
+
+configurations {
+ all {
+ exclude group: 'xalan', module: 'xalan'
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ exclude group: 'xml-apis', module: 'xml-apis'
+ }
+ }
+
+ broken
+
+ tests
+}
+
dependencies {
- api project(":ooxml-schema")
+ api project(':poi')
+ api project(':poi-ooxml-full')
+ api project(path: ':poi', configuration: 'archives')
+ api project(path: ':poi-ooxml-full', configuration: 'archives')
+
implementation 'org.apache.commons:commons-collections4:4.4'
api "org.apache.commons:commons-compress:${commonsCompressVersion}"
api 'org.apache.santuario:xmlsec:2.2.1'
@@ -24,33 +68,217 @@ dependencies {
api 'com.github.virtuald:curvesapi:1.06'
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
- api "org.apache.xmlgraphics:batik-svggen:${batikVersion}"
- implementation("org.apache.xmlgraphics:batik-bridge:${batikVersion}") {
- exclude group: 'org.apache.xmlgraphics', module: 'batik-script'
- }
+ implementation "org.apache.xmlgraphics:batik-svggen:${batikVersion}"
+ implementation "org.apache.xmlgraphics:batik-bridge:${batikVersion}"
implementation "org.apache.xmlgraphics:batik-codec:${batikVersion}"
+ implementation "org.apache.xmlgraphics:batik-svgrasterizer:${batikVersion}"
api 'de.rototor.pdfbox:graphics2d:0.30'
- api project(':main')
- api files("../build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version}.jar")
- testRuntime project(':scratchpad')
+ testImplementation project(':poi-scratchpad')
+ testImplementation project(path:':poi', configuration:'tests')
+ testImplementation project(path:':poi-ooxml-lite-agent', configuration: 'archives')
+ testImplementation project(path:':poi-scratchpad', configuration:'tests')
testImplementation 'org.xmlunit:xmlunit-core:2.8.0'
testImplementation 'org.reflections:reflections:0.9.12'
- testImplementation project(path: ':main', configuration: 'tests')
testImplementation 'org.openjdk.jmh:jmh-core:1.26'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.26'
testImplementation 'com.google.guava:guava:30.0-jre'
+
+ broken "org.apache.xmlgraphics:batik-script:${batikVersion}"
+}
+
+final String MODULE_NAME = 'org.apache.poi.ooxml'
+final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
+final Pattern MODULE_REGEX = ~'\\.jar$'
+final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
+final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique() + files("build/brokenJars")
+
+final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${project.version}.jar"
+final String OOXML_LITE_REPORT = '../build/ooxml-lite-report'
+final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ withJavadocJar()
+ withSourcesJar()
+}
+
+
+compileJava {
+ dependsOn 'fixBatik'
+}
+
+task compileJava9(type: JavaCompile) {
+ dependsOn 'compileJava', ':poi:jar'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(JAVA9_OUT + VERSIONS9)
+ source = file(JAVA9_SRC)
+ classpath = files()
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
+ '--module-path', files(MAIN_MODULE_PATH).asPath
+ ]
+}
+
+task cacheJava9(type: Copy) {
+ dependsOn 'compileJava9'
+
+ from(file(JAVA9_OUT + VERSIONS9))
+ into(JAVA9_SRC)
+}
+
+task compileTest9(type: JavaCompile) {
+ dependsOn 'compileTestJava', ':poi:testJar'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(TEST9_OUT + VERSIONS9)
+ source = file(TEST9_SRC)
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
+ '--module-path', files(TEST_MODULE_PATH).asPath
+ ]
+ classpath = files()
+}
+
+
+task cacheTest9(type: Copy) {
+ dependsOn 'compileTest9'
+
+ from(file(TEST9_OUT + VERSIONS9))
+ into(TEST9_SRC)
}
jar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from JAVA9_SRC include '*.class'
+ }
+ }
+
+ manifest {
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
+ }
+}
+
+// Create a separate jar for test-code to depend on it in other projects
+// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
+task testJar(type: Jar, dependsOn: testClasses) {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
+
+ classifier 'tests'
+ // ignore second module-info.class from main
+ duplicatesStrategy = 'exclude'
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from TEST9_SRC include '*.class'
+ }
+ }
+
+ from sourceSets.test.output + sourceSets.main.output
+
manifest {
- attributes 'Automatic-Module-Name': 'org.apache.poi.ooxml'
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
}
}
+
+sourcesJar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+ exclude 'META-INF/services/**'
+}
+
+// based on https://github.com/moditect/moditect-gradle-plugin/issues/12
+task fixBatik(type: Zip) {
+ ant.mkdir(dir: "${buildDir}/brokenJars")
+ archiveFileName = "batik-script-${batikVersion}.jar"
+ destinationDirectory = file("${buildDir}/brokenJars")
+ from zipTree(configurations.broken.files.find{ f -> f.name.startsWith("batik-script") })
+ filesMatching("**/org.apache.batik.script.InterpreterFactory") {
+ it.filter{ it2 -> it2.contains("Rhino") ? "#" + it2 : it2 }
+ }
+}
+
+javadoc {
+// fails currently, need to fix the sources
+ failOnError = false
+// if(JavaVersion.current().isJava9Compatible()) {
+// options.addBooleanOption('html5', true)
+// }
+}
+
+artifacts {
+ tests testJar
+}
+
test {
// for some reason catching the OOM does not work when run from Gradle
exclude '**/MemoryUsage.class'
-}
\ No newline at end of file
+
+ dependsOn 'testJar'
+
+ useJUnitPlatform()
+
+ doFirst {
+ jvmArgs = [
+ '-Djava.io.tmpdir=build',
+ '-DPOI.testdata.path=../test-data',
+ '-Djava.awt.headless=true',
+ '-Djava.locale.providers=JRE,CLDR',
+ '-Duser.language=en',
+ '-Duser.country=US',
+ '-Djavax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl',
+ "-Dversion.id=${project.version}",
+ '-ea',
+ "-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
+
+ '-Djunit.jupiter.execution.parallel.enabled=true',
+ '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
+ '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3'
+ // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock} ... if ${isIBMVM}
+ ]
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ jvmArgs += [
+ '-Dsun.reflect.debugModuleAccessChecks=true',
+ '-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
+ '--illegal-access=warn',
+
+ '--add-modules', MODULE_NAME,
+
+ // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
+ // opposed to the recommendation there, it doesn't work to add ... to the dependencies
+ // testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.7.1'
+ // gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
+
+ '--module-path', '../build/dist/maven/poi-ooxml-tests:' + files(TEST_MODULE_PATH).asPath,
+ ]
+ }
+ }
+}
+
+publishing {
+ publications {
+ POI(MavenPublication) {
+ artifactId project.archivesBaseName
+
+ from components.java
+
+ pom {
+ name = 'Apache POI - API based on OPC and OOXML schemas'
+ description = 'Apache POI - Java API To Access Microsoft Format Files'
+ }
+ }
+ }
+}
+
+generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
Modified: poi/trunk/poi-ooxml/src/main/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java9/module-info.class?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/poi-ooxml/src/test/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/test/java9/module-info.class?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/poi-scratchpad/build.gradle
URL: http://svn.apache.org/viewvc/poi/trunk/poi-scratchpad/build.gradle?rev=1888488&r1=1888487&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi-scratchpad/build.gradle (original)
+++ poi/trunk/poi-scratchpad/build.gradle Wed Apr 7 21:40:33 2021
@@ -1,3 +1,5 @@
+import java.util.regex.Pattern
+
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,17 +17,211 @@
limitations under the License.
==================================================================== */
+plugins {
+ id 'java'
+ id 'maven-publish'
+ id 'java-library'
+}
+
+final String JAVA9_SRC = 'src/main/java9'
+final String JAVA9_OUT = "${buildDir}/classes/java9/main/"
+final String TEST9_SRC = 'src/test/java9'
+final String TEST9_OUT = "${buildDir}/classes/java9/test/"
+final String VERSIONS9 = 'META-INF/versions/9'
+
+configurations {
+ tests
+}
+
+sourceSets {
+ main {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
+ }
+ }
+ test {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(TEST9_OUT, builtBy: 'cacheTest9')
+ }
+ }
+}
+
dependencies {
- api project(':main')
+ api project(':poi')
+ api project(path:':poi', configuration: 'archives')
implementation "commons-codec:commons-codec:${commonsCodecVersion}"
implementation "org.apache.commons:commons-math3:${commonsMathVersion}"
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
- testImplementation project(path: ':main', configuration: 'tests')
+ testImplementation project(path: ':poi', configuration: 'tests')
+ testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
+}
+
+final MODULE_NAME = 'org.apache.poi.scratchpad'
+final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
+final Pattern MODULE_REGEX = ~'\\.jar$'
+final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
+final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique()
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ withJavadocJar()
+ withSourcesJar()
+}
+
+task compileJava9(type: JavaCompile) {
+ dependsOn 'compileJava', ':poi:jar'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(JAVA9_OUT + VERSIONS9)
+ source = file(JAVA9_SRC)
+ classpath = files()
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
+ '--module-path', files(MAIN_MODULE_PATH).asPath
+ ]
+}
+
+task cacheJava9(type: Copy) {
+ dependsOn 'compileJava9'
+
+ from(file(JAVA9_OUT + VERSIONS9))
+ into(JAVA9_SRC)
+}
+
+task compileTest9(type: JavaCompile) {
+ dependsOn 'compileTestJava', ':poi:jar'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(TEST9_OUT + VERSIONS9)
+ source = file(TEST9_SRC)
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
+ '--module-path', files(TEST_MODULE_PATH).asPath
+ ]
+ classpath = files()
+}
+
+
+task cacheTest9(type: Copy) {
+ dependsOn 'compileTest9'
+
+ from(file(TEST9_OUT + VERSIONS9))
+ into(TEST9_SRC)
}
jar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from JAVA9_SRC include '*.class'
+ }
+ }
+
manifest {
- attributes 'Automatic-Module-Name': 'org.apache.poi.scratchpad'
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
}
}
+
+// Create a separate jar for test-code to depend on it in other projects
+// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
+task testJar(type: Jar, dependsOn: testClasses) {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
+
+ classifier 'tests'
+ // ignore second module-info.class from main
+ duplicatesStrategy = 'exclude'
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from TEST9_SRC include '*.class'
+ }
+ }
+
+ from sourceSets.test.output + sourceSets.main.output
+
+ manifest {
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
+ }
+}
+
+sourcesJar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+ exclude 'META-INF/services/**'
+}
+
+artifacts {
+ tests testJar
+}
+
+test {
+ dependsOn 'testJar'
+
+ useJUnitPlatform()
+
+ doFirst {
+ jvmArgs = [
+ '-Djava.io.tmpdir=build',
+ '-DPOI.testdata.path=../test-data',
+ '-Djava.awt.headless=true',
+ '-Djava.locale.providers=JRE,CLDR',
+ '-Duser.language=en',
+ '-Duser.country=US',
+ '-Djavax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl',
+ "-Dversion.id=${project.version}",
+ '-ea',
+ '-Djunit.jupiter.execution.parallel.enabled=true',
+ '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
+ '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3',
+ // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock} ... if ${isIBMVM}
+ ]
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ jvmArgs += [
+ '-Dsun.reflect.debugModuleAccessChecks=true',
+ '-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
+ '--illegal-access=warn',
+
+ '--add-modules', MODULE_NAME,
+
+ // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
+ // opposed to the recommendation there, it doesn't work to add ... to the dependencies
+ // testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.7.1'
+ // gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
+
+ '--module-path', '../build/dist/maven/poi-scratchpad-tests:' + files(TEST_MODULE_PATH).asPath,
+ ]
+ }
+ }
+}
+
+javadoc {
+// fails currently, need to fix the sources
+ failOnError = false
+// if(JavaVersion.current().isJava9Compatible()) {
+// options.addBooleanOption('html5', true)
+// }
+}
+
+publishing {
+ publications {
+ POI(MavenPublication) {
+ artifactId project.archivesBaseName
+
+ from components.java
+
+ pom {
+ name = 'Apache POI'
+ description = 'Apache POI - Java API To Access Microsoft Format Files (Scratchpad)'
+ }
+ }
+ }
+}
+
+generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
Modified: poi/trunk/poi-scratchpad/src/main/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi-scratchpad/src/main/java9/module-info.class?rev=1888488&r1=1888487&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/poi-scratchpad/src/test/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi-scratchpad/src/test/java9/module-info.class?rev=1888488&r1=1888487&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/poi/build.gradle
URL: http://svn.apache.org/viewvc/poi/trunk/poi/build.gradle?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/build.gradle (original)
+++ poi/trunk/poi/build.gradle Wed Apr 7 21:40:33 2021
@@ -15,34 +15,216 @@
limitations under the License.
==================================================================== */
+import java.util.regex.Pattern
+
+plugins {
+ id 'java'
+ id 'maven-publish'
+ id 'java-library'
+}
+
+final String JAVA9_SRC = 'src/main/java9'
+final String JAVA9_OUT = "${buildDir}/classes/java9/main/"
+final String TEST9_SRC = 'src/test/java9'
+final String TEST9_OUT = "${buildDir}/classes/java9/test/"
+final String VERSIONS9 = 'META-INF/versions/9'
+
+configurations {
+ tests
+}
+
+sourceSets {
+ main {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
+ }
+ }
+ test {
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ output.dir(TEST9_OUT, builtBy: 'cacheTest9')
+ }
+ }
+}
+
dependencies {
- implementation "commons-codec:commons-codec:${commonsCodecVersion}"
- implementation 'org.apache.commons:commons-collections4:4.4'
- implementation "org.apache.commons:commons-math3:${commonsMathVersion}"
+ api "commons-codec:commons-codec:${commonsCodecVersion}"
+ api 'org.apache.commons:commons-collections4:4.4'
+ api "org.apache.commons:commons-math3:${commonsMathVersion}"
+ api 'com.zaxxer:SparseBitSet:1.2'
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
implementation 'javax.activation:activation:1.1.1'
- api 'com.zaxxer:SparseBitSet:1.2'
testImplementation 'org.reflections:reflections:0.9.12'
+ testImplementation 'org.apache.ant:ant:1.10.9'
+
+ testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
+}
+
+final String MODULE_NAME = 'org.apache.poi.poi'
+final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
+final Pattern MODULE_REGEX = ~'\\.jar$'
+final List MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique()
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ withJavadocJar()
+ withSourcesJar()
+}
+
+
+task compileJava9(type: JavaCompile) {
+ dependsOn 'compileJava'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(JAVA9_OUT + VERSIONS9)
+ source = file(JAVA9_SRC)
+ classpath = files()
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
+ '--module-path', sourceSets.main.compileClasspath.asPath
+ ]
+}
+
+task cacheJava9(type: Copy) {
+ dependsOn 'compileJava9'
+
+ from(file(JAVA9_OUT + VERSIONS9))
+ into(JAVA9_SRC)
+}
+
+task compileTest9(type: JavaCompile) {
+ dependsOn 'compileTestJava'
+
+ sourceCompatibility = 9
+ targetCompatibility = 9
+ destinationDirectory = file(TEST9_OUT + VERSIONS9)
+ source = file(TEST9_SRC)
+ options.compilerArgs = [
+ '--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
+ '--module-path', files(MODULE_PATH).asPath
+ ]
+ classpath = files()
}
+
+task cacheTest9(type: Copy) {
+ dependsOn 'compileTest9'
+
+ from(file(TEST9_OUT + VERSIONS9))
+ into(TEST9_SRC)
+}
+
+
jar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from JAVA9_SRC include '*.class'
+ }
+ }
+
manifest {
- attributes 'Automatic-Module-Name': 'org.apache.poi.main'
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
}
}
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: testClasses) {
- baseName = "test-${project.archivesBaseName}"
- from sourceSets.test.output
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
+
+ classifier 'tests'
+ // ignore second module-info.class from main
+ duplicatesStrategy = 'exclude'
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ into('META-INF/versions/9') {
+ from TEST9_SRC include '*.class'
+ }
+ }
+
+ from sourceSets.test.output + sourceSets.main.output
+
+ manifest {
+ attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
+ }
}
-configurations {
- tests
+sourcesJar {
+ destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
+ exclude 'META-INF/services/**'
+}
+
+test {
+ dependsOn 'testJar'
+
+ useJUnitPlatform()
+
+ doFirst {
+ jvmArgs = [
+ '-Djava.io.tmpdir=build',
+ '-DPOI.testdata.path=../test-data',
+ '-Djava.awt.headless=true',
+ '-Djava.locale.providers=JRE,CLDR',
+ '-Duser.language=en',
+ '-Duser.country=US',
+ '-Djavax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl',
+ "-Dversion.id=${project.version}",
+ '-ea',
+ '-Djunit.jupiter.execution.parallel.enabled=true',
+ '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
+ '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3'
+ // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock} ... if ${isIBMVM}
+ ]
+ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ jvmArgs += [
+ '-Dsun.reflect.debugModuleAccessChecks=true',
+ '-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
+ '--illegal-access=warn',
+
+ '--add-modules', MODULE_NAME,
+ // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
+ // opposed to the recommendation there, it doesn't work to add ... to the dependencies
+ // testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.7.1'
+ // gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
+ '--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
+
+ '--module-path', '../build/dist/maven/poi-tests:' + files(MODULE_PATH).asPath,
+ ]
+ }
+ }
+}
+
+javadoc {
+// fails currently, need to fix the sources
+ failOnError = false
+// if(JavaVersion.current().isJava9Compatible()) {
+// options.addBooleanOption('html5', true)
+// }
}
artifacts {
tests testJar
}
+
+publishing {
+ publications {
+ POI(MavenPublication) {
+ artifactId project.archivesBaseName
+
+ from components.java
+
+ pom {
+ name = 'Apache POI'
+ description = 'Apache POI - Java API To Access Microsoft Format Files'
+ }
+ }
+ }
+}
+
+generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
Modified: poi/trunk/poi/src/main/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java9/module-info.class?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java Wed Apr 7 21:40:33 2021
@@ -120,7 +120,7 @@ public final class POIDataSamples {
if(_instXmlDSign == null) _instXmlDSign = new POIDataSamples("xmldsign");
return _instXmlDSign;
}
-
+
/**
* Opens a sample file from the test data directory
*
@@ -197,8 +197,10 @@ public final class POIDataSamples {
return;
}
- if(new File("test-data").exists()) {
- dataDirName = "test-data";
+ if (new File("test-data").exists()) {
+ dataDirName = "test-data";
+ } else if (new File("../test-data").exists()) {
+ dataDirName = "../test-data";
} else {
throw new RuntimeException("Must set system property '" +
TEST_PROPERTY + "' before running tests");
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java Wed Apr 7 21:40:33 2021
@@ -16,18 +16,24 @@
==================================================================== */
package org.apache.poi.hssf.dev;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
import java.util.Map;
+import java.util.function.Function;
import java.util.stream.Stream;
import org.apache.poi.POIDataSamples;
+import org.apache.poi.hssf.OldExcelFormatException;
+import org.apache.poi.util.RecordFormatException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.function.Executable;
+import org.junit.jupiter.api.parallel.Execution;
+import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@@ -36,44 +42,61 @@ import org.junit.jupiter.params.provider
* Base class for integration-style tests which iterate over all test-files
* and execute the same action to find out if any change breaks these applications.
*/
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+@Execution(ExecutionMode.CONCURRENT)
public abstract class BaseTestIteratingXLS {
- protected static final Map<String,Class<? extends Throwable>> EXCLUDED = new HashMap<>();
+ private static final String[] XLS_INCLUDES = {
+ "spreadsheet/*.xls", "hpsf/*.xls"
+ };
+
+ public Stream<Arguments> files() {
+ String dataDirName = System.getProperty(POIDataSamples.TEST_PROPERTY, "test-data");
+
+ DirectoryScanner scanner = new DirectoryScanner();
+ scanner.setBasedir(dataDirName);
+ scanner.setIncludes(XLS_INCLUDES);
+ scanner.scan();
+
+ final Map<String, Class<? extends Throwable>> exc = getExcludes();
+ Function<String,Arguments> mapArg = (s) -> {
+ File f = new File(dataDirName, s);
+ return Arguments.of(f, exc.get(f.getName()));
+ };
- private static Stream<Arguments> files() {
- String dataDirName = System.getProperty(POIDataSamples.TEST_PROPERTY);
- if(dataDirName == null) {
- dataDirName = "test-data";
- }
-
- List<Arguments> files = new ArrayList<>();
- findFile(files, dataDirName + "/spreadsheet");
- findFile(files, dataDirName + "/hpsf");
-
- return files.stream();
+ return Arrays.stream(scanner.getIncludedFiles()).map(mapArg);
}
- private static void findFile(List<Arguments> list, String dir) {
- String[] files = new File(dir).list((arg0, arg1) -> arg1.toLowerCase(Locale.ROOT).endsWith(".xls"));
- assertNotNull(files, "Did not find any xls files in directory " + dir);
-
- for(String file : files) {
- list.add(Arguments.of(new File(dir, file)));
- }
+ protected Map<String,Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = new HashMap<>();
+ // Biff 2 / Excel 2, pre-OLE2
+ excludes.put("testEXCEL_2.xls", OldExcelFormatException.class);
+ // Biff 3 / Excel 3, pre-OLE2
+ excludes.put("testEXCEL_3.xls", OldExcelFormatException.class);
+ // Biff 4 / Excel 4, pre-OLE2
+ excludes.put("testEXCEL_4.xls", OldExcelFormatException.class);
+ // Biff 5 / Excel 5
+ excludes.put("testEXCEL_5.xls", OldExcelFormatException.class);
+ // Biff 5 / Excel 5
+ excludes.put("60284.xls", OldExcelFormatException.class);
+ // Biff 5 / Excel 95
+ excludes.put("testEXCEL_95.xls", OldExcelFormatException.class);
+ excludes.put("46904.xls", OldExcelFormatException.class);
+ excludes.put("59074.xls", OldExcelFormatException.class);
+ excludes.put("61300.xls", RecordFormatException.class);
+ // BIFF 5
+ excludes.put("64130.xls", OldExcelFormatException.class);
+ return excludes;
}
@ParameterizedTest
@MethodSource("files")
- void testMain(File file) throws Exception {
- String fileName = file.getName();
-
- Class<? extends Throwable> t = EXCLUDED.get(fileName);
-
+ void testMain(File file, Class<? extends Throwable> t) throws Exception {
+ Executable ex = () -> runOneFile(file);
if (t == null) {
- runOneFile(file);
+ assertDoesNotThrow(ex);
} else {
- assertThrows(t, () -> runOneFile(file));
+ assertThrows(t, ex);
}
-
}
abstract void runOneFile(File pFile) throws Exception;
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffDrawingToXml.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffDrawingToXml.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffDrawingToXml.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffDrawingToXml.java Wed Apr 7 21:40:33 2021
@@ -19,34 +19,26 @@ package org.apache.poi.hssf.dev;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.util.Map;
import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullOutputStream;
-import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
class TestBiffDrawingToXml extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
- EXCLUDED.put("51832.xls", EncryptedDocumentException.class);
- EXCLUDED.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
- EXCLUDED.put("password.xls", EncryptedDocumentException.class);
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
- EXCLUDED.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
- EXCLUDED.put("61300.xls", RecordFormatException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); // BIFF 5
+
+ @Override
+ protected Map<String, Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
+ // unsupported crypto api header
+ excludes.put("35897-type4.xls", EncryptedDocumentException.class);
+ excludes.put("51832.xls", EncryptedDocumentException.class);
+ excludes.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
+ excludes.put("password.xls", EncryptedDocumentException.class);
+ // HSSFWorkbook cannot open it as well
+ excludes.put("43493.xls", RecordInputStream.LeftoverDataException.class);
+ excludes.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
+ return excludes;
}
@Override
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffViewer.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffViewer.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestBiffViewer.java Wed Apr 7 21:40:33 2021
@@ -21,39 +21,32 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.util.Map;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.NullOutputStream;
import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.parallel.Execution;
-import org.junit.jupiter.api.parallel.ExecutionMode;
-@Execution(ExecutionMode.CONCURRENT)
class TestBiffViewer extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("35897-type4.xls", IllegalArgumentException.class); // unsupported crypto api header
- EXCLUDED.put("51832.xls", IllegalArgumentException.class);
- EXCLUDED.put("xor-encryption-abc.xls", RecordFormatException.class);
- EXCLUDED.put("password.xls", IllegalArgumentException.class);
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("43493.xls", RecordFormatException.class); // HSSFWorkbook cannot open it as well
+ @Override
+ protected Map<String, Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
+ // unsupported crypto api header
+ excludes.put("35897-type4.xls", IllegalArgumentException.class);
+ excludes.put("51832.xls", IllegalArgumentException.class);
+ excludes.put("xor-encryption-abc.xls", RecordFormatException.class);
+ excludes.put("password.xls", IllegalArgumentException.class);
+ // HSSFWorkbook cannot open it as well
+ excludes.put("43493.xls", RecordFormatException.class);
// EXCLUDED.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
- EXCLUDED.put("50833.xls", IllegalArgumentException.class); // "Name is too long" when setting username
- EXCLUDED.put("XRefCalc.xls", RuntimeException.class); // "Buffer overrun"
- EXCLUDED.put("61300.xls", IndexOutOfBoundsException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); //Biff 5
+ // "Name is too long" when setting username
+ excludes.put("50833.xls", IllegalArgumentException.class);
+ // "Buffer overrun"
+ excludes.put("XRefCalc.xls", RuntimeException.class);
+
+ excludes.put("61300.xls", IndexOutOfBoundsException.class);
+ return excludes;
}
@Override
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestEFBiffViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestEFBiffViewer.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestEFBiffViewer.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestEFBiffViewer.java Wed Apr 7 21:40:33 2021
@@ -19,38 +19,27 @@ package org.apache.poi.hssf.dev;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
+import java.util.Map;
import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullPrintStream;
-import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestEFBiffViewer extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
- EXCLUDED.put("51832.xls", EncryptedDocumentException.class);
- EXCLUDED.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
- EXCLUDED.put("password.xls", EncryptedDocumentException.class);
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
- EXCLUDED.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
+ @Override
+ protected Map<String, Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
+ excludes.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
+ excludes.put("51832.xls", EncryptedDocumentException.class);
+ excludes.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
+ excludes.put("password.xls", EncryptedDocumentException.class);
+ excludes.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
+ excludes.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
// EXCLUDED.put("XRefCalc.xls", RuntimeException.class); // "Buffer overrun"
- EXCLUDED.put("61300.xls", RecordFormatException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); //Biff 5
+ return excludes;
}
@Override
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestFormulaViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestFormulaViewer.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestFormulaViewer.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestFormulaViewer.java Wed Apr 7 21:40:33 2021
@@ -20,37 +20,26 @@ import static org.junit.jupiter.api.Assu
import java.io.File;
import java.io.PrintStream;
+import java.util.Map;
import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullPrintStream;
-import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestFormulaViewer extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
- EXCLUDED.put("51832.xls", EncryptedDocumentException.class);
- EXCLUDED.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
- EXCLUDED.put("password.xls", EncryptedDocumentException.class);
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
- EXCLUDED.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
- EXCLUDED.put("61300.xls", RecordFormatException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); //Biff 5
+ @Override
+ protected Map<String, Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
+ excludes.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
+ excludes.put("51832.xls", EncryptedDocumentException.class);
+ excludes.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
+ excludes.put("password.xls", EncryptedDocumentException.class);
+ excludes.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
+ excludes.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
+ return excludes;
}
@Override
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestReSave.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestReSave.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestReSave.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestReSave.java Wed Apr 7 21:40:33 2021
@@ -20,14 +20,12 @@ import static org.junit.jupiter.api.Asse
import java.io.File;
import java.io.PrintStream;
+import java.util.Map;
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.POIDataSamples;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.hssf.record.RecordInputStream;
import org.apache.poi.util.NullPrintStream;
-import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
@@ -37,26 +35,20 @@ import org.junit.jupiter.api.parallel.Re
@Isolated("Modifies the test data directory")
@ResourceLock(Resources.SYSTEM_OUT)
class TestReSave extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("35897-type4.xls", EncryptedDocumentException.class); // unsupported crypto api header
- EXCLUDED.put("51832.xls", EncryptedDocumentException.class);
- EXCLUDED.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
- EXCLUDED.put("password.xls", EncryptedDocumentException.class);
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("43493.xls", RecordInputStream.LeftoverDataException.class); // HSSFWorkbook cannot open it as well
- EXCLUDED.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
- EXCLUDED.put("XRefCalc.xls", RuntimeException.class); // "Buffer overrun"
- EXCLUDED.put("61300.xls", RecordFormatException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); //Biff 5
+ @Override
+ protected Map<String, Class<? extends Throwable>> getExcludes() {
+ Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
+ // unsupported crypto api header
+ excludes.put("35897-type4.xls", EncryptedDocumentException.class);
+ excludes.put("51832.xls", EncryptedDocumentException.class);
+ excludes.put("xor-encryption-abc.xls", EncryptedDocumentException.class);
+ excludes.put("password.xls", EncryptedDocumentException.class);
+ // HSSFWorkbook cannot open it as well
+ excludes.put("43493.xls", RecordInputStream.LeftoverDataException.class);
+ excludes.put("44958_1.xls", RecordInputStream.LeftoverDataException.class);
+ // "Buffer overrun"
+ excludes.put("XRefCalc.xls", RuntimeException.class);
+ return excludes;
}
@Override
Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestRecordLister.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestRecordLister.java?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestRecordLister.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/dev/TestRecordLister.java Wed Apr 7 21:40:33 2021
@@ -20,30 +20,12 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
-import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.util.NullPrintStream;
-import org.apache.poi.util.RecordFormatException;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;
@ResourceLock(Resources.SYSTEM_OUT)
class TestRecordLister extends BaseTestIteratingXLS {
- @BeforeAll
- public static void setup() {
- EXCLUDED.clear();
- EXCLUDED.put("46904.xls", OldExcelFormatException.class);
- EXCLUDED.put("59074.xls", OldExcelFormatException.class);
- EXCLUDED.put("testEXCEL_2.xls", OldExcelFormatException.class); // Biff 2 / Excel 2, pre-OLE2
- EXCLUDED.put("testEXCEL_3.xls", OldExcelFormatException.class); // Biff 3 / Excel 3, pre-OLE2
- EXCLUDED.put("testEXCEL_4.xls", OldExcelFormatException.class); // Biff 4 / Excel 4, pre-OLE2
- EXCLUDED.put("testEXCEL_5.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("60284.xls", OldExcelFormatException.class); // Biff 5 / Excel 5
- EXCLUDED.put("testEXCEL_95.xls", OldExcelFormatException.class); // Biff 5 / Excel 95
- EXCLUDED.put("61300.xls", RecordFormatException.class);
- EXCLUDED.put("64130.xls", OldExcelFormatException.class); //Biff 5
- }
-
@Override
void runOneFile(File fileIn) throws IOException {
PrintStream save = System.out;
Modified: poi/trunk/poi/src/test/java9/module-info.class
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java9/module-info.class?rev=1888488&r1=1888393&r2=1888488&view=diff
==============================================================================
Binary files - no diff available.
Modified: poi/trunk/settings.gradle
URL: http://svn.apache.org/viewvc/poi/trunk/settings.gradle?rev=1888488&r1=1888487&r2=1888488&view=diff
==============================================================================
--- poi/trunk/settings.gradle (original)
+++ poi/trunk/settings.gradle Wed Apr 7 21:40:33 2021
@@ -1,3 +1,5 @@
rootProject.name = 'poi'
-include 'main', 'ooxml-schema', 'ooxml', 'excelant', 'examples', 'scratchpad', 'integrationtest'
\ No newline at end of file
+include 'poi', 'poi-ooxml-full', 'poi-ooxml-lite-agent', 'poi-scratchpad',
+ 'poi-ooxml', 'poi-excelant', 'poi-examples', 'poi-integration',
+ 'poi-ooxml-lite'
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org