steveohara / j2mod

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

ModbusMasterFactory should be in test dir? #147

Closed raisercostin closed 4 months ago

raisercostin commented 5 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 4 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.