Program: 177800
Project: 177800
Buggy source:
@SuppressWarnings("String_Node_Str") @UsesMocks({Comment.class,ProgressDialog.class,DialogFactory.class,CommentAdapter.class,List.class,View.class,SocializeHeader.class,LoadingListView.class,SocializeSession.class,Entity.class}) public void testPostCommentSuccess(){
  final String title="String_Node_Str";
  final String message="String_Node_Str";
  final int totalCount=69;
  final int startIndex=0;
  final int endIndex=10;
  final String commentString="String_Node_Str";
  boolean shareLocation=true;
  final Comment comment=AndroidMock.createMock(Comment.class);
  final ProgressDialog dialog=AndroidMock.createMock(ProgressDialog.class,getActivity());
  final DialogFactory<ProgressDialog> progressDialogFactory=AndroidMock.createMock(DialogFactory.class);
  final CommentAdapter commentAdapter=AndroidMock.createMock(CommentAdapter.class);
  final List<Comment> comments=AndroidMock.createMock(List.class);
  final View field=AndroidMock.createMock(View.class,getContext());
  final SocializeHeader header=AndroidMock.createMock(SocializeHeader.class,getContext());
  final LoadingListView content=AndroidMock.createMock(LoadingListView.class,getContext());
  final Entity entity=AndroidMock.createMock(Entity.class);
  final SocializeSession session=AndroidMock.createMock(SocializeSession.class);
  AndroidMock.expect(progressDialogFactory.show(getContext(),title,message)).andReturn(dialog);
  comment.setText(commentString);
  comment.setNotificationsEnabled(false);
  comment.setEntity(entity);
  AndroidMock.expect(comment.getText()).andReturn(commentString);
  AndroidMock.expect(commentAdapter.getComments()).andReturn(comments);
  AndroidMock.expect(commentAdapter.getTotalCount()).andReturn(totalCount).anyTimes();
  comments.add(0,comment);
  header.setText((totalCount) + "String_Node_Str");
  commentAdapter.setTotalCount((totalCount + 1));
  commentAdapter.notifyDataSetChanged();
  content.scrollToTop();
  dialog.dismiss();
  AndroidMock.replay(progressDialogFactory);
  AndroidMock.replay(commentAdapter);
  AndroidMock.replay(comment);
  AndroidMock.replay(comments);
  AndroidMock.replay(header);
  AndroidMock.replay(field);
  AndroidMock.replay(content);
  AndroidMock.replay(dialog);
  final PublicSocialize socialize=new PublicSocialize(){
    @Override public void addComment(    Activity activity,    Comment comment,    ShareOptions shareOptions,    CommentAddListener commentAddListener){
      assertEquals(commentString,comment.getText());
      commentAddListener.onCreate(comment);
    }
    @Override public boolean isAuthenticated(    AuthProviderType providerType){
      return providerType.equals(AuthProviderType.FACEBOOK);
    }
    @Override public boolean assertAuthenticated(    SocializeListener listener){
      return true;
    }
    @Override public boolean assertInitialized(    SocializeListener listener){
      return true;
    }
    @Override public Comment newComment(){
      return comment;
    }
  }
;
  PublicCommentListView view=new PublicCommentListView(getActivity()){
    @Override protected SocializeService getSocialize(){
      return socialize;
    }
    @Override public Comment newComment(){
      return comment;
    }
  }
;
  socialize.setSession(session);
  view.setCommentAdapter(commentAdapter);
  view.setProgressDialogFactory(progressDialogFactory);
  view.setHeader(header);
  view.setField(field);
  view.setContent(content);
  view.setStartIndex(startIndex);
  view.setEndIndex(endIndex);
  view.setEntity(entity);
  view.doPostComment(commentString,shareLocation,false,SocialNetwork.FACEBOOK);
  AndroidMock.verify(progressDialogFactory);
  AndroidMock.verify(commentAdapter);
  AndroidMock.verify(comment);
  AndroidMock.verify(comments);
  AndroidMock.verify(header);
  AndroidMock.verify(field);
  AndroidMock.verify(content);
  AndroidMock.verify(dialog);
  assertEquals(startIndex + 1,view.getStartIndex());
  assertEquals(endIndex + 1,view.getEndIndex());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @UsesMocks({Comment.class,ProgressDialog.class,DialogFactory.class,CommentAdapter.class,List.class,View.class,SocializeHeader.class,LoadingListView.class,SocializeSession.class,Entity.class}) public void testPostCommentSuccess(){
  final String title="String_Node_Str";
  final String message="String_Node_Str";
  final int totalCount=69;
  final int startIndex=0;
  final int endIndex=10;
  final String commentString="String_Node_Str";
  boolean shareLocation=true;
  final Comment comment=AndroidMock.createMock(Comment.class);
  final ProgressDialog dialog=AndroidMock.createMock(ProgressDialog.class,getActivity());
  final DialogFactory<ProgressDialog> progressDialogFactory=AndroidMock.createMock(DialogFactory.class);
  final CommentAdapter commentAdapter=AndroidMock.createMock(CommentAdapter.class);
  final List<Comment> comments=AndroidMock.createMock(List.class);
  final View field=AndroidMock.createMock(View.class,getContext());
  final SocializeHeader header=AndroidMock.createMock(SocializeHeader.class,getContext());
  final LoadingListView content=AndroidMock.createMock(LoadingListView.class,getContext());
  final Entity entity=AndroidMock.createMock(Entity.class);
  final SocializeSession session=AndroidMock.createMock(SocializeSession.class);
  AndroidMock.expect(progressDialogFactory.show(getContext(),title,message)).andReturn(dialog);
  comment.setText(commentString);
  comment.setNotificationsEnabled(false);
  comment.setEntity(entity);
  AndroidMock.expect(comment.getText()).andReturn(commentString);
  AndroidMock.expect(commentAdapter.getComments()).andReturn(comments);
  AndroidMock.expect(commentAdapter.getTotalCount()).andReturn(totalCount).anyTimes();
  comments.add(0,comment);
  header.setText((totalCount) + "String_Node_Str");
  commentAdapter.setTotalCount((totalCount + 1));
  commentAdapter.notifyDataSetChanged();
  content.scrollToTop();
  dialog.dismiss();
  AndroidMock.replay(progressDialogFactory);
  AndroidMock.replay(commentAdapter);
  AndroidMock.replay(comment);
  AndroidMock.replay(comments);
  AndroidMock.replay(header);
  AndroidMock.replay(field);
  AndroidMock.replay(content);
  AndroidMock.replay(dialog);
  final PublicSocialize socialize=new PublicSocialize(){
    @Override public void addComment(    Activity activity,    Comment comment,    ShareOptions shareOptions,    CommentAddListener commentAddListener){
      assertEquals(commentString,comment.getText());
      commentAddListener.onCreate(comment);
    }
    @Override public boolean isAuthenticated(    AuthProviderType providerType){
      return providerType.equals(AuthProviderType.FACEBOOK);
    }
    @Override public boolean assertAuthenticated(    SocializeListener listener){
      return true;
    }
    @Override public boolean assertInitialized(    Context context,    SocializeListener listener){
      return true;
    }
    @Override public Comment newComment(){
      return comment;
    }
  }
;
  PublicCommentListView view=new PublicCommentListView(getActivity()){
    @Override protected SocializeService getSocialize(){
      return socialize;
    }
    @Override public Comment newComment(){
      return comment;
    }
  }
;
  socialize.setSession(session);
  view.setCommentAdapter(commentAdapter);
  view.setProgressDialogFactory(progressDialogFactory);
  view.setHeader(header);
  view.setField(field);
  view.setContent(content);
  view.setStartIndex(startIndex);
  view.setEndIndex(endIndex);
  view.setEntity(entity);
  view.doPostComment(commentString,shareLocation,false,SocialNetwork.FACEBOOK);
  AndroidMock.verify(progressDialogFactory);
  AndroidMock.verify(commentAdapter);
  AndroidMock.verify(comment);
  AndroidMock.verify(comments);
  AndroidMock.verify(header);
  AndroidMock.verify(field);
  AndroidMock.verify(content);
  AndroidMock.verify(dialog);
  assertEquals(startIndex + 1,view.getStartIndex());
  assertEquals(endIndex + 1,view.getEndIndex());
}