DummyReader implements ProfileVersionReader { public Map<String, String> getDistribution(final String name) { final Element property = this.getPropertyElement(name); final boolean exists = Boolean.valueOf(this.getAttributeValue(property, "expanded")); if (exists) { final Map<String, String> distribution = new HashMap<String, String>(); final List<?> items = property.selectNodes(" for (Object o : items) { final Element e = (Element) o; final String key = this.getAttributeValue(e, "value"); final String value = this.getAttributeValue(e, "count"); distribution.put(key, value); } return distribution; } return null; }  void setStream(final InputStream is); String getCollectionName(); String getObjectsCount(); String getCollectionSize(); String getObjectsMaxSize(); String getObjectsMinSize(); String getObjectsAvgSize(); Map<String, String> getDistribution(final String name);  }
@Test public void shouldObtainMissingDistribution() throws Exception { final Map<String, String> distribution = this.reader.getDistribution("blah"); Assert.assertNull(distribution); }
@Test public void shouldObtainFormatDistribution() throws Exception { final Map<String, String> distribution = this.reader.getDistribution("format"); Assert.assertNotNull(distribution); Assert.assertFalse(distribution.keySet().isEmpty()); }