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

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

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

    https://github.com/apache/metron/pull/1104#discussion_r202600375
  
    --- 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 is perfectly safe: The instance is create in the @Before annotated 
method, so in fact, I am already doing exactly what you suggest.  See: 
https://github.com/simonellistonball/metron/blob/bafd3827d273c5c33b4293fd338595b8de3a75b2/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java#L61
 
    
    So there is no sharing of this object between tests, since a new instance 
is acquired before each test method is run. 
    
    The second issue you raise should be handled by a separate unit of change 
and a separate ticket if it is really necessary (not sure why it would be, but 
perhaps you could raise a JIRA and explain).


> 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