summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2011-11-17 22:45:09 (EST)
committer mwu2011-11-17 22:45:09 (EST)
commit40e38ca86c632163dde54d216c858d9c8221068c (patch)
treee68b0914b5d1cd858fe302b1d3b969840b96a721
parentb84210389fa16ced7b9f85571e6bde0ca78cc541 (diff)
downloadorg.eclipse.birt-40e38ca86c632163dde54d216c858d9c8221068c.zip
org.eclipse.birt-40e38ca86c632163dde54d216c858d9c8221068c.tar.gz
org.eclipse.birt-40e38ca86c632163dde54d216c858d9c8221068c.tar.bz2
Checkin: update some test cases for time functions
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD4.txt2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD9.txt6
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt4
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt8
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java1
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java1
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java1
7 files changed, 12 insertions, 11 deletions
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD4.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD4.txt
index e25bbc3..f239fd7 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD4.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD4.txt
@@ -1,5 +1,5 @@
year quarter month week-of-month
-2002 1 1 5
+2002 1 2 1
year quarter month week-of-month
2002 1 2 2
year quarter month week-of-month
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD9.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD9.txt
index df47e33..3b2a76f 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD9.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/MonthToDateTest.testMTD9.txt
@@ -1,5 +1,5 @@
year quarter month week-of-month
-2011 3 9 5
+2011 4 10 1
year quarter month week-of-month
2011 4 10 2
year quarter month week-of-month
@@ -7,6 +7,4 @@ year quarter month week-of-month
year quarter month week-of-month
2011 4 10 4
year quarter month week-of-month
-2011 4 10 5
-year quarter month week-of-month
-2011 4 10 6 \ No newline at end of file
+2011 4 10 5 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
index 047a18b..bfdab0e 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
@@ -10,7 +10,7 @@
2004 2 6 4
2004 2 6 3
2004 2 6 2
-2004 2 6 1
+2004 2 5 6
2004 2 5 5
2004 2 5 4
2004 2 5 3
@@ -23,7 +23,7 @@
2004 1 3 4
2004 1 3 3
2004 1 3 2
-2004 1 3 1
+2004 1 2 5
2004 1 2 4
2004 1 2 3
2004 1 2 2
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
index 5a3e93e..0841f58 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
@@ -10,7 +10,7 @@
2004 2 6 4
2004 2 6 3
2004 2 6 2
-2004 2 6 1
+2004 2 5 6
2004 2 5 5
2004 2 5 4
2004 2 5 3
@@ -23,7 +23,7 @@
2004 1 3 4
2004 1 3 3
2004 1 3 2
-2004 1 3 1
+2004 1 2 5
2004 1 2 4
2004 1 2 3
2004 1 2 2
@@ -42,7 +42,7 @@
2004 4 10 3
2004 4 10 4
2004 4 10 5
-2004 4 11 1
+2004 4 10 6
2004 4 11 2
2004 4 11 3
2004 4 11 4
@@ -50,4 +50,4 @@
2004 4 12 2
2004 4 12 3
2004 4 12 4
-2004 4 12 5
+2004 4 12 5 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
index e4c8e04..d51da2c 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
@@ -33,6 +33,7 @@ public class MonthToDateFunction extends AbstractMDX
Calendar cal = new GregorianCalendar( TimeMemberUtil.getTimeZone( ),
TimeMemberUtil.getDefaultLocale( ) );
+ cal.clear( );
cal.setMinimalDaysInFirstWeek(1);
String baseType = translateToCal( cal, levelTypes, values );
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
index ea53a7d..3ab08c3 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
@@ -16,6 +16,7 @@ public class QuarterToDateFunction extends AbstractMDX implements IPeriodsFuncti
Calendar cal = new GregorianCalendar( TimeMemberUtil.getTimeZone( ),
TimeMemberUtil.getDefaultLocale( ) );
+ cal.clear();
cal.setMinimalDaysInFirstWeek(1);
String calculateUnit = this.translateToCal( cal, levels, values ) ;
Calendar isCurrentCal = null;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
index 629d6cb..6b98635 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
@@ -16,6 +16,7 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
Calendar cal = new GregorianCalendar( TimeMemberUtil.getTimeZone( ),
TimeMemberUtil.getDefaultLocale( ) );
+ cal.clear( );
cal.setMinimalDaysInFirstWeek(1);
String calculateUnit = this.translateToCal( cal, levels, values ) ;
Calendar isCurrentCal = null;