index.put(docBuilder);
sync();
Results<ScoredDocument> result = searchDocs(index, "", 0);
assertEquals(1, result.getNumberReturned());
ScoredDocument doc = result.iterator().next();
Field retField = doc.getOnlyField("textfield");
assertEquals(FieldType.TEXT, retField.getType());
assertEquals("textfield", retField.getName());
assertEquals("text field", retField.getText());
retField = doc.getOnlyField("numberfield");
assertEquals(FieldType.NUMBER, retField.getType());
assertEquals(new Double("123"), retField.getNumber());
retField = doc.getOnlyField("datefield");
assertEquals(FieldType.DATE, retField.getType());
assertEquals(now, retField.getDate());
retField = doc.getOnlyField("htmlfield");
assertEquals(FieldType.HTML, retField.getType());
assertEquals("<html>html field</html>", retField.getHTML());
retField = doc.getOnlyField("atomfield");
assertEquals(FieldType.ATOM, retField.getType());
assertEquals(currentUser.getAuthDomain(), retField.getAtom());
retField = doc.getOnlyField("geofield");
assertEquals(FieldType.GEO_POINT, retField.getType());
assertEquals(-10, retField.getGeoPoint().getLatitude(), 0);
assertEquals(10.000001, retField.getGeoPoint().getLongitude(), 0.000000);
}