Program: 126855
Project: 126855
Buggy source:
/** 
 * test fill columns for method "fillColumns(ColumnSet colSet, DatabaseMetaData dbJDBCMetadata, List<String> columnFilter, String columnPattern)"
 * @throws SQLException
 */
@Test public void testFillColumns_1() throws SQLException {
  ColumnSet columnSet=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createColumnSet();
  columnSet.setName("String_Node_Str");
  DatabaseMetaData dbJDBCMetadata=mock(DatabaseMetaData.class);
  List<String> columnFilter=new ArrayList<String>();
  Schema schema=mock(Schema.class);
  when(schema.getName()).thenReturn("String_Node_Str");
  PowerMockito.mockStatic(CatalogHelper.class);
  when(CatalogHelper.getParentCatalog(columnSet)).thenReturn(null);
  PowerMockito.mockStatic(SchemaHelper.class);
  when(SchemaHelper.getParentSchema(columnSet)).thenReturn(schema);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  ResultSet rs=mock(ResultSet.class);
  when(rs.next()).thenReturn(true).thenReturn(true).thenReturn(false);
  when(rs.getString(GetColumn.COLUMN_NAME.name())).thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.TYPE_NAME.name())).thenReturn("String_Node_Str");
  when(rs.getInt(GetColumn.NULLABLE.name())).thenReturn(0);
  when(rs.getInt(GetColumn.DATA_TYPE.name())).thenReturn(1);
  when(rs.getString(GetColumn.REMARKS.name())).thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.IS_NULLABLE.name())).thenReturn("String_Node_Str");
  when(dbJDBCMetadata.getColumns(anyString(),anyString(),anyString(),anyString())).thenReturn(rs);
  dbConnection.setDbmsId(null);
  PowerMockito.mockStatic(ConnectionHelper.class);
  when(ConnectionHelper.getConnection(columnSet)).thenReturn(dbConnection);
  stub(method(MetadataToolHelper.class,"String_Node_Str",String.class)).toReturn("String_Node_Str");
  PowerMockito.mockStatic(ColumnSetHelper.class);
  stub(method(ColumnSetHelper.class,"String_Node_Str")).toReturn(true);
  List<TdColumn> fillColumns=dBConnectionFillerImpl.fillColumns(columnSet,dbJDBCMetadata,columnFilter,null);
  assertNotNull(fillColumns);
  assertTrue(fillColumns.size() == 2);
}

Fixed version (ground truth):
/** 
 * test fill columns for method "fillColumns(ColumnSet colSet, DatabaseMetaData dbJDBCMetadata, List<String> columnFilter, String columnPattern)"
 * @throws SQLException
 */
@Test public void testFillColumns_1() throws SQLException {
  ColumnSet columnSet=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createColumnSet();
  columnSet.setName("String_Node_Str");
  DatabaseMetaData dbJDBCMetadata=mock(DatabaseMetaData.class);
  List<String> columnFilter=new ArrayList<String>();
  Schema schema=mock(Schema.class);
  when(schema.getName()).thenReturn("String_Node_Str");
  PowerMockito.mockStatic(CatalogHelper.class);
  when(CatalogHelper.getParentCatalog(columnSet)).thenReturn(null);
  PowerMockito.mockStatic(SchemaHelper.class);
  when(SchemaHelper.getParentSchema(columnSet)).thenReturn(schema);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(true);
  ResultSet rs=mock(ResultSet.class);
  when(rs.next()).thenReturn(true).thenReturn(true).thenReturn(false);
  when(rs.getString(GetColumn.COLUMN_NAME.name())).thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.TYPE_NAME.name())).thenReturn("String_Node_Str");
  when(rs.getInt(GetColumn.NULLABLE.name())).thenReturn(0);
  when(rs.getInt(GetColumn.DATA_TYPE.name())).thenReturn(1);
  when(rs.getString(GetColumn.REMARKS.name())).thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.IS_NULLABLE.name())).thenReturn("String_Node_Str");
  when(dbJDBCMetadata.getColumns(anyString(),anyString(),anyString(),anyString())).thenReturn(rs);
  dbConnection.setDbmsId(null);
  PowerMockito.mockStatic(ConnectionHelper.class);
  when(ConnectionHelper.getConnection(columnSet)).thenReturn(dbConnection);
  stub(method(MetadataToolHelper.class,"String_Node_Str",String.class)).toReturn("String_Node_Str");
  PowerMockito.mockStatic(ColumnSetHelper.class);
  stub(method(ColumnSetHelper.class,"String_Node_Str")).toReturn(true);
  List<TdColumn> fillColumns=dBConnectionFillerImpl.fillColumns(columnSet,dbJDBCMetadata,columnFilter,null);
  assertNotNull(fillColumns);
  assertTrue(fillColumns.size() == 2);
}