Bug 786795

Summary: Bundling testng.jar (almost) unnecessary
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.3CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 10:19:03 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 Lukas Krejci 2012-02-02 11:57:09 UTC
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.

How reproducible:
always

Steps to Reproduce:
1. Install CLI
2. Look in the $CLI_HOME/lib directory.
  
Actual results:
testng-6.1.1.jar present as a hard compile and runtime dependency

Expected results:
We should not depend on a 500K jar because of something as simple as assertion class.

Additional info:

Comment 1 Mike Foley 2012-02-06 17:02:36 UTC
per bz triage (asantos, ccrouch, mfoley. loleary)

Comment 2 Lukas Krejci 2012-02-23 13:06:41 UTC
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

master http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=4b1400bfbccef58edceb6e76ae46aeec19e36bdd
Author: Lukas Krejci <lkrejci>
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.

Comment 3 Heiko W. Rupp 2013-09-01 10:19:03 UTC
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.