Package org.jboss.byteman.check

Examples of org.jboss.byteman.check.RuleCheckResult


                getLog().debug("add package " + packages[i]);
            }
        }
        getLog().info("Checking " + scripts.size() + " byteman scripts in " + scriptDir);
        checker.checkRules();
        RuleCheckResult result= checker.getResult();
        if(result.hasWarning()) {
            List<String> warns = result.getWarningMessages();
            warns.addAll(result.getTypeWarningMessages());
            for(String warn : warns) {
                getLog().warn(warn);
            }
            int totalWarnCount = warns.size();
            if(failOnWarning && expectWarnings != totalWarnCount) {
                throw new MojoExecutionException("check byteman script rules failed with " + totalWarnCount +
                        " warnings. You may config failOnWarning with false or expectWarnings with " + totalWarnCount);
            }
        }
        if(result.hasError()) {
            int totalErrorCount = result.getErrorCount() + result.getParseErrorCount() + result.getTypeErrorCount();
            getLog().error("Checking byteman script rules failed with " + totalErrorCount + " errors");
            List<String> errors = result.getErrorMessages();
            errors.addAll(result.getParseErrorMessages());
            errors.addAll(result.getTypeErrorMessages());
            for(String error : errors) {
                getLog().error(error);
            }
            if(failOnError) {
                throw new MojoExecutionException("check byteman script rules failed with " + totalErrorCount + " errors");
View Full Code Here


        checker.addPackage("org.jboss.byteman.tests.auxiliary");
        checker.addPackage("org.jboss.byteman.tests.bugfixes");
        checker.addPackage("org.jboss.byteman.tests.javaops");
        checker.addPackage("org.jboss.byteman.tests.helpertests");
        checker.checkRules();
        RuleCheckResult result= checker.getResult();
        if(result.hasError() || result.hasWarning()) {
            List<String> errors = result.getErrorMessages();
            for(String error : errors) {
                System.out.println(error);
            }
            errors = result.getParseErrorMessages();
            for(String error : errors) {
                System.out.println(error);
            }
            errors = result.getTypeErrorMessages();
            for(String error : errors) {
                System.out.println(error);
            }
            errors = result.getWarningMessages();
            for(String error : errors) {
                System.out.println(error);
            }
            errors = result.getTypeWarningMessages();
            for(String error : errors) {
                System.out.println(error);
            }
        }
        assertTrue(!result.hasError());
    }
View Full Code Here

TOP

Related Classes of org.jboss.byteman.check.RuleCheckResult

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.