querydsl/querydsl-sql/src/test/java/com/mysema/query/SkipForQuotedRule.java
2012-07-13 12:21:05 +03:00

24 lines
729 B
Java

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;
}
}
}