Search in sources :

Example 6 with VolatileStorageService

use of org.openhab.core.test.storage.VolatileStorageService in project openhab-core by openhab.

the class ManagedTransformationConfigurationProviderTest method setup.

@BeforeEach
public void setup() {
    VolatileStorageService storageService = new VolatileStorageService();
    provider = new ManagedTransformationConfigurationProvider(storageService);
    provider.addProviderChangeListener(listenerMock);
}
Also used : VolatileStorageService(org.openhab.core.test.storage.VolatileStorageService) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with VolatileStorageService

use of org.openhab.core.test.storage.VolatileStorageService in project openhab-core by openhab.

the class ItemRegistryImplTest method beforeEach.

@BeforeEach
public void beforeEach() {
    GenericItem cameraItem1 = new SwitchItem(CAMERA_ITEM_NAME1);
    GenericItem cameraItem2 = new SwitchItem(CAMERA_ITEM_NAME2);
    GenericItem cameraItem3 = new NumberItem(CAMERA_ITEM_NAME3);
    GenericItem cameraItem4 = new NumberItem(CAMERA_ITEM_NAME4);
    cameraItem1.addTag(CAMERA_TAG);
    cameraItem2.addTag(CAMERA_TAG);
    cameraItem2.addTag(SENSOR_TAG);
    cameraItem3.addTag(CAMERA_TAG);
    cameraItem4.addTag(CAMERA_TAG_UPPERCASE);
    // setup ManageItemProvider with necessary dependencies:
    itemProvider = new ManagedItemProvider(new VolatileStorageService(), new ItemBuilderFactoryImpl(new CoreItemFactory()));
    itemProvider.add(new SwitchItem(ITEM_NAME));
    itemProvider.add(cameraItem1);
    itemProvider.add(cameraItem2);
    itemProvider.add(cameraItem3);
    itemProvider.add(cameraItem4);
    // setup ItemRegistryImpl with necessary dependencies:
    itemRegistry = new ItemRegistryImpl(mock(MetadataRegistry.class)) {

        {
            addProvider(itemProvider);
            setManagedProvider(itemProvider);
            setEventPublisher(ItemRegistryImplTest.this.eventPublisherMock);
            setStateDescriptionService(mock(StateDescriptionService.class));
            setUnitProvider(mock(UnitProvider.class));
            setItemStateConverter(mock(ItemStateConverter.class));
        }
    };
}
Also used : NumberItem(org.openhab.core.library.items.NumberItem) CoreItemFactory(org.openhab.core.library.CoreItemFactory) VolatileStorageService(org.openhab.core.test.storage.VolatileStorageService) ItemBuilderFactoryImpl(org.openhab.core.internal.items.ItemBuilderFactoryImpl) ItemRegistryImpl(org.openhab.core.internal.items.ItemRegistryImpl) SwitchItem(org.openhab.core.library.items.SwitchItem) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

VolatileStorageService (org.openhab.core.test.storage.VolatileStorageService)7 BeforeEach (org.junit.jupiter.api.BeforeEach)5 ManagedThingProvider (org.openhab.core.thing.ManagedThingProvider)5 ThingRegistry (org.openhab.core.thing.ThingRegistry)4 ItemRegistry (org.openhab.core.items.ItemRegistry)3 ThingProvider (org.openhab.core.thing.ThingProvider)3 Locale (java.util.Locale)2 ChannelTypeProvider (org.openhab.core.thing.type.ChannelTypeProvider)2 ChannelTypeUID (org.openhab.core.thing.type.ChannelTypeUID)2 Hashtable (java.util.Hashtable)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 UpnpService (org.jupnp.UpnpService)1 MockUpnpService (org.jupnp.mock.MockUpnpService)1 SysteminfoHandlerFactory (org.openhab.binding.systeminfo.internal.SysteminfoHandlerFactory)1 SysteminfoInterface (org.openhab.binding.systeminfo.internal.model.SysteminfoInterface)1 WemoHttpCallFactory (org.openhab.binding.wemo.internal.WemoHttpCallFactory)1 WemoHttpCall (org.openhab.binding.wemo.internal.http.WemoHttpCall)1 ItemBuilderFactoryImpl (org.openhab.core.internal.items.ItemBuilderFactoryImpl)1 ItemRegistryImpl (org.openhab.core.internal.items.ItemRegistryImpl)1