Package com.mysema.query

Source Code of com.mysema.query.SkipForQuotedRule

package com.mysema.query;

import org.junit.rules.MethodRule;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;

import com.mysema.query.sql.SQLTemplates;
import com.mysema.testutil.EmptyStatement;

public class SkipForQuotedRule implements MethodRule {

    @Override
    public Statement apply(Statement base, FrameworkMethod method, Object target) {
        SQLTemplates templates = Connections.getTemplates();
        if (templates.isUseQuotes() || templates.isPrintSchema()) {
            boolean run = method.getMethod().getAnnotation(SkipForQuoted.class) == null;
            return run ? base :  EmptyStatement.DEFAULT;
        } else {
            return base;
        }
    }

}
TOP

Related Classes of com.mysema.query.SkipForQuotedRule

TOP
Copyright © 2018 www.massapi.com. 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.