Remove a suppress warning annotation and fix the root cause

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2019-10-04 07:54:59 -06:00
rodzic d86f126818
commit b8ad1c37f4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.TreeSet;
import org.junit.Assert;
import org.junit.Rule;
@ -33,7 +34,6 @@ public class AddPrimitivesCommandTest {
Assert.assertSame(dataSet, way1.getDataSet());
}
@SuppressWarnings("UndefinedEquals")
@Test
public void testUndoRedo() {
final DataSet dataSet = new DataSet();
@ -49,19 +49,19 @@ public class AddPrimitivesCommandTest {
command.executeCommand();
command.fillModifiedData(modified, deleted, added);
Assert.assertSame(dataSet, way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
Assert.assertTrue(deleted.isEmpty());
Assert.assertTrue(modified.isEmpty());
Assert.assertEquals(3, added.size());
command.undoCommand();
Assert.assertNull(way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
added.clear();
command.executeCommand();
Assert.assertSame(dataSet, way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
command.fillModifiedData(modified, deleted, added);
Assert.assertTrue(deleted.isEmpty());
Assert.assertTrue(modified.isEmpty());
@ -73,26 +73,26 @@ public class AddPrimitivesCommandTest {
command.executeCommand();
Assert.assertSame(dataSet, way1.getDataSet());
Assert.assertNotEquals(selection, dataSet.getAllSelected());
Assert.assertNotEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
command.undoCommand();
Assert.assertNull(way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
dataSet.addPrimitive(way1.firstNode());
command.executeCommand();
Assert.assertSame(dataSet, way1.getDataSet());
Assert.assertNotEquals(selection, dataSet.getAllSelected());
Assert.assertNotEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
command.undoCommand();
Assert.assertNull(way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
dataSet.addPrimitive(way1.lastNode());
dataSet.addPrimitive(way1);
command.executeCommand();
Assert.assertSame(dataSet, way1.getDataSet());
Assert.assertNotEquals(selection, dataSet.getAllSelected());
Assert.assertNotEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
command.undoCommand();
Assert.assertSame(dataSet, way1.getDataSet());
@ -102,7 +102,7 @@ public class AddPrimitivesCommandTest {
new DataSet().addPrimitive(way1.lastNode());
command.executeCommand();
Assert.assertNull(way1.getDataSet());
Assert.assertEquals(selection, dataSet.getAllSelected());
Assert.assertEquals(new TreeSet<>(selection), new TreeSet<>(dataSet.getAllSelected()));
command.undoCommand();
Assert.assertNull(way1.getDataSet());