Package org.openhab.core.items

Examples of org.openhab.core.items.ItemNotFoundException


    Widget w = mock(Widget.class);
    Item item = mock(Item.class);
    when(w.getLabel()).thenReturn(testLabel);
    when(w.getItem()).thenReturn("Item");
    when(w.eClass()).thenReturn(SitemapFactory.eINSTANCE.createText().eClass());
    when(registry.getItem("Item")).thenThrow(new ItemNotFoundException("Item"));
    when(item.getState()).thenReturn(new StringType("State"));
    String label = uiRegistry.getLabel(w);
    assertEquals("Label [-]", label);
  }
View Full Code Here


  }
 
  @Test
  public void getWidget_UnknownPageId() throws ItemNotFoundException {
    Sitemap sitemap = SitemapFactory.eINSTANCE.createSitemap();
    when(registry.getItem("unknown")).thenThrow(new ItemNotFoundException("unknown"));
    Widget w = uiRegistry.getWidget(sitemap, "unknown");
    assertNull(w);
  }
View Full Code Here

        if(item.getName().equals(name)) {
          return item;
        }
      }
    }
    throw new ItemNotFoundException(name);
  }
View Full Code Here

    @Override
  public Item getItemByPattern(String name) throws ItemNotFoundException, ItemNotUniqueException {
    Collection<Item> items = getItems(name);
   
    if(items.isEmpty()) {
      throw new ItemNotFoundException(name);
    }
   
    if(items.size()>1) {
      throw new ItemNotUniqueException(name, items);
    }
View Full Code Here

          GroupItem groupItem = (GroupItem) item;
          for (Item member : groupItem.getMembers()) {
            addLine(graphDef, member, seriesCounter++);
          }
        } else {
          throw new ItemNotFoundException("Item '" + item.getName() + "' defined in groups is not a group.");
        }
      }
    }

    // Write the chart as a PNG image
View Full Code Here

          for (Item member : groupItem.getMembers()) {
            if(addItem(chart, persistenceService, startTime, endTime, member, seriesCounter))
              seriesCounter++;
          }
        } else {
          throw new ItemNotFoundException("Item '" + item.getName() + "' defined in groups is not a group.");
        }
      }
    }

    // If there are no series, render a blank chart
View Full Code Here

TOP

Related Classes of org.openhab.core.items.ItemNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.