/**
* Copyright 2011-2013 FoundationDB, LLC
*
* 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 com.foundationdb.sql.compiler;
import com.foundationdb.sql.TestBase;
import com.foundationdb.sql.parser.StatementNode;
import com.foundationdb.sql.parser.SQLParser;
import com.foundationdb.sql.unparser.NodeToString;
import org.junit.Before;
import org.junit.Ignore;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
@Ignore
public class ASTTransformTestBase extends TestBase
{
protected ASTTransformTestBase(String caseName, String sql,
String expected, String error) {
super(caseName, sql, expected, error);
}
public static final File RESOURCE_DIR =
new File("src/test/resources/"
+ ASTTransformTestBase.class.getPackage().getName().replace('.', '/'));
protected SQLParser parser;
protected NodeToString unparser;
@Before
public void makeTransformers() throws Exception {
parser = new SQLParser();
unparser = new NodeToString();
}
protected String getTree(StatementNode stmt) throws IOException {
StringWriter str = new StringWriter();
stmt.treePrint(str);
return str.toString().trim();
}
}