kopia lustrzana https://github.com/JOSM/MapWithAI
Add a wait for Availability tests
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
8641bfc357
commit
95614e2e80
|
@ -83,6 +83,13 @@ build:
|
||||||
dependencies:
|
dependencies:
|
||||||
- assemble
|
- assemble
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ./gradlew test --stacktrace
|
||||||
|
dependencies:
|
||||||
|
- assemble
|
||||||
|
|
||||||
compile against min JOSM:
|
compile against min JOSM:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -40,7 +40,8 @@ public class MapWithAIAction extends JosmAction {
|
||||||
public void actionPerformed(ActionEvent event) {
|
public void actionPerformed(ActionEvent event) {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
MapWithAIDataUtils.getMapWithAIData(MapWithAIDataUtils.getLayer(true));
|
MapWithAIDataUtils.getMapWithAIData(MapWithAIDataUtils.getLayer(true));
|
||||||
createMessageDialog();
|
MapWithAIAvailability.getInstance();
|
||||||
|
// createMessageDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +57,8 @@ public class MapWithAIAction extends JosmAction {
|
||||||
final List<Bounds> bounds = new ArrayList<>(layer.getDataSet().getDataSourceBounds());
|
final List<Bounds> bounds = new ArrayList<>(layer.getDataSet().getDataSourceBounds());
|
||||||
if (bounds.isEmpty()) {
|
if (bounds.isEmpty()) {
|
||||||
MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).stream()
|
MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).stream()
|
||||||
.map(OsmDataLayer::getDataSet).filter(Objects::nonNull).map(DataSet::getDataSourceBounds)
|
.map(OsmDataLayer::getDataSet).filter(Objects::nonNull).map(DataSet::getDataSourceBounds)
|
||||||
.forEach(bounds::addAll);
|
.forEach(bounds::addAll);
|
||||||
}
|
}
|
||||||
final StringBuilder message = new StringBuilder();
|
final StringBuilder message = new StringBuilder();
|
||||||
message.append(MapWithAIPlugin.NAME);
|
message.append(MapWithAIPlugin.NAME);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
public class MapWithAIActionTest {
|
public class MapWithAIActionTest {
|
||||||
@Rule
|
@Rule
|
||||||
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
||||||
public JOSMTestRules test = new JOSMTestRules().preferences().main().projection();
|
public JOSMTestRules test = new JOSMTestRules().main().projection();
|
||||||
|
|
||||||
private MapWithAIAction action;
|
private MapWithAIAction action;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
package org.openstreetmap.josm.plugins.mapwithai.backend;
|
package org.openstreetmap.josm.plugins.mapwithai.backend;
|
||||||
|
|
||||||
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
|
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
|
||||||
|
import static org.awaitility.Awaitility.await;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -21,7 +24,7 @@ public class MapWithAIAvailabilityTest {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
||||||
public JOSMTestRules test = new JOSMTestRules().preferences().main().projection();
|
public JOSMTestRules test = new JOSMTestRules();
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public WireMockRule wireMockRule = new WireMockRule(options().usingFilesUnderDirectory("test/resources/wiremock"));
|
public WireMockRule wireMockRule = new WireMockRule(options().usingFilesUnderDirectory("test/resources/wiremock"));
|
||||||
|
@ -32,6 +35,8 @@ public class MapWithAIAvailabilityTest {
|
||||||
+ "/facebookmicrosites/Open-Mapping-At-Facebook/master/data/rapid_realeases.geojson");
|
+ "/facebookmicrosites/Open-Mapping-At-Facebook/master/data/rapid_realeases.geojson");
|
||||||
Territories.initialize();
|
Territories.initialize();
|
||||||
instance = MapWithAIAvailability.getInstance();
|
instance = MapWithAIAvailability.getInstance();
|
||||||
|
LatLon temp = new LatLon(40, -100);
|
||||||
|
await().atMost(10, TimeUnit.SECONDS).until(() -> Territories.isIso3166Code("US", temp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Ładowanie…
Reference in New Issue