Package org.openstreetmap.osmosis.testutil.v0_6

Examples of org.openstreetmap.osmosis.testutil.v0_6.SinkChangeInspector


   
    // All nodes have an empty tags list.
    tags = new ArrayList<Tag>();
   
    polygonFile = new File(getClass().getResource("testPolygon.txt").getFile());
    entityInspector = new SinkEntityInspector();
    // polyAreaFilter has a notch out of the Northeast corner.
    polyAreaFilter = new PolygonFilter(IdTrackerType.Dynamic, polygonFile, false, false, false, false);
    polyAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 0, 30, 0, "intersecting");
    crossingIntersectingBound = new Bound(-10, 10, 30, -30, "crossing intersecting");
View Full Code Here


  /**
   * Performs pre-test activities.
   */
  @Before
  public void setUp() {
    entityInspector = new SinkEntityInspector();
    try {
      parser = SAXParserFactory.newInstance().newSAXParser();
    } catch (ParserConfigurationException e) {
      throw new OsmosisRuntimeException("Unable to create SAX Parser.", e);
    } catch (SAXException e) {
View Full Code Here

    RunnableSource source1 = new BoundSource(new Bound(5, 6, 8, 7, "source1"), false);

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());

    Assert.assertEquals(2, mergedList.size());
    for (EntityContainer entityContainer : mergedList) {
      Assert.assertEquals(EntityType.Node, entityContainer.getEntity().getType());
    }
View Full Code Here

    RunnableSource source1 = new BoundSource(new Bound(5, 6, 8, 7, "source1"), false);

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);

    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
    Assert.assertEquals(2, mergedList.size());
    for (EntityContainer entityContainer : mergedList) {
      Assert.assertEquals(EntityType.Node, entityContainer.getEntity().getType());
    }
  }
View Full Code Here

    RunnableSource source1 = new BoundSource(new Bound(5, 6, 8, 7, "source1"), true);

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
   
    Assert.assertEquals(2, mergedList.size());
    for (EntityContainer entityContainer : mergedList) {
      Assert.assertEquals(EntityType.Node, entityContainer.getEntity().getType());
    }
View Full Code Here

    RunnableSource source1 = new BoundSource(bound1, true);

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
    Assert.assertEquals(3, mergedList.size());
    Assert.assertEquals(EntityType.Bound, mergedList.get(0).getEntity().getType());
   
    // Check the bound
    Bound bound01 = (Bound) mergedList.get(0).getEntity();
View Full Code Here

    RunnableSource source1 = new EmptyReader();

    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    Assert.assertTrue("Expected empty result set but got some data", merged.getLastEntityContainer() == null);
  }
View Full Code Here

    RunnableSource source1 = new BoundSource(bound1, true);
   
    EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
        BoundRemovedAction.Ignore);
   
    SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
    List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
   
    Assert.assertEquals(2, mergedList.size());
    Assert.assertEquals(bound1, mergedList.get(0).getEntity());
    Assert.assertEquals(EntityType.Node, mergedList.get(1).getEntity().getType());
  }
View Full Code Here

  public final void testAcceptNode() {
    Set<String> keys = new HashSet<String>(Arrays.asList("amenity"));
    Map<String, Set<String>> keyValues = new HashMap<String, Set<String>>();
    keyValues.put("key", new HashSet<String>(Arrays.asList("valone", "valtwo")));
    tagFilter = new TagFilter("accept-nodes", keys, keyValues);
    entityInspector = new SinkEntityInspector();
    tagFilter.setSink(entityInspector);

    tagFilter.process(amenityNodeContainer);
    tagFilter.process(taglessNodeContainer);
    tagFilter.process(residentialWayContainer);
View Full Code Here

  public final void testRejectWay() {
    Set<String> keys = new HashSet<String>();
    Map<String, Set<String>> keyValues = new HashMap<String, Set<String>>();
    keyValues.put("highway", new HashSet<String>(Arrays.asList("motorway", "motorway_link")));
    tagFilter = new TagFilter("reject-ways", keys, keyValues);
    entityInspector = new SinkEntityInspector();
    tagFilter.setSink(entityInspector);

    tagFilter.process(amenityNodeContainer);
    tagFilter.process(residentialWayContainer);
    tagFilter.process(motorwayWayContainer);
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.testutil.v0_6.SinkChangeInspector

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.