Red Hat Bugzilla – Bug 786795
Bundling testng.jar (almost) unnecessary
Last modified: 2013-09-01 06:19:03 EDT
Description of problem:
We bundle the testng.jar with the CLI, while this is almost completely unnecessary.
We only use the Assert class from the testng.jar to provide the assertion functions inside the CLI environment. While this is a good thing to provide, bundling 500K worth of a jar seems to me like a bit of an overkill.
It would be easier to just copy the class over (how do we handle the Apache 2.0 vs. GPL license clash here?) or outright reimplement the methods without using testng.
Steps to Reproduce:
1. Install CLI
2. Look in the $CLI_HOME/lib directory.
testng-6.1.1.jar present as a hard compile and runtime dependency
We should not depend on a 500K jar because of something as simple as assertion class.
per bz triage (asantos, ccrouch, mfoley. loleary)
This has been implemented for the benefit of bug 796405 (even though that bug is server-side and this bug affects both the standalone CLI and the serverside scripting).
The commit contains a number of unit tests that make sure that the assert* methods work inside CLI. The tests run the script engine in the same way as the standalone CLI does - the standalone CLI only provides the commandline interface for the script engine and adds interactive features to it.
There are 2 things QE might want to test:
1) make sure testng.jar is not present in the standalone CLI deployment:
find $RHQ_CLI_HOME -name '*testng*'
This should find no files.
2) create a test script excercising the various assert* methods and run it in the CLI. You can take inspiration in the unit test http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=blob;f=modules/enterprise/binding/src/test/java/org/rhq/bindings/util/ScriptAssertTest.java
Author: Lukas Krejci <email@example.com>
Date: Thu Feb 23 13:10:39 2012 +0100
[BZ 786795] - rewritten the ScriptAssert class to not depend on TestNG (and
added a bunch of unit tests). Removed the testng runtime dependency and
removed testng from the CLI deployment.
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.