steveohara / j2mod

Enhanced Modbus library implemented in the Java programming language
Apache License 2.0
276 stars 110 forks source link

ModbusMasterFactory should be in test dir? #147

Closed raisercostin closed 8 months ago

raisercostin commented 10 months ago

This is more of a question.

Expected Behavior

I was expecting that com/ghgande/j2mod/modbus/net/ModbusMasterFactory.java to be in src/main/java and be released.

Actual Behavior

image

Steps to Reproduce the Problem

  1. Check in git commit fb9c4a7e34e568c212b5fbe026b3e382ed344526
steveohara commented 8 months ago

The code in ModbusMasterFactory was only ever intended to be used by the xxxxTest examples, hence most settings are hard-coded (data bits, stop bits, parity, flow control).

It's understandable you might think otherwise though, given that there are a bunch of classes that end in Test that would give the impression that they are in some way Unit Tests. They are not, they are a hangover from the original forked version of j2mod where these were used as command line examples.

I think in a future release, I will make this more obvious by charging their names to end in Example instead.