---
title: "发现jbpm BusinessCalendar的bug"
author: "hongsoft"
date: "2006-02-28T20:45:00Z"
tags: []
slug: "jbpm-businesscalendar-bug"
draft: false
lastmod: "2006-02-28T20:45:00Z"
id: 287441
url: "https://hongsoft.iteye.com/blog/287441"
---

BusinessCalendar真的是非常有用，让我们对付 刁难的客户时不用那么

心惊胆颤了，但今天竟然发现一个BUG，开始以为是自己的问题，到后来不得不

转到junit:

public void testyhb() throws Exception {  

   Calendar calendar = BusinessCalendar.getCalendar();  
   calendar.set(Calendar.YEAR, 2005);  
   calendar.set(Calendar.MONTH, Calendar.APRIL);  
   calendar.set(Calendar.DAY\_OF\_MONTH, 4);  
   calendar.set(Calendar.HOUR\_OF\_DAY, 11);  
   calendar.set(Calendar.MINUTE, 35);  
   calendar.set(Calendar.SECOND, 0);  
   calendar.set(Calendar.MILLISECOND, 0);  
   Date date1 = calendar.getTime();  
   System.out.println(date1);

   Date date2 =  
   businessCalendar.add(date1, new Duration("2 business hours"));

   System.out.println(date2); 

   }

run了一把：

20:26:30,046 \[main] INFO  JbpmConfiguration : using jbpm configuration resource 'jbpm.cfg.xml'  
20:26:30,187 \[main] DEBUG JbpmConfiguration : creating jbpm configuration from input stream  
Mon Apr 04 11:35:00 CST 2005  
Tue Apr 05 10:35:00 CST 2005

差别是相-----当的大，看了看旁边的clover.jar，哎，clover也管不了这个呀。