nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Zhurakousky <>
Subject Re: OnStopped annotation
Date Tue, 01 Mar 2016 12:56:02 GMT

You can simplify your interactive debugging and do it right from IDE
Just make sure that versioning in Gradle reflects current version.
I’ll update as well when I get a chance.


On Mar 1, 2016, at 4:47 AM, Pierre Villard <<>>

No it is not in a unit test, I remotely attached my Eclipse in debug mode
to my deployed Nifi instance.
I can try to code a unit test and reproduce the issue using the example you

2016-02-29 18:22 GMT+01:00 Oleg Zhurakousky <<>>:

I meant could you share the test code (via github)

On Feb 29, 2016, at 12:18 PM, Oleg Zhurakousky <<>> wrote:

Ok, so you are invoking ‘quietlyInvokeMethodsWithAnnotations’ in your
test code?
If so could you your test code where you invoke it? I have a hunch, but
want to look before I speculate.

On Feb 29, 2016, at 11:58 AM, Pierre Villard <<>> wrote:

I just wanted to test the processors with local SNMP set-up and I
that modification of properties in my processor didn't have any effect.
So I switched to debug, added a processor, started it, and stopped it
after. Conclusion: my close() method is never called.
I correctly go through quietlyInvokeMethodsWithAnnotations() in
ReflectionUtils but since the method is not seen as annotated, the close
method is not called.


2016-02-28 22:24 GMT+01:00 Oleg Zhurakousky <<>>:

I am puzzled as I can’t see how can it not work.
Are there steps to reproduce it? I am trying to read into your initial
email and suspecting you were doing some sort of testing, so want to
sure I am doing the same thing. . . .

On Feb 28, 2016, at 2:46 PM, Pierre Villard <<>>

No I am not under testing framework, all my unit tests are OK. I
perform some additional tests and deployed Nifi with the new

You can find the method here [1] if you want to have a look.
Thanks for your help.


2016-02-28 17:11 GMT+01:00 Oleg Zhurakousky <>:

Also, reading Aldrin’s response and assuming you are using Test
mocks I
would probably recommend to not use them for tests that require full
lifecycle test of the component until we actually improve it.
Instead you can code straight agains FlowController essentially
as a full blown NiFi minus UI. Here is an example:


On Feb 28, 2016, at 11:07 AM, Oleg Zhurakousky <<>>

Can you paste the method definition? Just want to look at the
and see if there is something obvious

Sent from my iPhone

On Feb 28, 2016, at 10:26, Pierre Villard <
<>> wrote:


I am working on SNMP processors [1] and I'm almost ready for a PR...
but I
have an issue I can't explain. In my processors, I have implemented a
method close() with the @OnStopped annotation but it seems the
is not seen. When debugging and stopping my processor, I correctly go
through quietlyInvokeMethodsWithAnnotations() in ReflectionUtils and
method close() appears without any annotation. I guess I am missing
something simple. Any idea?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message