Skip to content

Commit 9fa2e5e

Browse files
committed
unit tests work in progress
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
1 parent 1511abf commit 9fa2e5e

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

itests/org.openhab.core.model.item.tests/itest.bndrun

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ Fragment-Host: org.openhab.core.model.item
130130
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.19.2,2.19.3)',\
131131
org.yaml.snakeyaml;version='[2.4.0,2.4.1)'
132132
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
133-
org.openhab.core.model.rule.runtime;version='[5.1.0,5.1.1)',\
134133
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
135134
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
136135
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
137136
de.focus_shift.jollyday-core;version='[1.5.4,1.5.5)',\
138-
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)'
137+
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)',\
138+
org.openhab.core.model.persistence.runtime;version='[5.1.0,5.1.1)'

itests/org.openhab.core.model.rule.tests/itest.bndrun

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,4 @@ Fragment-Host: org.openhab.core.model.rule.runtime
134134
org.yaml.snakeyaml;version='[2.4.0,2.4.1)'
135135
org.openhab.core.model.persistence.runtime;version='[5.1.0,5.1.1)'
136136
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)'
137+
org.openhab.core.model.persistence.runtime;version='[5.1.0,5.1.1)'

itests/org.openhab.core.model.script.tests/itest.bndrun

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ Fragment-Host: org.openhab.core.model.script
141141
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
142142
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
143143
de.focus_shift.jollyday-core;version='[1.5.4,1.5.5)',\
144-
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)'
144+
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)',\
145+
org.openhab.core.model.persistence.runtime;version='[5.1.0,5.1.1)'

itests/org.openhab.core.model.thing.tests/itest.bndrun

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ Fragment-Host: org.openhab.core.model.thing
138138
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.19.2,2.19.3)',\
139139
org.yaml.snakeyaml;version='[2.4.0,2.4.1)'
140140
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
141-
org.openhab.core.model.rule.runtime;version='[5.1.0,5.1.1)',\
142141
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
143142
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
144143
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
145144
de.focus_shift.jollyday-core;version='[1.5.4,1.5.5)',\
146-
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)'
145+
de.focus_shift.jollyday-jackson;version='[1.5.4,1.5.5)',\
146+
org.openhab.core.model.persistence.runtime;version='[5.1.0,5.1.1)'

itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/internal/CommunicationManagerOSGiTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public class CommunicationManagerOSGiTest extends JavaOSGiTest {
9393

9494
private static class ItemChannelLinkRegistryAdvanced extends ItemChannelLinkRegistry {
9595
public ItemChannelLinkRegistryAdvanced(ThingRegistry thingRegistry, ItemRegistry itemRegistry,
96-
ItemBuilderFactory itemBuilderFactory) {
97-
super(null, thingRegistry, itemRegistry, itemBuilderFactory, mock(BundleContext.class));
96+
ItemBuilderFactory itemBuilderFactory, BundleContext bundleContext) {
97+
super(null, thingRegistry, itemRegistry, itemBuilderFactory, bundleContext);
9898
}
9999

100100
@Override
@@ -160,12 +160,15 @@ protected void addProvider(Provider<ItemChannelLink> provider) {
160160

161161
private @NonNullByDefault({}) CommunicationManager manager;
162162
private @NonNullByDefault({}) SafeCaller safeCaller;
163-
164-
private ItemChannelLinkRegistryAdvanced iclRegistry = new ItemChannelLinkRegistryAdvanced(thingRegistryMock,
165-
itemRegistryMock, itemBuilderFactoryMock);
163+
private @NonNullByDefault({}) ItemChannelLinkRegistryAdvanced iclRegistry;
166164

167165
@BeforeEach
168166
public void beforeEach() {
167+
registerVolatileStorageService();
168+
169+
iclRegistry = new ItemChannelLinkRegistryAdvanced(thingRegistryMock, itemRegistryMock, itemBuilderFactoryMock,
170+
bundleContext);
171+
169172
when(UNIT_PROVIDER_MOCK.getUnit(Temperature.class)).thenReturn(SIUnits.CELSIUS);
170173
item5 = new NumberItem("Number:Temperature", ITEM_NAME_5, UNIT_PROVIDER_MOCK);
171174

0 commit comments

Comments
 (0)