Bug 757958 - Fix errors in drift.js sample CLI script
Summary: Fix errors in drift.js sample CLI script
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI
Version: JON 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER05
: JON 3.2.0
Assignee: John Sanda
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: jon30-sprint9
Blocks: 707225
TreeView+ depends on / blocked
 
Reported: 2011-11-29 04:19 UTC by John Sanda
Modified: 2014-01-02 20:34 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-01-02 20:34:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Sanda 2011-11-29 04:19:16 UTC
Description of problem:
The drift.js script that is packaged in the samples directory of the CLI distro uses classes and methods that have gone through several iterations of renaming after the script was initially written. There are several errors in the script consequently. The script needs to be updated to use the current drift APIs.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 John Sanda 2011-11-29 16:08:57 UTC
The script has been updated along with documented usage.

master commit hash:         cc717fc0ac9b891306738842910b026d3a485085
release_jon3.x commit hash: 6347cab2a33758186d8751d78633cfb9965b2f85

Comment 2 Mike Foley 2011-11-29 16:45:20 UTC
sample script ... no impact on runtime.  lowering the priority.

Comment 3 Mike Foley 2011-12-19 20:04:09 UTC
tested as follows:

used the inline usage example in drift.js 


 * usage:
 *   // generates a snapshot that includes all change sets belonging to the
 *   // mydrift drift configuration.
 *   createSnapshot(123, 'mydrift') 
 *


----------

actual results ...


rhqadmin@localhost:7080$ exec -f util.js 

rhqadmin@localhost:7080$ exec -f drift.js

rhqadmin@localhost:7080$ createSnapshot(123, 'mydrift1') 
Wrapped java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 (<Unknown source>#71)
createSnapshot(123, 'mydrift1') 
^

rhqadmin@localhost:7080$ createSnapshot(123, 'drift1')  
Wrapped java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 (<Unknown source>#71)
createSnapshot(123, 'drift1') 
^



jsanda ... advice?  is this the expected behavior?

Comment 4 John Sanda 2011-12-20 19:41:42 UTC
Mike, the example in the source docs is just that. Do you have a drift definition named mydrift1? If not then the errors may in fact be expected.

Comment 5 Larry O'Leary 2012-11-28 00:10:44 UTC
Setting back to ON_QA and re-targeting for JBoss ON 3.2 release for verification.

Comment 6 Larry O'Leary 2013-09-06 14:31:14 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.

Comment 7 Simeon Pinder 2013-09-20 13:30:13 UTC
I think this was moved to ON_QA in error. My apologies. Moving back to ASSIGNED state and into ER02.

Comment 8 Simeon Pinder 2013-09-30 13:37:04 UTC
Moving into ER3 as didn't make it into ER2.

Comment 9 Simeon Pinder 2013-10-08 07:52:55 UTC
Moving into ER04 as not completed in ER03.

Comment 10 Simeon Pinder 2013-10-24 04:16:32 UTC
Moving to ER05 as missed the cutoff for ER04.

Comment 11 John Sanda 2013-10-25 16:58:44 UTC
I have gone ahead and made some minor updates in the examples listed in the source code docs. The problem in comment 3 is due to the fact that the function was called using the example verbatim. Since the function takes as input a resource id and a drift definition name, I think (and hope) it is fairly obvious that the function arguments in the example are just that - examples and not actual values.

release/jon3.2.x commit hash: 05715a631

Comment 12 Simeon Pinder 2013-11-07 02:18:13 UTC
Moving to ON_QA for test with new brew build.

Comment 13 Filip Brychta 2013-12-09 12:13:28 UTC
Covered by automation and passing .. http://jenkins.jonqe.lab.eng.bos.redhat.com:9080/view/Core%20tests/job/rhq-core-cli-js-test/276/HTML_Report/?


Note You need to log in before you can comment on or make changes to this bug.