use of org.openstreetmap.atlas.checks.flag.CheckFlag in project atlas-checks by osmlab.
the class TagTest method testConfiguration.
/**
* Private function used by all test cases to easily test the configuration instead of rewriting
* the code constantly.
*
* @param config
* The {@link Configuration} is string form that is being test.
* @param numberOfFlags
* The number of expected flags to be processed based on the provided configuration
*/
private void testConfiguration(final String config, final int numberOfFlags) {
final Atlas atlas = setup.getAtlas();
final Configuration configuration = ConfigurationResolver.inlineConfiguration(config);
final List<CheckFlag> flags = Iterables.asList(new BaseTestCheck(configuration).flags(atlas));
// will return the number of flags for the number of objects because no restrictions
Assert.assertEquals(numberOfFlags, flags.size());
}
use of org.openstreetmap.atlas.checks.flag.CheckFlag in project atlas-checks by osmlab.
the class CheckFlagGeoJsonProcessorTestRule method getCheckFlagEvent.
public CheckFlagEvent getCheckFlagEvent() {
final CheckFlag flag = new CheckFlag("Test check flag");
flag.addObject(Iterables.head(atlas.nodes()), "Flagged Node");
flag.addObject(Iterables.head(atlas.edges()), "Flagged Edge");
flag.addObject(Iterables.head(atlas.areas()), "Flagged Area");
final CheckFlagEvent event = new CheckFlagEvent("sample-name", flag);
event.getCheckFlag().addInstruction("First instruction");
event.getCheckFlag().addInstruction("Second instruction");
return event;
}
Aggregations