Bug 1380942

Summary: Review Request: jwebunit - Java framework for testing web applications
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: Package ReviewAssignee: Pavel Alexeev <pahan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mizdebsk, package-review, pahan, puntogil
Target Milestone: ---Flags: pahan: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-11 00:29:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Raphael Groner 2016-10-01 18:21:06 UTC
Spec URL: https://raphgro.fedorapeople.org/review/java/testing/jwebunit.spec
SRPM URL: https://raphgro.fedorapeople.org/review/java/testing/jwebunit-3.3-1.fc25.src.rpm
Description: Java framework for testing web applications
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.

Fedora Account System Username: raphgro

Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=15896833

Comment 1 Raphael Groner 2016-10-01 18:48:15 UTC
FTBFS with htmlunit 2.23 as currently in rawhide, but builds with htmlunit 2.20 as in Fedora 25.

https://github.com/JWebUnit/jwebunit/issues/4

Fedora 25: http://koji.fedoraproject.org/koji/taskinfo?taskID=15896976
There are errors 505 Service unavailable. Though, local mock works.

Comment 2 gil cattaneo 2016-10-02 20:41:33 UTC
(In reply to Raphael Groner from comment #1)
> FTBFS with htmlunit 2.23 as currently in rawhide, but builds with htmlunit
> 2.20 as in Fedora 25.
> 
> https://github.com/JWebUnit/jwebunit/issues/4
> 
> Fedora 25: http://koji.fedoraproject.org/koji/taskinfo?taskID=15896976
> There are errors 505 Service unavailable. Though, local mock works.

Deprecated: method getContent()
location: class com.gargoylesoftware.htmlunit.xml.XmlPage
as of 2.18, please use com.gargoylesoftware.htmlunit.SgmlPage.getWebResponse().getContentAsString()

Comment 3 gil cattaneo 2016-10-02 20:48:43 UTC
Maybe could work:

- return ((XmlPage) page).getContent(); 
+ return ((SgmlPage) page).getWebResponse().getContentAsString();

Comment 5 Raphael Groner 2016-10-03 21:33:22 UTC
Spec URL: https://raphgro.fedorapeople.org/review/java/testing/jwebunit.spec
SRPM URL: https://raphgro.fedorapeople.org/review/java/testing/jwebunit-3.3-2.fc25.src.rpm

- Added upstream patch for htmlunit 2.23
- Koji still fails the htmlunit tests, should I disable those?

Comment 6 Pavel Alexeev 2016-10-12 09:17:19 UTC
What is status of tests? Does it works locally? Did you fill bugs for author?

Comment 7 Raphael Groner 2016-10-15 17:22:47 UTC
Tests work locally and in mock. But I don't know what's the reason to let them fail for the htmlunit parts in koji, maybe caused by some network restriction or general limitation of resources.

Asking upstream: https://github.com/JWebUnit/jwebunit/issues/5

Running net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest
Tests run: 3, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 2.31 sec <<< FAILURE! - in net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest
testChangeRefreshHandler(net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest)  Time elapsed: 1.435 sec  <<< ERROR!
net.sourceforge.jwebunit.exception.TestingEngineResponseException: unexpected status code [503] at URL: [http://localhost:8082/jwebunit/RefreshHandlerTest/testPage.html]
	at net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest.testChangeRefreshHandler(RefreshHandlerTest.java:96)
Caused by: com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 503 Service Unavailable for http://localhost:8082/jwebunit/RefreshHandlerTest/testPage.html
	at net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest.testChangeRefreshHandler(RefreshHandlerTest.java:96)
testAlternateRefreshHandler(net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest)  Time elapsed: 0.024 sec  <<< ERROR!
net.sourceforge.jwebunit.exception.TestingEngineResponseException: unexpected status code [503] at URL: [http://localhost:8082/jwebunit/RefreshHandlerTest/testPage.html]
	at net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest.testAlternateRefreshHandler(RefreshHandlerTest.java:75)
Caused by: com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 503 Service Unavailable for http://localhost:8082/jwebunit/RefreshHandlerTest/testPage.html
	at net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest.testAlternateRefreshHandler(RefreshHandlerTest.java:75)
testDefaultRefreshHandler(net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest)  Time elapsed: 0.028 sec  <<< FAILURE!
java.lang.AssertionError: 
msg was not as expected.
[unexpected status code [503] at URL: [http://localhost:8082/jwebunit/RefreshHandlerTest/testPage.html]]
	at net.sourceforge.jwebunit.htmlunit.RefreshHandlerTest.testDefaultRefreshHandler(RefreshHandlerTest.java:55)
[…]

Comment 8 Pavel Alexeev 2016-10-22 22:01:42 UTC
Package Review
==============

Legend:
[+] = Pass, [!] = Fail, [*] = Not applicable, [?] = Not evaluated


Issues:
=======
[!]: Requires correct, justified where necessary.
 tomcat-servlet-3.0-api does not found in Fedora repos
[!] Package installs properly:
    sudo dnf install jwebunit-3.3-2.fc25.noarch.rpm jwebunit-code-generator-3.3-2.fc25.noarch.rpm jwebunit-core-3.3-2.fc25.noarch.rpm jwebunit-htmlunit-plugin-3.3-2.fc25.noarch.rpm jwebunit-javadoc-3.3-2.fc25.noarch.rpm --enablerepo=rawhide
    Error: nothing provides tomcat-servlet-3.0-api needed by jwebunit-htmlunit-plugin-3.3-2.fc25.noarch
[!]: %check is present and all tests pass.
Plese add llink to upstream report in spec file and comment out test run.

===== MUST items =====

Generic:
[+]: Package is licensed with an open-source compatible license and meets other legal requirements as defined in the legal section of Packaging Guidelines.
[+]: License field in the package spec file matches the actual license. Note: Checking patched sources after %prep for licenses. Licenses found: "LGPL (v3 or later)", "Unknown or generated". 29 files have unknown license.
[+]: License file installed when any subpackage combination is installed.
[+]: Package contains no bundled libraries without FPC exception.
[+]: Changelog in prescribed format.
[+]: Sources contain only permissible code or content.
[x]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[+]: Package uses nothing in %doc for runtime.
[+]: Package consistently uses macros (instead of hard-coded directory names).
[+]: Package is named according to the Package Naming Guidelines.
[+]: Package does not generate any conflict.
[+]: Package obeys FHS, except libexecdir and /usr/target.
[*]: If the package is a rename of another package, proper Obsoletes and Provides are present.
[!]: Requires correct, justified where necessary.
tomcat-servlet-3.0-api does not found in Fedora repos
[+]: Spec file is legible and written in American English.
[*]: Package contains systemd file(s) if in need.
[+]: Package is not known to require an ExcludeArch tag.
[+]: Large documentation must go in a -doc subpackage. Large could be size (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[+]: Package complies to the Packaging Guidelines
[+]: Package successfully compiles and builds into binary rpms on at least one supported primary architecture.
[+]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[+]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[+]: Package requires other packages for directories it uses.
[+]: Package must own all directories that it creates.
[+]: Package does not own files or directories owned by other packages.
[+]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[+]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[+]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[+]: Macros in Summary, %description expandable at SRPM build time.
[+]: Dist tag is present.
[+]: Package does not contain duplicates in %files.
[+]: Permissions on files are set properly.
[+]: Package use %makeinstall only when make install DESTDIR=... doesn't work.
[+]: Package is named using only allowed ASCII characters.
[+]: Package does not use a name that already exists.
[+]: Package is not relocatable.
[+]: Sources used to build the package match the upstream source, as provided in the spec URL.
[+]: Spec file name must match the spec package %{name}, in the format %{name}.spec.
[+]: File names are valid UTF-8.
[+]: Packages must not store files under /srv, /opt or /usr/local

Java:
[+]: Bundled jar/class files should be removed before build
[+]: Packages have proper BuildRequires/Requires on jpackage-utils
     Note: Maven packages do not need to (Build)Require jpackage-utils. It is pulled in by maven-local
[+]: Javadoc documentation files are generated and included in -javadoc subpackage
[+]: Javadoc subpackages should not have Requires: jpackage-utils
[+]: Javadocs are placed in %{_javadocdir}/%{name} (no -%{version} symlink)

Maven:
[+]: If package contains pom.xml files install it (including metadata) even when building with ant
[+]: POM files have correct Maven mapping
[+]: Maven packages should use new style packaging
[+]: Old add_to_maven_depmap macro is not being used
[+]: Packages DO NOT have Requires(post) and Requires(postun) on jpackage-utils for %update_maven_depmap macro
[+]: Package DOES NOT use %update_maven_depmap in %post/%postun
[+]: Packages use .mfiles file list instead of %{_datadir}/maven2/poms

===== SHOULD items =====

Generic:
[*]: If the source package does not include license text(s) as a separate file from upstream, the packager SHOULD query upstream to include it.
[+]: Final provides and requires are sane (see attachments).
[+]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     jwebunit-javadoc
[?]: Package functions as described.
[+]: Latest version is packaged.
[+]: Package does not include license text files separate from upstream.
[+]: Patches link to upstream bugs/comments/lists or are otherwise justified.
[*]: Description and summary sections in the package spec file contains translations for supported Non-English languages, if available.
[+]: Package should compile and build into binary rpms on all supported architectures.
[!]: %check is present and all tests pass.
Plese add llink to upstream report in spec file and comment out test run.
[+]: Packages should try to preserve timestamps of original installed files.
[+]: Reviewer should test that the package builds in mock.
[+]: Buildroot is not present
[+]: Package has no %clean section with rm -rf %{buildroot} (or $RPM_BUILD_ROOT)
[+]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[+]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[+]: Sources can be downloaded from URI in Source: tag
[+]: SourceX is a working URL.
[+]: Spec use %global instead of %define unless justified.

Java:
[+]: Package uses upstream build method (ant/maven/etc.)
[+]: Packages are noarch unless they use JNI

Rpmlint
-------
Checking: jwebunit-3.3-2.fc25.noarch.rpm
          jwebunit-code-generator-3.3-2.fc25.noarch.rpm
          jwebunit-core-3.3-2.fc25.noarch.rpm
          jwebunit-htmlunit-plugin-3.3-2.fc25.noarch.rpm
          jwebunit-javadoc-3.3-2.fc25.noarch.rpm
          jwebunit-3.3-2.fc25.src.rpm
jwebunit.noarch: W: spelling-error %description -l en_US actored -> factored, actor ed, actor-ed
jwebunit.noarch: W: spelling-error %description -l en_US refactorings -> benefactors
jwebunit.noarch: W: wrong-file-end-of-line-encoding /usr/share/doc/jwebunit/README.md
jwebunit-code-generator.noarch: W: spelling-error %description -l en_US parsers -> parser, parses, parers
jwebunit-code-generator.noarch: W: no-documentation
jwebunit-core.noarch: W: no-documentation
jwebunit-htmlunit-plugin.noarch: W: no-documentation
jwebunit.src: W: spelling-error %description -l en_US actored -> factored, actor ed, actor-ed
jwebunit.src: W: spelling-error %description -l en_US refactorings -> benefactors
6 packages and 0 specfiles checked; 0 errors, 9 warnings.


Requires
--------
jwebunit (rpmlib, GLIBC filtered):
    java-headless
    javapackages-tools
    mvn(org.apache.maven.plugins:maven-site-plugin)

jwebunit-code-generator (rpmlib, GLIBC filtered):
    java-headless
    javapackages-tools
    jwebunit

jwebunit-javadoc (rpmlib, GLIBC filtered):
    javapackages-tools

jwebunit-core (rpmlib, GLIBC filtered):
    java-headless
    javapackages-tools
    junit
    jwebunit
    mvn(commons-lang:commons-lang)
    mvn(javax.servlet:servlet-api)
    mvn(junit:junit)
    mvn(regexp:regexp)
    regexp
    slf4j
    tomcat-servlet-3.1-api

jwebunit-htmlunit-plugin (rpmlib, GLIBC filtered):
    htmlunit
    java-headless
    javapackages-tools
    jwebunit
    jwebunit-core
    logback
    mvn(javax.servlet:servlet-api)
    mvn(net.sourceforge.htmlunit:htmlunit)
    mvn(net.sourceforge.jwebunit:jwebunit-core)
    mvn(org.slf4j:jcl-over-slf4j)
    mvn(org.slf4j:slf4j-api)
    slf4j
    tomcat-servlet-3.0-api



Provides
--------
jwebunit:
    jwebunit
    mvn(net.sourceforge.jwebunit:jwebunit:pom:)

jwebunit-code-generator:
    jwebunit-code-generator
    mvn(net.sourceforge.jwebunit:jwebunit-code-generator)
    mvn(net.sourceforge.jwebunit:jwebunit-code-generator:pom:)

jwebunit-javadoc:
    jwebunit-javadoc

jwebunit-core:
    jwebunit-core
    mvn(net.sourceforge.jwebunit:jwebunit-core)
    mvn(net.sourceforge.jwebunit:jwebunit-core:pom:)

jwebunit-htmlunit-plugin:
    jwebunit-htmlunit-plugin
    mvn(net.sourceforge.jwebunit:jwebunit-htmlunit-plugin)
    mvn(net.sourceforge.jwebunit:jwebunit-htmlunit-plugin:pom:)



Source checksums
----------------
https://github.com/JWebUnit/jwebunit/archive/jwebunit-3.3.tar.gz :
  CHECKSUM(SHA256) this package     : 82ac156cf8b0e534ed9c342143d5d461ae96b4ad6e779b927cb1fb32331b01e6
  CHECKSUM(SHA256) upstream package : 82ac156cf8b0e534ed9c342143d5d461ae96b4ad6e779b927cb1fb32331b01e6


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -b 1380942 -m fedora-25-x86_64
Buildroot used: fedora-25-x86_64
Active plugins: Generic, Shell-api, Java
Disabled plugins: C/C++, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6


Please add in comment URL on test run fails upstream bugreport, comment out test. It is not stop issue.

And only major issue I found in required tomcat-servlet-3.0-api present which is not in Fedora as can I see.

Comment 9 Raphael Groner 2016-11-03 21:05:28 UTC
> # FIXME unavailable dependency for tests: tempus-fugit

Done, see bug #1009654.

I'll provide an update later, incl. fixes for the issues below.

Comment 10 gil cattaneo 2016-11-03 23:28:04 UTC
Must be removed all "Requires: ..." are useless.
Because all Requires are handled by our Java Tools.

Suggestion, instead of:

...
%mvn_package :%{name}-code-generator code-generator
%mvn_package :%{name}-core core
%mvn_package :%{name}-htmlunit-plugin htmlunit-plugin


%build
%mvn_build

...

%files -f .mfiles
%license COPYING COPYING.LESSER LICENSE.txt
%doc README.md

%files code-generator -f .mfiles-code-generator
%license COPYING COPYING.LESSER LICENSE.txt

%files core -f .mfiles-core
%license COPYING COPYING.LESSER LICENSE.txt

%files htmlunit-plugin -f .mfiles-htmlunit-plugin

You could use:

...


%build
%mvn_build -s

...

%files -f .mfiles-jwebunit
%license COPYING COPYING.LESSER LICENSE.txt

%files code-generator -f .mfiles-jwebunit-code-generator
%license COPYING COPYING.LESSER LICENSE.txt

%files core -f .mfiles-jwebunit-core
%license COPYING COPYING.LESSER LICENSE.txt
%doc README.md

%files htmlunit-plugin -f .mfiles-htmlunit-plugin

Comment 11 gil cattaneo 2016-11-03 23:31:01 UTC
(In reply to gil cattaneo from comment #10)
> Must be removed all "Requires: ..." are useless.
> Because all Requires are handled by our Java Tools.
> 
> Suggestion, instead of:
> 
> ...
> %mvn_package :%{name}-code-generator code-generator
> %mvn_package :%{name}-core core
> %mvn_package :%{name}-htmlunit-plugin htmlunit-plugin
> 
> 
> %build
> %mvn_build
> 
> ...
> 
> %files -f .mfiles
> %license COPYING COPYING.LESSER LICENSE.txt
> %doc README.md
> 
> %files code-generator -f .mfiles-code-generator
> %license COPYING COPYING.LESSER LICENSE.txt
> 
> %files core -f .mfiles-core
> %license COPYING COPYING.LESSER LICENSE.txt
> 
> %files htmlunit-plugin -f .mfiles-htmlunit-plugin
> 
> You could use:
> 
> ...
> 
> 
> %build
> %mvn_build -s
> 
> ...
> 
> %files -f .mfiles-jwebunit
> %license COPYING COPYING.LESSER LICENSE.txt
> 
> %files code-generator -f .mfiles-jwebunit-code-generator
> %license COPYING COPYING.LESSER LICENSE.txt
> 
> %files core -f .mfiles-jwebunit-core
> %license COPYING COPYING.LESSER LICENSE.txt
> %doc README.md

Ops forgotten
> %files htmlunit-plugin -f .mfiles-htmlunit-plugin
become %files htmlunit-plugin -f .mfiles-jwebunit-htmlunit-plugin

Comment 12 Raphael Groner 2016-11-04 07:01:10 UTC
@gil,
interesting, you're doing a review for your own (initial) spec file? :)

Comment 13 gil cattaneo 2016-11-04 10:10:21 UTC
(In reply to Raphael Groner from comment #12)
> @gil,
> interesting, you're doing a review for your own (initial) spec file? :)

Well some time has passed since my first draft of this spec file, and many things have changed in the (java) guideline. You should consider to adapt the spec file to the most recent.

Comment 14 Raphael Groner 2016-11-11 20:27:21 UTC
SPEC: https://raphgro.fedorapeople.org/review/java/testing/jwebunit.spec
SRPM: https://raphgro.fedorapeople.org/review/java/testing/jwebunit-3.3-4.fc25.src.rpm

Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=16407426

%changelog
* Fri Nov 11 2016 Raphael Groner <> - 3.3-4
- drop unneeded explicit Requires
- add weak dependency to plugin
- simplify build of subpackages
- use available tempus-fugit
- disable plugin tests

Comment 15 Pavel Alexeev 2016-11-19 20:24:10 UTC
I'm not expert in java packaging but it seams good for me.

Package APPROVED.

Comment 16 Raphael Groner 2016-12-01 18:30:23 UTC
Thanks for the review! Sorry, I forgot about this request. Now waiting for the package approval in PkgDB.

Comment 17 Gwyn Ciesla 2016-12-01 22:54:53 UTC
Package request has been approved: https://admin.fedoraproject.org/pkgdb/package/rpms/jwebunit

Comment 18 Fedora Update System 2016-12-02 16:30:45 UTC
jwebunit-3.3-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cdb8675ab2

Comment 19 Fedora Update System 2016-12-03 04:37:50 UTC
jwebunit-3.3-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cdb8675ab2

Comment 20 Fedora Update System 2016-12-11 00:29:16 UTC
jwebunit-3.3-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.