Skip to content

Commit

Permalink
Fix unit test on for CSVDataExtraction
Browse files Browse the repository at this point in the history
Mainly update golden files


Signed-off-by: sguan <sguan@actuate.com>
  • Loading branch information
sguan-actuate committed Apr 28, 2016
1 parent fe8ae45 commit 1f00312
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
Expand Up @@ -360,19 +360,14 @@ public void testOutputWithSelectedColumns() throws Exception
subtestRegular( option, "testSelectColumns.csv"); //$NON-NLS-1$
}

/*
* Test will ignore the invalid column and output only valid ones without
* exception
*/
public void testOutputWithInvalidColumn() throws Exception
{
option.setSelectedColumns( TEST_INVALID_COLUMNS );
CSVDataExtractionImpl extract = createExtraction( out, option );
try
{
extract.output( results );
fail("The output() method must throw an exception when selecting invalid column names."); //$NON-NLS-1$
}
catch ( BirtException e )
{

}
subtestRegular( option, "testSelectInvalidColumn.csv"); //$NON-NLS-1$
}

public void testOutputQuoting() throws Exception
Expand Down
@@ -1,3 +1,3 @@
Any Type Column using DateTime,Any Type Column using Date,Any Type Column using Time,DateTime Column,SQL Date Column,SQL Time Column
Any,Any,Any,DateTime,Date,Time
08/08/2008 15:08:08 HMG+08:00,08/08/2008 08:08:08 HMG+01:00,08/08/2008 08:08:08 HMG+01:00,08/08/2008 15:08:08 HMG+08:00,08/08/2008 08:08:08 HMG+01:00,08/08/2008 08:08:08 HMG+01:00
08/08/2008 15:08:08 UTC+8,08/08/2008 08:08:08 UTC+1,08/08/2008 15:08:08 UTC+8,08/08/2008 15:08:08 UTC+8,08/08/2008 08:08:08 UTC+1,08/08/2008 15:08:08 UTC+8
@@ -1,5 +1,5 @@
stringColumn,integerColumn,dateColumn,decimalColumn
myString1,5,"Aug 8, 2008 10:30 AM",25.689
,-12,,
"my,str;in g|3",,"Jan 1, 2007 3:30 PM",-987.654321
ü你ßé,0,,0.0
stringColumn,integerColumn,dateColumn,decimalColumn
myString1,5,"Aug 8, 2008 10:30 AM",25.689
,-12,,
"my,str;in g|3",,"Jan 1, 2007 3:30 PM",-987.654321
ü你ßé,0,,0
@@ -1,6 +1,6 @@
stringColumn,integerColumn,dateColumn,decimalColumn
String,Integer,DateTime,Decimal
myString1,5,8 août 2008 10:30,"25,689"
,-12,,
"my,str;in g|3",,1 janv. 2007 15:30,"-987,654321"
ü你ßé,0,,"0,0"
stringColumn,integerColumn,dateColumn,decimalColumn
String,Integer,DateTime,Decimal
myString1,5,8 août 2008 10:30,"25,689"
,-12,,
"my,str;in g|3",,1 janv. 2007 15:30,"-987,654321"
ü你ßé,0,,0
@@ -1,3 +1,3 @@
Any Type Column using DateTime,Any Type Column using Date,Any Type Column using Time,DateTime Column,SQL Date Column,SQL Time Column
Any,Any,Any,DateTime,Date,Time
8 août 2008 15:08,8 août 2008,08:08:08,8 août 2008 15:08,8 août 2008,08:08:08
8 août 2008 15:08,8 août 2008,15:08:08,8 août 2008 15:08,8 août 2008,15:08:08
Expand Up @@ -105,7 +105,7 @@ private void initCommonOptions( IReportContext context,
{
aLocale = commonOptions.getLocale( );
}
else
else if ( context != null )
{
aLocale = context.getLocale( );
}
Expand All @@ -124,10 +124,14 @@ private void initCommonOptions( IReportContext context,
// convert java time zone to ICU time zone
this.timeZone = TimeZone.getTimeZone( javaTimeZone.getID( ) );
}
else
else if ( context != null )
{
timeZone = context.getTimeZone( );
}
else
{
timeZone = TimeZone.getDefault( );
}

if ( !isLocaleNeutral )
{
Expand Down

0 comments on commit 1f00312

Please sign in to comment.