OsmWriter extends ElementWriter { public void process(EntityContainer entityContainer) { entityContainer.process(subElementWriter); } OsmWriter(String elementName, int indentLevel, boolean renderAttributes, boolean legacyBound); void begin(); void end(); void process(EntityContainer entityContainer); @Override void setWriter(final Writer writer);  }
@Test public final void testProcess1() { testOsmWriter.process(new BoundContainer(new Bound("source"))); }
@Test(expected = OsmosisRuntimeException.class) public final void testProcess2() { testOsmWriter.process(new BoundContainer(new Bound("source"))); testOsmWriter.process(new BoundContainer(new Bound("source2"))); fail("Expected to throw an exception."); }
@Test public final void testProcess3() { testOsmWriter.process( new NodeContainer( new Node( new CommonEntityData( 1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0, new ArrayList<Tag>()), 20, 20))); }
@Test(expected = OsmosisRuntimeException.class) public final void testProcess4() { testOsmWriter.process(new NodeContainer( new Node( new CommonEntityData(1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0, new ArrayList<Tag>()), 20, 20))); testOsmWriter.process(new BoundContainer(new Bound("source"))); fail("Expected to throw an exception."); }
@Test public final void testProcess6() { Way testWay; testWay = new Way(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0)); testWay.getWayNodes().add(new WayNode(1234)); testWay.getWayNodes().add(new WayNode(1235)); testWay.getTags().add(new Tag("test_key1", "test_value1")); testOsmWriter.process(new WayContainer(testWay)); }
@Test(expected = OsmosisRuntimeException.class) public final void testProcess7() { Way testWay; testWay = new Way(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0)); testWay.getWayNodes().add(new WayNode(1234)); testWay.getWayNodes().add(new WayNode(1235)); testWay.getTags().add(new Tag("test_key1", "test_value1")); testOsmWriter.process(new WayContainer(testWay)); testOsmWriter.process(new BoundContainer(new Bound("source"))); }
@Test public final void testProcess8() { Relation testRelation; testRelation = new Relation(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0)); testRelation.getMembers().add(new RelationMember(1234, EntityType.Node, "role1")); testRelation.getTags().add(new Tag("test_key1", "test_value1")); testOsmWriter.process(new RelationContainer(testRelation)); }
@Test(expected = OsmosisRuntimeException.class) public final void testProcess9() { Relation testRelation; testRelation = new Relation(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0)); testRelation.getMembers().add(new RelationMember(1234, EntityType.Node, "role1")); testRelation.getTags().add(new Tag("test_key1", "test_value1")); testOsmWriter.process(new RelationContainer(testRelation)); testOsmWriter.process(new BoundContainer(new Bound("source"))); }