The docs say that JSR223 scripts will be loaded in order of start level
(as defined by filename or containing folder). this works (mostly) fine
when you're stepping through start levels sequentially on startup, but if
you're already at SL100, and have scripts located in sl folders, and then
install an addon for those scripts, they were loading in alphabetic
order instead. This ensures they'll still respect start level order
relative to each other.
This should also fix the case of script start levels not matching
start levels OpenHAB actually steps through (which are all multiples
of 10) - i.e. if you define scripts in sl30, sl31, and sl32, when
OpenHAB jumps from 30 to 40, 31 should be executed before 32.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
This fixes the build being broken when building on Windows.
It also contains many fixes for timing issues which seem to impact macOS and Windows more than Linux.
* Fix .gitattributes and add *.xml_gen to fix line ending issues on Windows
* Derive fork count from CPU details in org.openhab.core tests for more stable tests on machines with fewer cores
* Adjust SafeCallerImplTest timings
* Increase ExecUtilTest timeout
* Increase SchedulerImplTest timeouts
* Increase AudioConsoleTest serveStream timeout
* Increase AudioServletTest serveStream timeout
* Increase SchedulerImplTest test timeouts
* Increase ExpireManagerTest timeout used for checking published events
* Increase PeriodicSchedulerImplTest max allowed delta
* Increase SchedulerImplTest timeouts
* Fix BundleInfoReader file stream not closed causing temp dir deletion issues on Windows
* Fix GenerateDefaultTranslationsMojoTest Windows line endings issues
* Fix GenerateDefaultTranslationsMojoTest Windows temp dir deletion problem
* Fix GenericItemProviderTest tearDown sometimes fails because of queued events
* Fix ChannelLinkNotifierOSGiTest wait for channel link events
* Fix ChannelCommandDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix ChannelStateDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix GenericItemChannelLinkProviderTest not waiting for async updated state to become true
* Fix GenericThingProviderTest failing due to events of previous test
* Fix InboxOSGiTest sometimes fails because of queued events
* Fix ScriptEngineOSGiTest failing because items are not yet added to registry
* Fix ThingManagerOSGiTest failing due to async handleRemoval call
Signed-off-by: Wouter Born <github@maindrain.net>
* Fix memory leak in ScriptedRuleProvider
The Rule was never removed from the internal tracking map and therefore allocated resources were never freed.
Signed-off-by: Jan N. Klug <github@klug.nrw>
Most of the tests add a timeout of 1s to account for small delays in async processing in the AbstractWatchService. This adds some more timeouts for tests which were missing those.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Add more null annotations to automation bundles. This adds null annotations to many classes in the automation bundles and a few dimension classes.
* Further cleanup AutomationCommandExport
* Remove null from RuleStatusInfo JavaDocs. This should be clear from how the class is now annotated.
* Validate deserialized RuleStatusInfo
* Allow TriggerHandlerCallback to be triggered without providing a context
Signed-off-by: Wouter Born <github@maindrain.net>
* Add more null annotations
* Fix mock name
Adds null annotations to most of the tests as well as a few other classes.
Also fixes a few other SAT findings.
Fixes ~300 SAT findings in total.
Signed-off-by: Wouter Born <github@maindrain.net>
Allows scripts to specify per-script start levels which differ from the start level for the ScriptFileWatcher itself. Also extracted some functionality from ScriptFileWatcher into distinct components & added unit tests to cover all script loading functionality.
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>