kopia lustrzana https://github.com/JOSM/MapWithAI
Add test for MapWithAILayer#getMenuEntries
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
a9c06e44df
commit
a365b4468f
|
@ -226,7 +226,13 @@ public class MapWithAILayer extends OsmDataLayer implements ActiveLayerChangeLis
|
|||
return continuousDownload;
|
||||
}
|
||||
|
||||
private static class ContinuousDownloadAction extends AbstractAction implements LayerAction {
|
||||
/**
|
||||
* Allow continuous download of data (for the layer that MapWithAI is clamped
|
||||
* to).
|
||||
*
|
||||
* @author Taylor Smock
|
||||
*/
|
||||
public static class ContinuousDownloadAction extends AbstractAction implements LayerAction {
|
||||
private static final long serialVersionUID = -3528632887550700527L;
|
||||
private final MapWithAILayer layer;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
|
@ -37,6 +38,7 @@ import org.openstreetmap.josm.gui.MainApplication;
|
|||
import org.openstreetmap.josm.gui.layer.Layer;
|
||||
import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
||||
import org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin;
|
||||
import org.openstreetmap.josm.plugins.mapwithai.backend.MapWithAILayer.ContinuousDownloadAction;
|
||||
import org.openstreetmap.josm.plugins.mapwithai.commands.MapWithAIAddCommand;
|
||||
import org.openstreetmap.josm.testutils.JOSMTestRules;
|
||||
|
||||
|
@ -175,4 +177,12 @@ public class MapWithAILayerTest {
|
|||
assertEquals(2, mapWithAILayer.getDataSet().getDataSourceBounds().parallelStream().distinct().count(),
|
||||
"There should be two data sources");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMenuEntries() {
|
||||
Layer layer = MapWithAIDataUtils.getLayer(true);
|
||||
Action[] actions = layer.getMenuEntries();
|
||||
assertTrue(actions.length > 0);
|
||||
assertEquals(ContinuousDownloadAction.class, layer.getMenuEntries()[actions.length - 3].getClass());
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue