Name: jwebunit Version: 3.0 Release: 1%{?dist} Summary: Java framework for testing web applications Group: Development/Libraries License: LGPLv3 URL: http://jwebunit.sourceforge.net/ # newer release require htmlunit >= 2.11 Source0: http://downloads.sourceforge.net/jwebunit/%{name}-%{version}-source-release.zip BuildRequires: java-devel # commons-tests %if 0 BuildRequires: apache-commons-fileupload BuildRequires: apache-commons-io BuildRequires: hamcrest BuildRequires: jetty-webapp %endif # core BuildRequires: junit BuildRequires: regexp BuildRequires: slf4j BuildRequires: tomcat-servlet-3.0-api # htmlunit plugin BuildRequires: htmlunit BuildRequires: logback # test deps BuildRequires: mockito BuildRequires: javacc-maven-plugin BuildRequires: maven-license-plugin BuildRequires: maven-local BuildRequires: maven-plugin-exec BuildRequires: maven-site-plugin Requires: java BuildArch: noarch %description JWebUnit is a Java framework that facilitates creation of acceptance tests for web applications. It evolved from a project where we were using HttpUnit and JUnit to create acceptance tests. As the tests were being written, they were continuously ref-actored to remove duplication and other bad smells in the test code. JWebUnit is the result of these refactorings. %package code-generator Group: Development/Libraries Summary: JWebUnit Code Generator Requires: %{name} = %{version}-%{release} %description code-generator JavaCC parsers that create WebTestCase and JWebUnit based on WebTester. %if 0 %package commons-tests Group: Development/Libraries Summary: JWebUnit Commons Tests Requires: %{name} = %{version}-%{release} Requires: %{name}-core = %{version}-%{release} Requires: apache-commons-fileupload Requires: apache-commons-io Requires: hamcrest Requires: jetty-webapp %description commons-tests All test cases that each plugin should pass. %endif %package core Group: Development/Libraries Summary: JWebUnit Core - API Requires: %{name} = %{version}-%{release} Requires: junit Requires: regexp Requires: slf4j Requires: tomcat-servlet-3.0-api %description core The core API of JWebUnit. Define how tests should be written and interface for testing engines. %package htmlunit-plugin Group: Development/Libraries Summary: JWebUnit Core - API Requires: %{name} = %{version}-%{release} Requires: %{name}-core = %{version}-%{release} Requires: htmlunit Requires: logback Requires: slf4j Requires: tomcat-servlet-3.0-api %description htmlunit-plugin The core API of JWebUnit. Define how tests should be written and interface for testing engines. %package javadoc Group: Documentation Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -q %pom_remove_plugin :findbugs-maven-plugin %pom_remove_plugin :jdepend-maven-plugin %pom_remove_plugin :taglist-maven-plugin %pom_remove_plugin :maven-toolchains-plugin sed -i "s|junit-dep|junit|" pom.xml jwebunit-core/pom.xml \ jwebunit-commons-tests/pom.xml jwebunit-htmlunit-plugin/pom.xml # unavailable build deps # org.seleniumhq.selenium.client-drivers:selenium-java-client-driver:1.0.2 # org.codehaus.mojo:selenium-maven-plugin:1.1 %pom_disable_module jwebunit-selenium-plugin %pom_remove_dep :selenium-java-client-driver %if 0 # only this test fails # Caused by: com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: # 404 Not Found for http://localhost:8082/jwebunit/pageWithLink.html rm -r jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java %else # Uwanted used only for testing jwebunit plugin ... really? %pom_disable_module jwebunit-commons-tests %pom_remove_dep :jwebunit-commons-tests jwebunit-htmlunit-plugin rm -r jwebunit-htmlunit-plugin/src/test/java/* %endif sed -i 's/\r//' README.txt %build # default used javax.servlet:servlet-api:2.5 mvn-rpmbuild \ -Dmaven.local.depmap.file="%{_mavendepmapfragdir}/tomcat-tomcat-servlet-api" \ package javadoc:aggregate %install mkdir -p %{buildroot}%{_mavenpomdir} install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom mkdir -p %{buildroot}%{_javadir}/%{name} for a in code-generator \ %if 0 commons-tests \ %endif core \ htmlunit-plugin; do install -m 644 %{name}-${a}/target/%{name}-${a}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-${a}.jar install -pm 644 %{name}-${a}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-${a}.pom %add_maven_depmap JPP.%{name}-%{name}-${a}.pom %{name}/%{name}-${a}.jar -f ${a} done mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %files %dir %{_javadir}/%{name} %{_mavenpomdir}/JPP-%{name}.pom %{_mavendepmapfragdir}/%{name} %doc COPYING COPYING.LESSER LICENSE.txt README.txt %files code-generator %{_javadir}/%{name}/%{name}-code-generator.jar %{_mavenpomdir}/JPP.%{name}-%{name}-code-generator.pom %{_mavendepmapfragdir}/%{name}-code-generator %doc COPYING COPYING.LESSER LICENSE.txt %if 0 %files commons-tests %{_javadir}/%{name}/%{name}-commons-tests.jar %{_mavenpomdir}/JPP.%{name}-%{name}-commons-tests.pom %{_mavendepmapfragdir}/%{name}-commons-tests %doc COPYING COPYING.LESSER LICENSE.txt %endif %files core %{_javadir}/%{name}/%{name}-core.jar %{_mavenpomdir}/JPP.%{name}-%{name}-core.pom %{_mavendepmapfragdir}/%{name}-core %doc COPYING COPYING.LESSER LICENSE.txt %files htmlunit-plugin %{_javadir}/%{name}/%{name}-htmlunit-plugin.jar %{_mavenpomdir}/JPP.%{name}-%{name}-htmlunit-plugin.pom %{_mavendepmapfragdir}/%{name}-htmlunit-plugin %doc COPYING COPYING.LESSER LICENSE.txt %files javadoc %{_javadocdir}/%{name} %doc COPYING COPYING.LESSER LICENSE.txt %changelog * Sat Jun 01 2013 gil cattaneo 3.0-1 - initial rpm