/** * Writes the transit schedule to the specified file in the file * format specified by <tt>transitSchedule_v1.dtd</tt> * * @param filename * @throws UncheckedIOException */ public void writeFileV1(final String filename) throws UncheckedIOException { log.info( Gbl.aboutToWrite("transit schedule", filename) ) ; new TransitScheduleWriterV1(this.transformation, this.schedule).write(filename); }
@Test public void testOutput() { URL transitSchedule = IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("pt-tutorial"), "transitschedule.xml"); final Scenario originalScenario = ScenarioUtils.createScenario(ConfigUtils.createConfig()); new TransitScheduleReader(originalScenario).readURL(transitSchedule ); final String file = utils.getOutputDirectory()+"/schedule.xml"; new TransitScheduleWriterV1( transformation , originalScenario.getTransitSchedule() ).write( file ); final Scenario reprojectedScenario = ScenarioUtils.createScenario(ConfigUtils.createConfig()); new TransitScheduleReader(reprojectedScenario).readFile(file); assertCorrectlyReprojected( originalScenario.getTransitSchedule() , reprojectedScenario.getTransitSchedule() ); }
new TransitScheduleWriterV1(schedule1).write(filename); TransitScheduleFactory builder2 = new TransitScheduleFactoryImpl(); TransitSchedule schedule2 = builder2.createTransitSchedule(); new TransitScheduleWriterV1(schedule1).write(filename); TransitScheduleFactory builder3 = new TransitScheduleFactoryImpl(); TransitSchedule schedule3 = builder3.createTransitSchedule();