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).
---