use of org.eclipse.smarthome.core.items.ItemProvider in project smarthome by eclipse.
the class RunRuleModuleTest method before.
@Before
public void before() {
registerService(new ItemProvider() {
@Override
public void addProviderChangeListener(final ProviderChangeListener<Item> listener) {
}
@Override
public void removeProviderChangeListener(final ProviderChangeListener<Item> listener) {
}
@Override
public Collection<Item> getAll() {
return Arrays.asList(new Item[] { new SwitchItem("switch1"), new SwitchItem("switch2"), new SwitchItem("switch3"), new SwitchItem("ruleTrigger") });
}
});
registerService(volatileStorageService);
}
use of org.eclipse.smarthome.core.items.ItemProvider in project smarthome by eclipse.
the class RuntimeRuleTest method before.
@Before
public void before() {
registerService(new ItemProvider() {
@Override
public void addProviderChangeListener(final ProviderChangeListener<Item> listener) {
}
@Override
public void removeProviderChangeListener(final ProviderChangeListener<Item> listener) {
}
@Override
public Collection<Item> getAll() {
return Arrays.asList(new Item[] { new SwitchItem("myMotionItem"), new SwitchItem("myPresenceItem"), new SwitchItem("myLampItem"), new SwitchItem("myMotionItem2"), new SwitchItem("myPresenceItem2"), new SwitchItem("myLampItem2"), new SwitchItem("myMotionItem3"), new SwitchItem("myPresenceItem3"), new SwitchItem("myLampItem3"), new SwitchItem("myMotionItem4"), new SwitchItem("myPresenceItem4"), new SwitchItem("myLampItem4") });
}
});
registerService(volatileStorageService);
}
use of org.eclipse.smarthome.core.items.ItemProvider in project smarthome by eclipse.
the class ScriptEngineOSGiTest method setup.
@Before
public void setup() {
registerVolatileStorageService();
EventPublisher eventPublisher = event -> {
};
registerService(eventPublisher);
itemRegistry = getService(ItemRegistry.class);
assertNotNull(itemRegistry);
itemProvider = new ItemProvider() {
@Override
public void addProviderChangeListener(ProviderChangeListener<Item> listener) {
}
@Override
public Collection<Item> getAll() {
return Lists.newArrayList(new SwitchItem(ITEM_NAME), createNumberItem(NUMBER_ITEM_TEMPERATURE, Temperature.class), createNumberItem(NUMBER_ITEM_LENGTH, Length.class), new NumberItem(NUMBER_ITEM_DECIMAL));
}
@Override
public void removeProviderChangeListener(ProviderChangeListener<Item> listener) {
}
};
registerService(itemProvider);
ScriptServiceUtil scriptServiceUtil = getService(ScriptServiceUtil.class);
assertNotNull(scriptServiceUtil);
scriptEngine = ScriptServiceUtil.getScriptEngine();
}
Aggregations