expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME); expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME); expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME); expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME); mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class)); // Should at least bind the tablename to a bind var in the SQL expectLastCall().atLeastOnce(); mockHelper.replayAll(); classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo); mockHelper.verifyAll();
expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME); expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME); expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME); expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME); mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class)); // Should at least bind the tablename to a bind var in the SQL expectLastCall().atLeastOnce(); mockHelper.replayAll(); classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo); mockHelper.verifyAll();
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/expanders/AbstractTableIndexExtractorTest.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/expanders/AbstractTableTriggerExtractorTest.java
Method name: void testBindParamters() Method name: void testBindParamters()
Number of AST nodes: 9 Number of AST nodes: 9
1
expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME);
1
expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME);
2
		expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME);
2
		expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME);
3
		expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME);
3
		expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME);
4
		expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME);
4
		expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME);
5
		
5
		
6
		mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class));
6
		mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class));
7
		// Should at least bind the tablename to a bind var in the SQL
7
		// Should at least bind the tablename to a bind var in the SQL
8
		expectLastCall().atLeastOnce();
8
		expectLastCall().atLeastOnce();
9
		
9
		
10
		mockHelper.replayAll();
10
		mockHelper.replayAll();
11
		classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
11
		classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
12
		mockHelper.verifyAll();
12
		mockHelper.verifyAll();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons81
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME);
    1
    expect(mockDatabaseObjectInfo.getSchemaName()).andStubReturn(TEST_SCHEMA_NAME);
    2
    expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME);
    2
    expect(mockDatabaseObjectInfo.getCatalogName()).andStubReturn(TEST_CATALOG_NAME);
    3
    expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME);
    3
    expect(mockDatabaseObjectInfo.getSimpleName()).andStubReturn(TEST_SIMPLE_NAME);
    4
    expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME);
    4
    expect(mockDatabaseObjectInfo.getQualifiedName()).andStubReturn(TEST_QUALIFIED_NAME);
    5
    mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class));
    5
    mockPreparedStatement.setString(anyInt(), EasyMock.isA(String.class));
    6
    expectLastCall().atLeastOnce();
    6
    expectLastCall().atLeastOnce();
    7
    mockHelper.replayAll();
    7
    mockHelper.replayAll();
    8
    classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
    8
    classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
    8
    classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractornet.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableTriggerExtractorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor of variable classUnderTest does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableTriggerExtractor of variable classUnderTest
    • Make classes net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableTriggerExtractor extend a common superclass
    8
    classUnderTest.bindParamters(mockPreparedStatement, mockDatabaseObjectInfo);
    9
    mockHelper.verifyAll();
    9
    mockHelper.verifyAll();
    Precondition Violations (1)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor of variable classUnderTest does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableTriggerExtractor of variable classUnderTest