DBaseFileAttributeProvider extends AbstractAttributeProvider { @Override @Pure public Map<AttributeType, Collection<Attribute>> getAllAttributesByType() { return this.accessor.getAllAttributesByType(); } DBaseFileAttributeProvider(DBaseFileAttributeAccessor accessor); @Override @SuppressWarnings("checkstyle:nofinalizer") @Deprecated(since = "17.0", forRemoval = true) void finalize(); @Pure URL getResource(); @Pure int getRecordNumber(); @Override void freeMemory(); @Override @Pure Collection<String> getAllAttributeNames(); @Override @Pure Collection<Attribute> getAllAttributes(); @Override @Pure Map<AttributeType, Collection<Attribute>> getAllAttributesByType(); @Override @Pure AttributeValue getAttribute(String name); @Override @Pure AttributeValue getAttribute(String name, AttributeValue default_value); @Override @Pure Attribute getAttributeObject(String name); @Override @Pure boolean hasAttribute(String name); @Override @Pure int getAttributeCount(); @Override @Pure void toMap(Map<String, Object> mapToFill);  }
@Test public void testGetAllAttributesByType() throws Exception { Map<AttributeType,Collection<Attribute>> themap = this.provider.getAllAttributesByType(); assertNotNull(themap); assertEquals(2,themap.size()); Collection<Attribute> attrs; Attribute attr; Iterator<Attribute> iterator; attrs = themap.get(AttributeType.STRING); assertNotNull(attrs); assertEquals(3, attrs.size()); iterator = attrs.iterator(); assertTrue(iterator.hasNext()); attr = iterator.next(); assertEquals("SOURCE", attr.getName()); assertEquals(PHOTOGRAMMETRIE_VALUE, attr.getValue()); assertTrue(iterator.hasNext()); attr = iterator.next(); assertEquals("CATEGORIE", attr.getName()); assertEquals("Religieux", attr.getValue()); assertTrue(iterator.hasNext()); attr = iterator.next(); assertEquals("NATURE", attr.getName()); assertEquals("Eglise", attr.getValue()); assertFalse(iterator.hasNext()); attrs = themap.get(AttributeType.REAL); assertNotNull(attrs); assertEquals(1, attrs.size()); iterator = attrs.iterator(); assertTrue(iterator.hasNext()); attr = iterator.next(); assertEquals("HAUTEUR", attr.getName()); assertEquals(15., attr.getValue()); assertFalse(iterator.hasNext()); }