Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2011 Terracotta, Inc. Copyright 2011 Oracle, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package javax.cache.util;
For the TCK we need to have an exclude list of bad tests so that disabling tests can be done without changing code. This class creates a rule for the class provided The exclude list is created by ExcludeList by creating a file in the root of your classpath called "ExcludeList". There is an example in the testRI module for testing the RI.

Author(s):
Yannis Cosmadopoulos
Since:
1.0
public abstract class AbstractTestExcluder implements MethodRule {
    private final Logger logger = Logger.getLogger(getClass().getName());

    
    public Statement apply(Statement statementFrameworkMethod frameworkMethodObject o) {
        final String methodName = frameworkMethod.getName();
        final String className = frameworkMethod.getMethod().getDeclaringClass().getName();
        if (isExcluded(methodName)) {
            return new ExcludedStatement(classNamemethodName);
        } else {
            return statement;
        }
    }
    protected abstract boolean isExcluded(String methodName);
    protected Logger getLogger() {
        return ;
    }

    
Statement for excluded methods
    private static final class ExcludedStatement extends Statement {
        private final String methodName;
        private final String className;
        private final Logger logger;
        private ExcludedStatement(String classNameString methodNameLogger logger) {
            this. = className;
            this. = methodName;
            this. = logger;
        }
        @Override
        public void evaluate() throws Throwable {
            .info("===== EXCLUDING TEST '" +  + "'\t'" +  + "'.");
        }
    }
New to GrepCode? Check out our FAQ X