Package org.openstreetmap.osmosis.plugin.elasticsearch.model.entity

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESNode$Builder


  }

  @Test
  public void saveWay_withPolygon() {
    // Setup
    ESNode node1 = ESNode.Builder.create().id(1).location(1, 2).build();
    ESNode node2 = ESNode.Builder.create().id(2).location(2, 3).build();
    ESNode node3 = ESNode.Builder.create().id(3).location(3, 2).build();
    index(INDEX_NAME, node1, node2, node3);

    Way way = OsmDataBuilder.buildSampleWay(1, 1, 2, 3, 1);

    // Action
View Full Code Here


  }

  @Test
  public void saveWay_withLineString() {
    // Setup
    ESNode node1 = ESNode.Builder.create().id(1).location(1.0, 2.0).build();
    ESNode node2 = ESNode.Builder.create().id(2).location(2.0, 3.0).build();
    ESNode node3 = ESNode.Builder.create().id(3).location(3.0, 2.0).build();
    ESNode node4 = ESNode.Builder.create().id(4).location(4.0, 1.0).build();
    index(INDEX_NAME, node1, node2, node3, node4);

    Way way = OsmDataBuilder.buildSampleWay(1, 1, 2, 3, 4);

    // Action
View Full Code Here

  /* find */

  @Test
  public void findNode() {
    // Setup
    ESNode node = OsmDataBuilder.buildSampleESNode();
    index(INDEX_NAME, node);
    refresh(INDEX_NAME);

    // Action
    ESNode actual = entityDao.find(ESNode.class, 1);

    // Assert
    Assert.assertEquals(node, actual);
  }
View Full Code Here

  }

  @Test(expected = DaoException.class)
  public void findNode_thatDoesNotExists() {
    // Setup
    ESNode node = OsmDataBuilder.buildSampleESNode();
    index(INDEX_NAME, node);
    refresh(INDEX_NAME);

    // Action
    entityDao.find(ESNode.class, 2);
View Full Code Here

    long[] ids = new long[SIZE];
    List<ESNode> expected = new ArrayList<ESNode>(SIZE);

    for (int i = 0; i < SIZE; i++) {
      ESNode node = OsmDataBuilder.buildSampleESNode(i);
      expected.add(node);
      ids[i] = i;

    }
    index(INDEX_NAME, expected.toArray(new ESEntity[0]));
View Full Code Here

  }

  @Test
  public void findAllNodes() {
    // Setup
    ESNode node1 = ESNode.Builder.create().id(1).location(1.0, 2.0).build();
    ESNode node2 = ESNode.Builder.create().id(2).location(3.0, 4.0).build();
    List<ESNode> expected = Arrays.asList(new ESNode[] { node1, node2 });

    index(INDEX_NAME, node1, node2);
    refresh(INDEX_NAME);
View Full Code Here

  }

  @Test
  public void findAllNodes_withSubset() {
    // Setup
    ESNode node1 = ESNode.Builder.create().id(1).location(1.0, 2.0).build();
    ESNode node2 = ESNode.Builder.create().id(2).location(3.0, 4.0).build();
    List<ESNode> expected = Arrays.asList(new ESNode[] { node2 });

    index(INDEX_NAME, node1, node2);
    refresh(INDEX_NAME);
View Full Code Here

  }

  @Test
  public void findAllNodes_keepOrder() {
    // Setup
    ESNode node1 = ESNode.Builder.create().id(1).location(1.0, 2.0).build();
    ESNode node2 = ESNode.Builder.create().id(2).location(3.0, 4.0).build();
    List<ESNode> expected = Arrays.asList(new ESNode[] { node2, node1 });

    index(INDEX_NAME, node1, node2);
    refresh(INDEX_NAME);
View Full Code Here

  /* delete */

  @Test
  public void deleteNode() {
    // Setup
    ESNode node = OsmDataBuilder.buildSampleESNode();
    index(INDEX_NAME, node);
    refresh(INDEX_NAME);

    // Action
    boolean actual = entityDao.delete(ESNode.class, 1);
View Full Code Here

  }

  @Test
  public void deleteNode_thatDoesNotExists() {
    // Setup
    ESNode node = OsmDataBuilder.buildSampleESNode();
    index(INDEX_NAME, node);
    refresh(INDEX_NAME);

    // Action
    boolean actual = entityDao.delete(ESNode.class, 2);
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESNode$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.