[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17725437#comment-17725437
 ] 

ASF subversion and git services commented on NIFI-11528:


Commit 57f5b518f8f6667d627c13be3e2265eefcbe9e75 in nifi's branch 
refs/heads/main from dan-s1
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=57f5b518f8 ]

NIFI-11528 Refactored TestFormatUtilsGroovy to Java Parameterized Test

This closes #7248

Signed-off-by: David Handermann 


> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17725438#comment-17725438
 ] 

ASF subversion and git services commented on NIFI-11528:


Commit e33b40e08ec7b2188ebe68ddfff813acfda52aba in nifi's branch 
refs/heads/support/nifi-1.x from dan-s1
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=e33b40e08e ]

NIFI-11528 Refactored TestFormatUtilsGroovy to Java Parameterized Test

This closes #7248

Signed-off-by: David Handermann 
(cherry picked from commit 57f5b518f8f6667d627c13be3e2265eefcbe9e75)


> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-15 Thread David Handermann (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722897#comment-17722897
 ] 

David Handermann commented on NIFI-11528:
-

Closed, thanks!

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-15 Thread Daniel Stieglitz (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722896#comment-17722896
 ] 

Daniel Stieglitz commented on NIFI-11528:
-

[~exceptionfactory] So can NIFI-11803 be closed as this is not a bug?

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-15 Thread David Handermann (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722887#comment-17722887
 ] 

David Handermann commented on NIFI-11528:
-

That sounds correct, thanks!

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-15 Thread Daniel Stieglitz (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722884#comment-17722884
 ] 

Daniel Stieglitz commented on NIFI-11528:
-

[~exceptionfactory] Thanks for the reminder. Looking more closely at the code 
makes me feel the author chose an incorrect test case and the code is working 
as expected.  It is true that .75 milliseconds equals 75 nanoseconds but 
the point of method 
{code:java}
makeWholeNumberTime
{code}
is not to find the smallest possible time unit but rather to find the next 
smaller time unit with a whole number. The next possible smaller time unit 
which has a whole number for .75 milliseconds is microseconds (not nanoseconds) 
where the whole number is 750. I would think the test case should reflect the 
conversion from milliseconds to microseconds. Please let me know whether you 
concur. Thanks!


> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-15 Thread David Handermann (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722773#comment-17722773
 ] 

David Handermann commented on NIFI-11528:
-

Thanks for working on this [~dstiegli1]!

It looks like you noticed this problem some time ago and wrote up a separate 
Jira issue to correct the underlying problem: NIFI-11083

With that background, it sounds like the runtime fix should be handled in that 
Jira, and the test code should follow the current behavior until that issue is 
fixed. Alternatively, you could address both the runtime issue and the test 
refactor in a single pull request.

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-12 Thread Daniel Stieglitz (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17722264#comment-17722264
 ] 

Daniel Stieglitz commented on NIFI-11528:
-

[~exceptionfactory] I was able to refactor most of the 

{code:java}
nifi-commons/nifi-utils/src/test/groovy/org/apache/nifi/util/TestFormatUtilsGroovy.groovy
{code}

to a Java equivalent class. There is one particular test which I am having a 
problem on its conversion to Java and I would like direction on how to proceed. 
Test 
{code:java}
testMakeWholeNumberTimeShouldHandleMetricConversions
{code} on lines 292-295 in the original Groovy does not actually run assertions 
against all the values held in the variable 
{code:java}
results
{code}
 rather it only runs against the first entry and then short circuits. I noticed 
this when I added

{code:java}
System.out.println("key="+ key + " values" + values)
{code}
as it only printed the first entry.
In the Java equivalent this test fails on scenario

{code:java}
"millisToNanos"  : [originalUnits: TimeUnit.MILLISECONDS, expectedUnits: 
TimeUnit.NANOSECONDS, originalValue: 0.75, expectedValue: 750_000]
{code}

as the expected unit type is
{code:java}
 TimeUnit.MICROSECONDS
{code} and the actual value is 750.



> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-08 Thread David Handermann (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17720696#comment-17720696
 ] 

David Handermann commented on NIFI-11528:
-

The Groovy files should be deleted, that will be visible as part of the pull 
request for comparison. If there are any Maven configuration dependencies for 
Groovy, those could also be removed from the module.

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-11528) Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)

2023-05-08 Thread Daniel Stieglitz (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-11528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17720689#comment-17720689
 ] 

Daniel Stieglitz commented on NIFI-11528:
-

[~exceptionfactory] As part of the PR for this should I delete the actual 
Groovy file(s) or should I keep them for the reviewer to compare and they will 
delete them after the PR is accepted?

> Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5)
> --
>
> Key: NIFI-11528
> URL: https://issues.apache.org/jira/browse/NIFI-11528
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Daniel Stieglitz
>Assignee: Daniel Stieglitz
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)