⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testtimesheetamountprocessing.java

📁 一个很好的开源项目管理系统源代码
💻 JAVA
字号:
package net.java.workeffort.service.batch;import java.math.BigDecimal;import java.util.ArrayList;import java.util.List;import junit.framework.Test;import junit.framework.TestSuite;import net.java.workeffort.data.DataFileUtil;import net.java.workeffort.service.BaseServiceTestCase;import net.java.workeffort.service.ITimesheetService;import net.java.workeffort.service.ServiceTestSetup;import net.java.workeffort.service.domain.Timesheet;import net.java.workeffort.service.domain.TimesheetQuery;import net.java.workeffort.service.support.TimesheetUtils;/** * Testing the timesheet batch program */public class TestTimesheetAmountProcessing extends BaseServiceTestCase {    private ITimesheetAmountProcessing timesheetBatch;    private TimesheetUtils timesheetUtils;    private ITimesheetService timesheetService;    public static Test suite() {        TestSuite suite = new TestSuite();        suite.addTestSuite(TestTimesheetAmountProcessing.class);        List list = new ArrayList();        list.add(DataFileUtil.TIMESHEET_AMOUNT_PROCESSING);        return new ServiceTestSetup(suite, list);    }    protected void setUp() throws Exception {        super.setUp();        timesheetBatch = (ITimesheetAmountProcessing) ServiceTestSetup                .getApplicationContext().getBean("timesheetAmountProcessing");        timesheetUtils = (TimesheetUtils) ServiceTestSetup                .getApplicationContext().getBean("timesheetUtils");        timesheetService = (ITimesheetService) ServiceTestSetup                .getApplicationContext().getBean("timesheetService");    }    public void testProcessAmounts() throws Exception {        timesheetBatch.processAmounts(timesheetUtils.convertStringToDate(                "20050606", "yyyyMMdd"));        TimesheetQuery query = new TimesheetQuery();        query.setTimesheetId(new Long(5001));        Timesheet timesheet = timesheetService.getTimesheetManagement(query);        assertTrue(timesheet.getTotalAmt().compareTo(new BigDecimal("840.00")) == 0);        assertEquals("USD", timesheet.getTotalAmtCur());        assertNotNull(timesheet.getBatchJobId());        assertNotNull(timesheet.getProcessedFlg());        assertNotNull(timesheet.getProcessedTs());        query.setTimesheetId(new Long(5002));        timesheet = timesheetService.getTimesheetManagement(query);        assertTrue(timesheet.getTotalAmt().compareTo(new BigDecimal("120.00"))==0);        assertEquals("USD", timesheet.getTotalAmtCur());        assertNotNull(timesheet.getBatchJobId());        assertNotNull(timesheet.getProcessedFlg());        assertNotNull(timesheet.getProcessedTs());            }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -