[ 
https://issues.apache.org/jira/browse/METRON-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16544705#comment-16544705
 ] 

ASF GitHub Bot commented on METRON-1670:
----------------------------------------

Github user rgasiorek commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1104#discussion_r202558931
  
    --- Diff: 
metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
 ---
    @@ -182,7 +182,8 @@ public void testDayOfMonthNull() {
       @Test
       public void testWeekOfYear() {
         Object result = run("WEEK_OF_YEAR(epoch)");
    -    assertEquals(35, result);
    +    calendar.setTimeInMillis(AUG2016);
    --- End diff --
    
    it it save to morph/mutate an object that is shared? What about a short 
lived object like that:
       @Test
       public void testWeekOfYear() {
         Object result = run("WEEK_OF_YEAR(epoch)");
    -    assertEquals(35, result);
    +    Calendar testCalendar = Calendar.getInstance();
    +    testCalendar.setTimeInMillis(AUG2016);
    +    assertEquals(testCalendar.get(Calendar.WEEK_OF_YEAR), result);
       }


> Stellar WEEK_OF_YEAR test is locale sensitive
> ---------------------------------------------
>
>                 Key: METRON-1670
>                 URL: https://issues.apache.org/jira/browse/METRON-1670
>             Project: Metron
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Simon Elliston Ball
>            Priority: Trivial
>
> The Stellar WEEK_OF_YEAR(epoch) function is sensitive to the locale of the 
> machine it is running on. The tests in DateFunctionsTest are not, this leads 
> to test failures on machine locales that differ in their first day of week 
> definition or days in first week definition.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to