import hiro.yoshioka.ast.sql.RowColumn;
import hiro.yoshioka.ast.sql.util.ASTAssist;
import hiro.yoshioka.ast.sql.util.ASTProposalableAssist;
import hiro.yoshioka.sql.resource.IDBResource;

public class AssistUpdateTester extends TestAbsAssistTester {

	// public void testDel00() {
	// read("testUpd00.txt");
	//
	// RowColumn row_col = new RowColumn(1, 8);
	// fUtil.setRowColumn(row_col);
	// ASTProposalableAssist assist = fUtil.getASTProposalableAssist();
	// System.out.println("----------------------------------------");
	// if (fUtil.wasParseSuccess()) {
	// fUtil.dump();
	// fUtil.dumpNodes();
	// } else {
	//
	// System.out.println("fatal  back word = " + fUtil.getBackWord());
	// }
	//
	// System.out.println("----------------------------------------");
	// assertEquals("Assist type is table？", ASTAssist.ASSIST_TABLE,
	// assist.getType());
	// IDBResource[] proposals = assist.proposalDBResources();
	// assertTrue("must have proposals", proposals.length > 0);
	// for (int i = 0; i < proposals.length; i++) {
	// System.out.println("[" + i + "]"
	// + proposals[i].getNameWithComment() + "/"
	// + proposals[i].getClass());
	// }
	// }

	public void testDel01() {
		read("testUpd01.txt");

		RowColumn row_col = new RowColumn(1, 9);
		fUtil.setRowColumn(row_col);
		ASTProposalableAssist assist = fUtil.getASTProposalableAssist();
		System.out.println("----------------------------------------");
		if (fUtil.wasParseSuccess()) {
			fUtil.dump();
			fUtil.dumpNodes();
		} else {

			System.out.println("fatal  back word = " + fUtil.getBackWord());
		}

		System.out.println("----------------------------------------");
		assertEquals("assist type is table？", ASTAssist.ASSIST_TABLE,
				assist.getType());
		IDBResource[] proposals = assist.proposalDBResources();
		assertTrue("must have proposals", proposals.length > 0);
		for (int i = 0; i < proposals.length; i++) {
			System.out.println("[" + i + "]"
					+ proposals[i].getNameWithComment() + "/"
					+ proposals[i].getClass());
		}
	}
}