Instances of this class match all values for the given variable against the specified regular expression.
6263646566676869707172
@Test public void testMatches() { try { AuditEventRule rule = new AuditEventRule(); rule.add(new ConditionRX("SEVERITY", "^4$")); boolean matches = rule.matches(event, null); log.info(" rule matches??: " + matches); } catch (Exception e) {
@Test public void testMatches() { try { AuditEventRule rule = new AuditEventRule(); rule.add( new ConditionRX( "SEVERITY", "^4$" ) ); boolean matches = rule.matches( event, null ); log.info( " rule matches??: " + matches ); } catch (Exception e) {
171172173174175176177178179180181182
{ try { log.info( "Testing SEVERITY @rx ^\\d$" ); String val = event.get( "SEVERITY" ); log.info( " event.get('SEVERITY') = " + val ); Condition c = new ConditionRX( "SEVERITY", "^\\d$" ); if( ! c.matches( event ) ) fail( "Failed to match ConditionRX on SEVERITY with value '^\\d$' !" ); } catch (Exception e) { fail( "Error: " + e.getMessage() ); } }