import hiro.yoshioka.ast.sql.RowColumn;
import hiro.yoshioka.ast.sql.util.ASTAssist;

public class TestAssistKeyTester extends TestAbsAssistTester {
	public void test00() {
		read("test00.txt");

		fUtil.setRowColumn(new RowColumn(14, 1));
		ASTAssist assist = fUtil.getASTAssist();
		System.out.println(assist);
		System.out.println("----------------------------------------test00");
		// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD,
		// assist.getType());
		String[] keys = assist.getKeyWords();
		for (String key : keys) {
			System.out.println("kekka[" + key + "]");
		}
		checkkey(new String[] { "OR", "AND", "GROUP BY", "ORDER BY" }, keys);
	}
	//
	// public void test01() {
	// read("test01.txt");
	// fUtil.setRowColumn(new RowColumn(14, 2));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test01");
	// // fUtil.dump();
	// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD, assist.getType());
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[] { "ORDER BY", "OR" }, keys);
	// }
	//
	// public void test02() {
	// read("test02.txt");
	// fUtil.setRowColumn(new RowColumn(5, 4));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test02");
	// assertEquals("key group by", assist.getType(),
	// ASTAssist.ASSIST_KEY_WORD);
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[] { "GROUP BY" }, keys);
	// }
	//
	// public void test03() {
	// read("test03.txt");
	// fUtil.setRowColumn(new RowColumn(10, 2));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test03");
	// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD, assist.getType());
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[] { "OR", "AND", "GROUP BY", "ORDER BY" }, keys);
	// }
	//
	// public void test04() {
	// read("test04.txt");
	// fUtil.setRowColumn(new RowColumn(10, 7));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test04");
	// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD, assist.getType());
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[]{"BY"},keys);
	// }
	// public void test05() {
	// read("test05.txt");
	// fUtil.setRowColumn(new RowColumn(1, 1));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test05");
	// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD, assist.getType());
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[] { "SELECT", "UPDATE", "DELETE", "ALTER", "CREATE",
	// "EXPLAIN" }, keys);
	// }

	/*
	 * 対応は難しい　保留
	 */
	// public void test06() {
	// read("test06.txt");
	// fUtil.setRowColumn(new RowColumn(9,16));
	// ASTAssist assist = fUtil.getASTAssist();
	// System.out.println(assist);
	// System.out.println("----------------------------------------test05");
	// assertEquals("キーワードアシスト", ASTAssist.ASSIST_KEY_WORD, assist.getType());
	// String[] keys = assist.getKeyWords();
	// checkkey(new String[] { "=" }, keys);
	// }
}