01: /*
02: * SelectAnalyzerTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.completion;
13:
14: import junit.framework.*;
15: import java.util.ArrayList;
16: import java.util.Collections;
17: import java.util.LinkedList;
18: import java.util.List;
19: import java.util.regex.Pattern;
20: import workbench.db.TableIdentifier;
21: import workbench.db.WbConnection;
22: import workbench.log.LogMgr;
23: import workbench.resource.ResourceMgr;
24: import workbench.sql.formatter.SQLLexer;
25: import workbench.sql.formatter.SqlFormatter;
26: import workbench.sql.formatter.Token;
27: import workbench.util.SqlUtil;
28: import workbench.util.StringUtil;
29: import workbench.util.TableAlias;
30:
31: /**
32: *
33: * @author support@sql-workbench.net
34: */
35: public class SelectAnalyzerTest extends TestCase {
36:
37: public SelectAnalyzerTest(String testName) {
38: super (testName);
39: }
40:
41: protected void setUp() throws Exception {
42: }
43:
44: protected void tearDown() throws Exception {
45: }
46:
47: public void testAnalyzer() {
48: String sql = "SELECT a.att1\n ,a.\nFROM adam a";
49: SelectAnalyzer analyzer = new SelectAnalyzer(null, sql, 23);
50: String quali = analyzer.getQualifierLeftOfCursor();
51: assertEquals("Wrong qualifier detected", "a", quali);
52: }
53:
54: }
|