Skip to content

Commit

Permalink
Fixed test-date parsing for JSK6
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikheremans committed Mar 21, 2014
1 parent bcb283d commit e9885c1
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@

package org.activiti.standalone.calendar;

import org.activiti.engine.impl.calendar.DurationHelper;
import org.activiti.engine.impl.util.DefaultClockImpl;
import org.activiti.engine.runtime.Clock;
import org.junit.Test;
import static groovy.util.GroovyTestCase.assertEquals;
import static junit.framework.TestCase.assertEquals;
import static org.junit.Assert.assertNull;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

import static groovy.util.GroovyTestCase.assertEquals;
import static org.junit.Assert.assertNull;
import org.activiti.engine.impl.calendar.DurationHelper;
import org.activiti.engine.impl.util.DefaultClockImpl;
import org.activiti.engine.runtime.Clock;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;

public class DurationHelperTest {

Expand Down Expand Up @@ -198,7 +200,10 @@ private Date parse(String str) throws Exception {
}

private Calendar parseCalendarWithOffset(String str, TimeZone timeZone) throws Exception {
return parseCalendar(str, timeZone, "yyyyMMdd-HH:mm:ss X");

Calendar cal = Calendar.getInstance();
cal.setTime(DateUtils.parseDate(str, new String[]{ "yyyyMMdd-HH:mm:ssZZ" }));
return cal;
}

private Calendar parseCalendar(String str, TimeZone timeZone) throws Exception {
Expand Down

0 comments on commit e9885c1

Please sign in to comment.