My guess is that it was mostly meant to be a base class for processors
inside standard processors NAR.

If we want it to be reusable outside of that, the class should
probably be moved to a jar somewhere in
nifi-nar-bundles/nifi-extension-utils because in it's current state
you would need a dependency on nifi-standard-processors jar which
would then bring all the standard processors into your NAR.

On Mon, Sep 9, 2019 at 11:46 AM Mike Thomsen <[email protected]> wrote:
>
> I'm not sure what the reasoning was behind making them package visibility
> instead of public. I can't imagine going to public would cause much of a
> problem, but I'd be curious to know from others if there was a good reason
> they weren't made public. If it was an oversight or something, we could
> just open it up before 1.10 goes into a release vote.
>
> On Mon, Sep 9, 2019 at 11:10 AM Otto Fowler <[email protected]> wrote:
>
> > in other words
> >
> > runner = TestRunners.newTestRunner(OpenNLPRecordProcessor.class);
> > runner.addControllerService("reader", readerService);
> > runner.enableControllerService(readerService);
> >
> > runner.setProperty("Whatever the Property name is for READER", "reader");
> >
> >
> >
> >
> > On September 9, 2019 at 11:07:14, Otto Fowler ([email protected])
> > wrote:
> >
> > Can you set by the property name?
> >
> >
> >
> > On September 8, 2019 at 13:04:44, Peter Thygesen ([email protected]
> > )
> > wrote:
> >
> > No. That is exactly the problem.
> >
> > E.g.
> >
> > runner = TestRunners.newTestRunner(OpenNLPRecordProcessor.class);
> > runner.addControllerService("reader", readerService);
> > runner.enableControllerService(readerService);
> >
> > runner.setProperty(OpenNLPRecordProcessor.RECORD_READER, "reader");
> >
> > Last line will not compile! You cannot refer to the RECORD_READER because
> > its "private package". That means I have to move my processor to same
> > package or create my own READER (leaving the original reader not used, but
> > initiated)
> >
> > On 2019/09/08 14:41:09, Otto Fowler <[email protected]> wrote:
> > > Have a look at :>
> > >
> > > import org.apache.nifi.serialization.record.MockRecordParser;>
> > > import org.apache.nifi.serialization.record.MockRecordWriter;>
> > >
> > > Maybe?>
> > >
> > >
> > >
> > > On September 8, 2019 at 06:53:10, Peter Thygesen (
> > [email protected]
> > )>
> >
> > > wrote:>
> > >
> > > Hi Nifi-Dev>
> > >
> > > I am trying to write a custom record processor. My processor extends>
> > > AbstractRecordProcessor. To test my processor I need to mock reader and>
> > > writer , but that is not easybecause the RecordReader and RecordWriter
> > of>
> > > the AbstractRecordReader are static private package scope, which makes
> > it>
> > > impossible to mock since my processor is not in the same package...>
> > >
> > > Any tips?>
> > >
> > > Best Regards,>
> > > Peter Thygesen>
> > >
> >

Reply via email to