Search in sources :

Example 6 with StringMapChanges

use of de.westnordost.streetcomplete.data.osm.changes.StringMapChanges in project StreetComplete by westnordost.

the class OsmQuestChangesUploadTest method createAnsweredQuestWithAppliableChange.

private static OsmQuest createAnsweredQuestWithAppliableChange() {
    StringMapEntryChange aPossibleChange = new StringMapEntryAdd("somekey", "value");
    StringMapChanges changes = new StringMapChanges(Collections.singletonList(aPossibleChange));
    return createAnsweredQuest(changes);
}
Also used : StringMapEntryChange(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange) StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd) StringMapChanges(de.westnordost.streetcomplete.data.osm.changes.StringMapChanges)

Example 7 with StringMapChanges

use of de.westnordost.streetcomplete.data.osm.changes.StringMapChanges in project StreetComplete by westnordost.

the class OsmQuestDaoTest method testAddGetWithChanges.

public void testAddGetWithChanges() {
    List<StringMapEntryChange> changes = new ArrayList<>();
    changes.add(new StringMapEntryAdd("a key", "a value"));
    changes.add(new StringMapEntryDelete("delete this", "key"));
    changes.add(new StringMapEntryModify("modify", "this", "to that"));
    OsmQuest quest = createNewQuest(11, Element.Type.NODE);
    quest.setChanges(new StringMapChanges(changes), "bla");
    addToDaos(quest);
    assertEquals(1, (long) quest.getId());
    OsmQuest dbQuest = dao.get(1);
    checkEqual(quest, dbQuest);
}
Also used : StringMapEntryDelete(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryDelete) StringMapEntryModify(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryModify) StringMapEntryChange(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange) StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd) StringMapChanges(de.westnordost.streetcomplete.data.osm.changes.StringMapChanges) ArrayList(java.util.ArrayList) OsmQuest(de.westnordost.streetcomplete.data.osm.OsmQuest)

Aggregations

StringMapChanges (de.westnordost.streetcomplete.data.osm.changes.StringMapChanges)7 Element (de.westnordost.osmapi.map.data.Element)3 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)3 StringMapEntryChange (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange)3 StringMapEntryAdd (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd)2 StringMapEntryDelete (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryDelete)2 Date (java.util.Date)2 ContentValues (android.content.ContentValues)1 QuestStatus (de.westnordost.streetcomplete.data.QuestStatus)1 ElementGeometry (de.westnordost.streetcomplete.data.osm.ElementGeometry)1 OsmElementQuestType (de.westnordost.streetcomplete.data.osm.OsmElementQuestType)1 StringMapChangesBuilder (de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder)1 StringMapEntryModify (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryModify)1 ArrayList (java.util.ArrayList)1