%global enable_tests 0 Name: dbunit Version: 2.5.1 Release: 8%{?dist} Summary: A JUnit extension targeted for database-driven projects # see https://sourceforge.net/p/dbunit/bugs/357/ for Incorrect FSF Address License: LGPLv2+ URL: http://dbunit.sourceforge.net/ # git clone git://git.code.sf.net/p/dbunit/code.git dbunit-2.5.1 # (cd dbunit-2.5.1/ && git archive --format=tar --prefix=dbunit-2.5.1/ dbunit-2.5.1 | xz > ../dbunit-2.5.1.tar.xz) Source0: %{name}-%{version}.tar.xz Patch0: dbunit-2.5.1-use-jvm-Base64.patch BuildRequires: maven-local BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.ant:ant) BuildRequires: mvn(org.apache.poi:poi) BuildRequires: mvn(org.apache.poi:poi-ooxml) BuildRequires: mvn(org.slf4j:jcl-over-slf4j) BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) BuildRequires: mvn(stax:stax-api) # profiles %if 0 BuildRequires: mvn(com.h2database:h2) BuildRequires: mvn(hsqldb:hsqldb:1) BuildRequires: mvn(mysql:mysql-connector-java) BuildRequires: mvn(org.apache.derby:derby) BuildRequires: mvn(postgresql:postgresql) %endif # maven plugin deps %if 0 BuildRequires: mvn(org.apache.maven:maven-plugin-api:2.0) BuildRequires: mvn(org.apache.maven:maven-settings:2.0) BuildRequires: mvn(org.slf4j:slf4j-simple) %endif # test deps %if %enable_tests BuildRequires: mvn(ch.qos.logback:logback-classic) BuildRequires: mvn(com.h2database:h2) BuildRequires: mvn(commons-io:commons-io) BuildRequires: mvn(gsbase:gsbase) BuildRequires: mvn(junit-addons:junit-addons) BuildRequires: mvn(mockmaker:mmmockobjects) BuildRequires: mvn(mockobjects:mockobjects-core) BuildRequires: mvn(mockobjects:mockobjects-jdk1.3) BuildRequires: mvn(org.apache.ant:ant-testutil) BuildRequires: mvn(xerces:xmlParserAPIs) %endif BuildArch: noarch %description DbUnit is a JUnit extension (also usable with Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage. DbUnit has the ability to export and import your database data to and from XML data-sets. Since version 2.0, DbUnit can works with very large data-set when use in streaming mode. DbUnit can also helps you to verify that your database data match expected set of values. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -q find . -name "*.class" -print -delete find . -name "*.jar" -print -delete %patch0 -p1 rm -rf %{name}/src/main/java/org/dbunit/util/Base64.java %if %enable_tests # test resource ( cd %{name}/src/test/resources/csv/orders %jar -cf orders.jar orders.csv orders_row.csv table-ordering.txt ) %endif # Unavailable /unwanted plugin %pom_remove_plugin :jdepend-maven-plugin %{name} %pom_remove_plugin :sql-maven-plugin %{name} %pom_remove_plugin :maven-pmd-plugin %{name} %pom_disable_module %{name}-maven-plugin %pom_change_dep ant:ant org.apache.ant:ant %{name} # disable plugin used for testing %pom_remove_plugin :maven-failsafe-plugin %{name} %pom_remove_plugin :cobertura-maven-plugin %{name} # build problem: # A type incompatibility occured while executing org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce: # org.apache.maven.project.MavenProject cannot be cast to java.lang.String %pom_remove_plugin :maven-enforcer-plugin %{name} # remove all profile with non free deps %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='official']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='oracle-default']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='oracle-ojdbc14']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='oracle-ojdbc6']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='oracle10-ojdbc14']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='oracle10-ojdbc6']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='mssql']" %{name} %pom_xpath_remove "pom:profiles/pom:profile[pom:id ='db2']" %{name} # requires # com.oracle ojdbc14 10.2.0.4.0 # com.oracle ojdbc6 11.1.0.7.0 rm -rf %{name}/src/main/java/org/dbunit/ext/oracle rm -rf %{name}/src/test/java/org/dbunit/ext/oracle rm -r %{name}/src/test/java/org/dbunit/OracleEnvironment.java \ %{name}/src/test/java/org/dbunit/Oracle10Environment.java \ %{name}/src/test/java/org/dbunit/ant/DbUnitTaskIT.java \ %{name}/src/test/java/org/dbunit/DatabaseEnvironment.java %pom_xpath_remove "pom:dependency[pom:scope ='test']" %{name} cp -p %{name}/LICENSE.txt . %mvn_package :%{name}-all __noinstall %mvn_file : %{name} %build # unavailable test deps # available profiles derby h2 hsqldb mysql postgresql %mvn_build -f -- -Dproject.build.sourceEncoding=UTF-8 %install %mvn_install mkdir -p %{buildroot}%{_sysconfdir}/ant.d echo "ant %{name} slf4j/slf4j-api" > %{name}-ant install -pm 644 %{name}-ant %{buildroot}%{_sysconfdir}/ant.d/%{name} %files -f .mfiles %config(noreplace) %{_sysconfdir}/ant.d/%{name} %license LICENSE.txt %files javadoc -f .mfiles-javadoc %license LICENSE.txt %changelog * Wed Jul 24 2019 Fedora Release Engineering - 2.5.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu Jan 31 2019 Fedora Release Engineering - 2.5.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Thu Jul 12 2018 Fedora Release Engineering - 2.5.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 07 2018 Fedora Release Engineering - 2.5.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 2.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 2.5.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Feb 03 2016 Fedora Release Engineering - 2.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Oct 27 2015 gil cattaneo 2.5.1-1 - update to 2.5.1 * Wed Jun 17 2015 Fedora Release Engineering - 2.5.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sun Feb 01 2015 gil cattaneo 2.5.0-3 - introduce license macro * Mon Aug 04 2014 gil cattaneo 2.5.0-2 - fix some review issues * Sat Aug 02 2014 gil cattaneo 2.5.0-1 - update to 2.5.0 * Tue May 21 2013 gil cattaneo 2.4.9-1 - update to 2.4.9 * Fri May 04 2012 gil cattaneo 2.4.8-1 - initial rpm