<commit_before>package edu.duke.cabig.c3pr.utils.web.spring.tabbedflow;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.easymock.classextension.EasyMock;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.WebUtils;

import edu.duke.cabig.c3pr.AbstractTestCase;
import edu.duke.cabig.c3pr.domain.AbstractMutableDeletableDomainObject;

public class RowManagableTabTest extends AbstractTestCase{

    RowManagableTab rowManagableTab;
    HttpServletRequest request;
    CommandClass command;
    DomainObjectDummy domainObjectDummy;
    Errors errors;
    
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        rowManagableTab=new RowManagableTab(){};
        request=registerMockFor(HttpServletRequest.class);
        command=new CommandClass();
        command.list=new ArrayList();
        domainObjectDummy=new DomainObjectDummy();
        errors=registerMockFor(Errors.class);
        command.list.add(domainObjectDummy);
    }
    
    public void testDeleteRowByHashCodeSoftDelete() throws Exception{
        EasyMock.expect(request.getParameter(rowManagableTab.getCollectionParamName())).andReturn("list");
        EasyMock.expect(request.getParameter(rowManagableTab.getDeleteHashCodeParamName())).andReturn("HC#"+domainObjectDummy.hashCode());
        EasyMock.expect(request.getParameter(rowManagableTab.getSoftDeleteParamName())).andReturn("true");
        replayMocks();
        rowManagableTab.deleteRow(request, command, errors);
        assertEquals("true", domainObjectDummy.getRetiredIndicator());
        verifyMocks();
    }
    
    public void testDeleteRowByHashCode() throws Exception{
        EasyMock.expect(request.getParameter(rowManagableTab.getCollectionParamName())).andReturn("list");<commit_msg>test case fix<commit_after>package edu.duke.cabig.c3pr.utils.web.spring.tabbedflow;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.easymock.classextension.EasyMock;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.WebUtils;

import edu.duke.cabig.c3pr.AbstractTestCase;
import edu.duke.cabig.c3pr.domain.AbstractMutableDeletableDomainObject;

public class RowManagableTabTest extends AbstractTestCase{

    RowManagableTab rowManagableTab;
    HttpServletRequest request;
    CommandClass command;
    DomainObjectDummy domainObjectDummy;
    Errors errors;
    
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        rowManagableTab=new RowManagableTab(){};
        request=registerMockFor(HttpServletRequest.class);
        command=new CommandClass();
        command.list=new ArrayList();
        domainObjectDummy=new DomainObjectDummy();
        errors=registerMockFor(Errors.class);
        command.list.add(domainObjectDummy);
    }
    
    public void testDeleteRowByHashCodeSoftDelete() throws Exception{
        EasyMock.expect(request.getParameter(rowManagableTab.getCollectionParamName())).andReturn("list");
        EasyMock.expect(request.getParameter(rowManagableTab.getDeleteHashCodeParamName())).andReturn("HC#"+domainObjectDummy.hashCode());
        EasyMock.expect(request.getParameter(rowManagableTab.getSoftDeleteParamName())).andReturn("true");
        replayMocks();
        rowManagableTab.deleteRow(request, command, errors);
        assertEquals("dummy object not deleted", 0, command.list.size());
//        assertEquals("true", domainObjectDummy.getRetiredIndicator());
        verifyMocks();
    }
    
    public void testDeleteRowByHashCode() throws Exception{
        EasyMock.expect(request.getParameter(rowManagableTab.getCollectionParamName())).andReturn("list");
{'fraction_non_alphanumeric': 0.10125, 'fraction_numerical': 0.00175, 'mean_word_length': 4.773448773448774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6966912', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1126, 'n_words': 159}