* [mqtt.homeassistant] handle null component name
channels from such components will not have a group. this is
now done by zigbee2mqtt for the "default" component of a device,
such as the light. HASS encourages this as of release 2023.8
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Resolve itest runbundles
* Fix dependency issues
* Add specs features because Pax Web now depends on "asm"
Signed-off-by: Wouter Born <github@maindrain.net>
* Remove build server specific timing from dynamodb and ruuvigateway
There should be no difference between running tests on your own PC or on a build server.
The ruuvigateway tests always fail for me during parallel builds due to its unrealistic timing.
Signed-off-by: Wouter Born <github@maindrain.net>
* Resolve runbundles for CXF upgrade
Related to openhab/openhab-core#3770
Signed-off-by: Wouter Born <github@maindrain.net>
* Replace Grizzly JAX-RS Client with Jetty HTTP client in hueemulation tests
It seems that the Grizzly JAX-RS Client implementation does not work well with the new CXF dependencies on the classpath.
As we do not use Grizzly anywhere else it is probably best to also stop using the Grizzly HTTP Server in these tests in the future.
Signed-off-by: Wouter Born <github@maindrain.net>
---------
Signed-off-by: Wouter Born <github@maindrain.net>
This prevents ZipException stacktraces when running the itests on JDK 17.0.8 or newer.
Related to:
* openhab/openhab-core#3718
* openhab/openhab-core#3747
Signed-off-by: Wouter Born <github@maindrain.net>
Update to latest netty to ensure latest improvements and security patches are applied.
https://netty.io/news/2023/04/25/4-1-92-Final.html
* Adapt itests to new netty release
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Also-by: Holger Friedrich <mail@holger-friedrich.de>
* Add POJOs for ecoFeedback from Miele REST API
* DeviceState offers water and energy consumption
* Convert Quantity to State for channel population
* Add eco feedback channels to devices
* Fix item types and categories
* Add update instructions for eco feedback channels
Signed-off-by: Björn Lange <bjoern.lange@itemis.de>
* Rework Servlets to use Http Whiteboard annotations in favor of proprietary `org.openhab.core.io.http.servlet` classes
* Resolve itest runbundles
* Fix dependency issues
* Catch proper exception when starting hueemulation UpnpServer
Also-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Wouter Born <github@maindrain.net>
* [jsscriptingnashorn] JavaScript Scripting Nashorn Automation
This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+).
The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15.
* Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4
For the Nashorn changelog, see:
https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md
* Update parent to 4.0.0-SNAPSHOT
* Remove removeUnsupportedNashornArgs
* Update scriptTypes
* Add CODEOWNERS entry
* Recycle ScriptScopeOSGiTest.java
It got removed in openhab/openhab-core#2994
* Remove redundant new line from pom.xml
Signed-off-by: Wouter Born <github@maindrain.net>
* State descriptions cleanup
* Converted channels to QuantityType, adjusted default translations
* Channel definitions and percent to QuanityType
* Changed default state descriptions from MB to MiB
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
* Changed discovery to MDNS; added HTTPS handling; refactor HTTPClient to use jetty shared client
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
* Update Shelly and Tradfri bindings for upgrade to Californium 2.7.3
* Fixes deprecated API usages
* Resolves itest runbundles
Signed-off-by: Wouter Born <github@maindrain.net>
* Add CPU load channel, update dependencies
* use PercentType, correct process CPU load
* Add and fix test
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
* Syncs the karaf.version so the new Maven plugin is used
* Resolves itest runbundles for the new runtime dependencies
Signed-off-by: Wouter Born <github@maindrain.net>
This fixes all the compilation/dependency issues in the MQTT itests so they can be reenabled again.
The tests now create and use their own Moquette instance instead of the removed embedded MQTT broker.
The moquette-broker JAR is also included in the test bundles as workaround for its missing OSGi bundle manifest headers.
Signed-off-by: Wouter Born <github@maindrain.net>
This fixes the issue of the integration tests sometimes failing because channels have not yet been linked causing item state to remain null.
Signed-off-by: Wouter Born <github@maindrain.net>
* Introduce algorithm for preventing excessive currentPower updates
* Increase calculation accuracy
* Rename currentPowerAccurate to currentPowerRaw
* Remove duplicated line
* Use interface when declaring double ended queue
* Reformat README to one sentence per line
* Rename constants for consistency and readability
Fixes#12460
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Fix status transitions
Fixes#12415
* Fix integration tests
* Fix missing status update for some devices after HTTP call
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This workaround fixes the modbus itests.
It seems that the methods that were added to the `BaseThingHandler` in openhab/openhab-core#2773 have caused some class loading issues when creating mocks of ThingHandlers in the modbus itests:
```
java.lang.NoClassDefFoundError: org/openhab/core/thing/type/ChannelTypeUID
at org.mockito.codegen.ModbusPollerThingHandler$MockitoMock$1698831298.<clinit>(Unknown Source)
at jdk.internal.reflect.GeneratedSerializationConstructorAccessor6.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
at org.mockito.internal.creation.instance.ObjenesisInstantiator.newInstance(ObjenesisInstantiator.java:22)
at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:48)
at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:42)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:53)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:96)
at org.mockito.Mockito.mock(Mockito.java:1954)
at org.mockito.Mockito.mock(Mockito.java:1869)
at org.openhab.binding.modbus.tests.ModbusDataHandlerTest.createPollerMock(ModbusDataHandlerTest.java:199)
at org.openhab.binding.modbus.tests.ModbusDataHandlerTest.testInitGeneric(ModbusDataHandlerTest.java:1039)
at org.openhab.binding.modbus.tests.ModbusDataHandlerTest.testInitGeneric(ModbusDataHandlerTest.java:1007)
at org.openhab.binding.modbus.tests.ModbusDataHandlerTest.testWriteOnlyData(ModbusDataHandlerTest.java:1101)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at aQute.tester.bundle.engine.BundleDescriptor.executeChild(BundleDescriptor.java:49)
at aQute.tester.bundle.engine.BundleEngine.lambda$executeBundle$7(BundleEngine.java:120)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at aQute.tester.bundle.engine.BundleEngine.executeBundle(BundleEngine.java:120)
at aQute.tester.bundle.engine.BundleEngine.lambda$executeBundle$8(BundleEngine.java:133)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at aQute.tester.bundle.engine.BundleEngine.executeBundle(BundleEngine.java:133)
at aQute.tester.bundle.engine.BundleEngine.lambda$execute$5(BundleEngine.java:100)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at aQute.tester.bundle.engine.BundleEngine.execute(BundleEngine.java:100)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at aQute.tester.junit.platform.Activator.test(Activator.java:439)
at aQute.tester.junit.platform.Activator.automatic(Activator.java:344)
at aQute.tester.junit.platform.Activator.run(Activator.java:216)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at aQute.launcher.Launcher.launch(Launcher.java:450)
at aQute.launcher.Launcher.run(Launcher.java:184)
at aQute.launcher.Launcher.main(Launcher.java:160)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52)
Caused by: java.lang.ClassNotFoundException: org.openhab.core.thing.type.ChannelTypeUID
at net.bytebuddy.dynamic.loading.ByteArrayClassLoader.findClass(ByteArrayClassLoader.java:397)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 128 more
```
Signed-off-by: Wouter Born <github@maindrain.net>
* Adds --add-opens to the surefire-maven-plugin config required for deserialization using Gson/XStream
* Upgrades plugin dependencies to JDK 17 compatible versions
* Replaces some reflection that no longer works on JDK 17
* Fixes issues when mocking Random
* Run Nashorn dependant tests only on JDK < 15
Signed-off-by: Wouter Born <github@maindrain.net>
* Consolidate service subscriptions in base class.
* Remove unsynchronized and unneeded cache of subscriptions.
* Do not unregister participant when removing subscription.
* Fix status wrongly set to ONLINE when exception is thrown.
* Refactor error handling for WemoHttpCall.
* Adjust log level for communication errors.
* Add automatic subscription renewal.
* Fix more ONLINE/OFFLINE status transition issues.
* Adjust log level when getWemoURL fails because device is offline.
* Remove redundant logging.
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>