Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase committed Sep 17, 2021
1 parent e2508a1 commit 2e25028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
import org.elasticsearch.index.mapper.MapperBuilderContext;
import org.elasticsearch.legacygeo.builders.CoordinatesBuilder;
Expand Down Expand Up @@ -293,12 +292,13 @@ public void testParseMixedDimensionPolyWithHole() throws IOException, ParseExcep
XContentParser parser = createParser(xContentBuilder);
parser.nextToken();

final GeoShapeFieldMapper mapperBuilder = new GeoShapeFieldMapper.Builder("test", false, true).ignoreZValue(false)
.build(MapperBuilderContext.ROOT);
final LegacyGeoShapeFieldMapper mapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", Version.CURRENT, false, true).build(
MapperBuilderContext.ROOT
);

// test store z disabled
ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, () -> ShapeParser.parse(parser, mapperBuilder));
assertThat(e, hasToString(containsString("but [ignore_z_value] parameter is [false]")));
ElasticsearchException e = expectThrows(ElasticsearchException.class, () -> ShapeParser.parse(parser, mapperBuilder));
assertThat(e, hasToString(containsString("coordinate dimensions do not match")));
}

public void testParseMixedDimensionPolyWithHoleStoredZ() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
package org.elasticsearch.legacygeo.test;

import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.legacygeo.LegacyGeoPlugin;
import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper;
Expand All @@ -18,18 +17,15 @@
import java.util.Map;

/**
* Some tests depend on the {@link GeoShapeFieldMapper}.
* This mapper is registered in the spatial-extras module, but used in many integration
* tests in server code. The goal is to migrate all of the spatial/geo pieces to the spatial-extras
* module such that no tests in server depend on this test plugin
* Test plugin to test functionality of this mapper.
*/
@Deprecated
public class TestLegacyGeoShapeFieldMapperPlugin extends LegacyGeoPlugin implements MapperPlugin {

@Override
public Map<String, Mapper.TypeParser> getMappers() {
Map<String, Mapper.TypeParser> mappers = new LinkedHashMap<>();
mappers.put(GeoShapeFieldMapper.CONTENT_TYPE, LegacyGeoShapeFieldMapper.PARSER);
mappers.put(LegacyGeoShapeFieldMapper.CONTENT_TYPE, LegacyGeoShapeFieldMapper.PARSER);
return Collections.unmodifiableMap(mappers);
}
}

0 comments on commit 2e25028

Please sign in to comment.