File path: /sql12/test/src/net/sourceforge/squirrel_sql/fw/sql/DatabaseObjectInfoTest.java | File path: /sql12/test/src/net/sourceforge/squirrel_sql/fw/sql/DatabaseObjectInfoTest.java | |||
Method name: void testGetQualifiedNameSybase12()
|
Method name: void testGetQualifiedNameSybase15()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | String tableName = "mytable";↵ | 1 | String tableName = "mytable";↵ | |
2 | final ISQLDatabaseMetaData md = sybase12SQLDatabaseMeta;↵ | 2 | final ISQLDatabaseMetaData md = sybase15SQLDatabaseMeta;↵ | |
3 | assertEquals("Adaptive Server Enterprise", md.getDatabaseProductName());↵ | 3 | assertEquals("Adaptive Server Enterprise", md.getDatabaseProductName());↵ | |
4 | dboInfoUnderTest = ↵ | 4 | dboInfoUnderTest = ↵ | |
5 | new DatabaseObjectInfo(testCatalog, testSchema, tableName, ↵ | 5 | new DatabaseObjectInfo(testCatalog, testSchema, tableName, ↵ | |
6 | DatabaseObjectType.TABLE, md);↵ | 6 | DatabaseObjectType.TABLE, md);↵ | |
7 | String identifierQuoteString = md.getIdentifierQuoteString();↵ | 7 | String identifierQuoteString = md.getIdentifierQuoteString();↵ | |
8 | ↵ | 8 | ↵ | |
9 | // Sybase 12.5 doesn't support quotation marks for identifiers, yet ↵ | 9 | // Sybase 15 fully supports quotation marks for identifiers, and ↵ | |
10 | // reports " as the identifier quote string - go figure!↵ | 10 | // reports " as the identifier quote string - yeah, they got it right!↵ | |
11 | assertEquals("\"", identifierQuoteString);↵ | 11 | assertEquals("\"", identifierQuoteString);↵ | |
12 | ↵ | 12 | ↵ | |
13 | String sep = md.getCatalogSeparator();↵ | 13 | String sep = md.getCatalogSeparator();↵ | |
14 | ↵ | 14 | ↵ | |
15 | String expected = testCatalog + sep + testSchema + sep + tableName↵ | 15 | // Since catalog, schema and table are all identifiers, they all need ↵ | |
16 | // to be quoted.↵ | |||
17 | String expected = identifierQuoteString + testCatalog + identifierQuoteString + sep + ↵ | |||
18 | identifierQuoteString + testSchema + identifierQuoteString + sep + ↵ | |||
16 | ;↵ | 19 | identifierQuoteString + tableName + identifierQuoteString;↵ | |
17 | String actual = dboInfoUnderTest.getQualifiedName();↵ | 20 | String actual = dboInfoUnderTest.getQualifiedName();↵ | |
18 | assertEquals(expected, actual); | 21 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 82 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String tableName = "mytable"; | 1 | String tableName = "mytable"; | |||||||||||||||||||||
2 | final ISQLDatabaseMetaData md = sybase12SQLDatabaseMeta; |
| 2 | final ISQLDatabaseMetaData md = sybase15SQLDatabaseMeta; | ||||||||||||||||||||
3 | assertEquals("Adaptive Server Enterprise", md.getDatabaseProductName()); | 3 | assertEquals("Adaptive Server Enterprise", md.getDatabaseProductName()); | |||||||||||||||||||||
4 | dboInfoUnderTest = new DatabaseObjectInfo(testCatalog, testSchema, tableName, DatabaseObjectType.TABLE, md); | 4 | dboInfoUnderTest = new DatabaseObjectInfo(testCatalog, testSchema, tableName, DatabaseObjectType.TABLE, md); | |||||||||||||||||||||
5 | String identifierQuoteString = md.getIdentifierQuoteString(); | 5 | String identifierQuoteString = md.getIdentifierQuoteString(); | |||||||||||||||||||||
6 | assertEquals("\"", identifierQuoteString); | 6 | assertEquals("\"", identifierQuoteString); | |||||||||||||||||||||
7 | String sep = md.getCatalogSeparator(); | 7 | String sep = md.getCatalogSeparator(); | |||||||||||||||||||||
8 | String expected = testCatalog + sep + testSchema + sep + tableName; |
| 8 | String expected = identifierQuoteString + testCatalog + identifierQuoteString + sep + identifierQuoteString + testSchema + identifierQuoteString + sep + identifierQuoteString + tableName + identifierQuoteString; | ||||||||||||||||||||
9 | String actual = dboInfoUnderTest.getQualifiedName(); | 9 | String actual = dboInfoUnderTest.getQualifiedName(); | |||||||||||||||||||||
10 | assertEquals(expected, actual); | 10 | assertEquals(expected, actual); |
Row | Violation |
---|---|
1 | Expression identifierQuoteString cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression sep cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression testCatalog + sep + testSchema+ sep+ tableName cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression identifierQuoteString + testCatalog + identifierQuoteString+ sep+ identifierQuoteString+ testSchema+ identifierQuoteString+ sep+ identifierQuoteString+ tableName+ identifierQuoteString cannot be parameterized, because it has dependencies to/from statements that will be extracted |