Bug 966293

Summary: Add validation for expression when creating Dynagroup Definition
Product: [Other] RHQ Project Reporter: Jirka Kremser <jkremser>
Component: CLI, Core ServerAssignee: Jirka Kremser <jkremser>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.8CC: fbrychta, hrupp
Target Milestone: ---   
Target Release: RHQ 4.9   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-24 19:08:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 880819    

Description Jirka Kremser 2013-05-23 00:05:07 UTC
Description of problem:
The current version lets user to create invalid definition of dynagroup and it firstly fails with the first recalculation call. The should be some mechanism for verifying the correctness of the expression defined by this [1] grammar.

[1] https://docs.jboss.org/author/display/RHQ/Group+Definitions#GroupDefinitions-EBNFGrammar


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

How reproducible:
always

Steps to Reproduce:
1. open a view for creating new dynagroup definition (url fragment #Inventory/Groups/DynagroupDefinitions/0)
2. type in some name
3. type in some invalid expression. You may want to use "rhq rocks!" for instance.
4. save it

Actual results:
it was saved

Expected results:
the exception with a clear message describing what is wrong should be thrown

Additional info:
The validation should be done also for the methods exposed via the CLI

Comment 1 Mike Foley 2013-07-02 15:13:43 UTC
moving out of JON 3.2 per 7/2/2013 meeting with loleary, heiko, foley, crouch

Comment 2 Jirka Kremser 2013-07-10 16:45:01 UTC
branch:  master
link:    http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=378301882
time:    2013-07-10 18:44:17 +0200
commit:  3783018826b0ebbe069751842cde15e75bc29bb2
author:  Jirka Kremser - jkremser
message: [BZ 966293] - Add validation for expression when creating Dynagroup
         Definition - adding a check to
         GroupDefinitionManagerBean.validate() method. Also making
         sure, the right message is correctly propagated to the web UI.

Comment 3 Filip Brychta 2013-08-29 09:58:04 UTC
Verified on 
Version: 4.9.0-SNAPSHOT
Build Number: e3e001b

for both the UI and CLI

Comment 4 Heiko W. Rupp 2013-09-24 19:08:56 UTC
Bulk closing of RHQ 4.9 verified items