Package org.apache.sirona.configuration.predicate

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator


    void init(final @Observes BeforeBeanDiscovery beforeBeanDiscovery) {
        if (!enabled) {
            return;
        }

        performaceEvaluator = new PredicateEvaluator(Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "cdi.performance", null), ",");
        jtaEvaluator = new PredicateEvaluator(Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "cdi.jta", null), ",");
    }
View Full Code Here


                && !disabled;
    }

    // @AutoSet
    public void setIncludes(final String includes) {
        this.includes = new PredicateEvaluator(includes, ",");
    }
View Full Code Here

        this.includes = new PredicateEvaluator(includes, ",");
    }

    // @AutoSet
    public void setExcludes(final String excludes) {
        this.excludes = new PredicateEvaluator(excludes, ",");
    }
View Full Code Here

        return includes.matches(name) && !excludes.matches(name);
    }

    // @AutoSet should be added to children
    public void setIncludes(final String includes) {
        this.includes = new PredicateEvaluator(includes, ",");
    }
View Full Code Here

        this.includes = new PredicateEvaluator(includes, ",");
    }

    // @AutoSet should be added to children
    public void setExcludes(final String excludes) {
        this.excludes = new PredicateEvaluator(excludes, ",");
    }
View Full Code Here

import static org.junit.Assert.assertTrue;

public class PredicateTest {
    @Test
    public void evaluate() {
        final PredicateEvaluator evaluator = new PredicateEvaluator(
            "regex:.+Foo," +
            "regex:Bar.*," +
            "regex:[0-9]+," +
            "prefix:asf," +
            "prefix:sirona," +
            "prefix:!excluded," +
            "suffix:tiger," +
            "suffix:Cat", ",");

        assertTrue(evaluator.matches("AnythingFoo"));
        assertFalse(evaluator.matches("Foo"));
        assertTrue(evaluator.matches("Bar"));
        assertTrue(evaluator.matches("Barcedc"));
        assertFalse(evaluator.matches("azdphdBar"));
        assertFalse(evaluator.matches("fooasf"));
        assertTrue(evaluator.matches("asf"));
        assertFalse(evaluator.matches("excluded"));
        assertTrue(evaluator.matches("asfcdc"));
        assertTrue(evaluator.matches("sironaaaaaaa"));
        assertTrue(evaluator.matches("TomEE the tiger"));
        assertFalse(evaluator.matches("cat"));
        assertTrue(evaluator.matches("Cat"));
        assertTrue(evaluator.matches("1283"));
        assertTrue(evaluator.matches("Ends with Cat"));
    }
View Full Code Here

        private SironaTransformer(final String agentArgs) {
            final String includeStr = "includes=";
            if (agentArgs != null && agentArgs.contains(includeStr)) {
                final int start = agentArgs.indexOf(includeStr) + includeStr.length();
                evaluator = new PredicateEvaluator(agentArgs.substring(start, Math.max(agentArgs.length(), agentArgs.indexOf('|', start))), ",");
            } else {
                evaluator = new PredicateEvaluator("regex:.*", ",");
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.sirona.configuration.predicate.PredicateEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.