| 1 | /** |
| 2 | * Copyright (C) 2009-2016 Paul Fretwell - aka 'Footleg' ([email protected]) |
| 3 | * |
| 4 | * This file is part of Cave Converter. |
| 5 | * |
| 6 | * Cave Converter is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation, either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * Cave Converter is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with Cave Converter. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | package footleg.cavesurvey.regression; |
| 20 | |
| 21 | import static org.junit.Assert.*; |
| 22 | |
| 23 | import java.io.FileNotFoundException; |
| 24 | import java.text.ParseException; |
| 25 | |
| 26 | import org.junit.Test; |
| 27 | |
| 28 | import footleg.cavesurvey.converter.CaveConverter.CmdlineOpt; |
| 29 | import footleg.cavesurvey.converter.CaveConverter.CmdlineSplaysOpt; |
| 30 | |
| 31 | /** |
| 32 | * Regression test class which runs data file conversions and compares the output with reference |
| 33 | * files. Tests pass if the output file is identical to the reference file. A file name prefix |
| 34 | * is given as the argument for each test conversion. The test will look for an input file with |
| 35 | * this prefix and the suffix '_in.dxf' and compare the output with a reference file with |
| 36 | * this prefix and the suffix '_ref.text'. |
| 37 | * |
| 38 | * @author Footleg |
| 39 | * @version 2016.12.14 (ISO 8601 YYYY.MM.DD) |
| 40 | * @since 1.6 (The Java version used) |
| 41 | */ |
| 42 | public class DxfToTopoRobotTest { |
| 43 | |
| 44 | @Test |
| 45 | public void testDxfToTopoRobotMares3d() throws ParseException, FileNotFoundException { |
| 46 | //Convert DXF file generated from a Survex .3d file to Toporobot format data |
| 47 | String fileCompare = RunFileConverter.convertDxfToTopoRobot( "2649_Mares_from3d", CmdlineSplaysOpt.Default, CmdlineOpt.F, |
| 48 | RunFileConverter.defaultCharset ); |
| 49 | assertEquals("Comparing 2649_Mares_from3d TopoRobot file from DXF with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 50 | } |
| 51 | |
| 52 | @Test |
| 53 | public void testDxfToTopoRobotMaresFromAven() throws ParseException, FileNotFoundException { |
| 54 | //Convert DXF file saved from the Aven viewer to Toporobot format data |
| 55 | String fileCompare = RunFileConverter.convertDxfToTopoRobot( "2649_Mares_fromaven", CmdlineSplaysOpt.Default, CmdlineOpt.F, |
| 56 | RunFileConverter.defaultCharset ); |
| 57 | assertEquals("Comparing 2649_Mares_fromaven TopoRobot file from DXF with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 58 | } |
| 59 | } |