@Test
public void testLoadDbfFile()
        throws IOException
{

    String inputLocation = getShapeFilePath("dbf");
    // load shape with geotool.shapefile
    FeatureCollection<SimpleFeatureType, SimpleFeature> collection = loadFeatures(inputLocation);
    FeatureIterator<SimpleFeature> features = collection.features();
    ArrayList<String> featureTexts = new ArrayList<String>();
    while (features.hasNext()) {
        SimpleFeature feature = features.next();
        String attr = "";
        int i = 0;
        for (Property property : feature.getProperties()) {
            if (i == 0) {
                i++;
                continue;
            }
            if (i > 1) { attr += "\t"; }
            attr += String.valueOf(property.getValue());
            i++;
        }
        featureTexts.add(attr);
    }
    features.close();
    final Iterator<String> featureIterator = featureTexts.iterator();
    for (Geometry geometry : ShapefileReader.readToGeometryRDD(sc, inputLocation).rawSpatialRDD.collect()) {
        assertEquals(featureIterator.next(), geometry.getUserData());
    }
}