| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 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 |
import footleg.cavesurvey.regression.RunFileConverter; |
| 31 |
import footleg.cavesurvey.tools.TestHelper; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
public class PocketTopoToSurvexTest { |
| 45 |
|
| 46 |
@Test |
| 47 |
public void testPocketTopoToSurvexGourAven() throws ParseException, FileNotFoundException { |
| 48 |
|
| 49 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 50 |
RunFileConverter.setOldJRE(oldJRE); |
| 51 |
|
| 52 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "GourAven", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 53 |
RunFileConverter.defaultCharset ); |
| 54 |
|
| 55 |
RunFileConverter.setOldJRE(false); |
| 56 |
assertEquals("Comparing GourAven survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 57 |
} |
| 58 |
|
| 59 |
@Test |
| 60 |
public void testPocketTopoToSurvexHSC() throws ParseException, FileNotFoundException { |
| 61 |
|
| 62 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "HSC", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 63 |
RunFileConverter.defaultCharset ); |
| 64 |
assertEquals("Comparing HSC survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 65 |
} |
| 66 |
|
| 67 |
@Test |
| 68 |
public void testPocketTopoToSurvexStomps() throws ParseException, FileNotFoundException { |
| 69 |
|
| 70 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 71 |
RunFileConverter.setOldJRE(oldJRE); |
| 72 |
|
| 73 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "Stomps", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 74 |
RunFileConverter.defaultCharset ); |
| 75 |
|
| 76 |
RunFileConverter.setOldJRE(false); |
| 77 |
assertEquals("Comparing Stomps survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 78 |
} |
| 79 |
|
| 80 |
@Test |
| 81 |
public void testPocketTopoToSurvexUzuGour() throws ParseException, FileNotFoundException { |
| 82 |
|
| 83 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "Uzu-Gour", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 84 |
RunFileConverter.defaultCharset ); |
| 85 |
assertEquals("Comparing Uzu-Gour survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 86 |
} |
| 87 |
|
| 88 |
@Test |
| 89 |
public void testPocketTopoToSurvexSwil20120909() throws ParseException, FileNotFoundException { |
| 90 |
|
| 91 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 92 |
RunFileConverter.setOldJRE(oldJRE); |
| 93 |
|
| 94 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "Swil20120909", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 95 |
RunFileConverter.defaultCharset ); |
| 96 |
|
| 97 |
RunFileConverter.setOldJRE(false); |
| 98 |
assertEquals("Comparing Swil20120909 survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 99 |
} |
| 100 |
|
| 101 |
@Test |
| 102 |
public void testPocketTopoToSurvexSloppy2ZigZags() throws ParseException, FileNotFoundException { |
| 103 |
|
| 104 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 105 |
RunFileConverter.setOldJRE(oldJRE); |
| 106 |
|
| 107 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "Sloppy2ZigZags", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 108 |
RunFileConverter.defaultCharset ); |
| 109 |
|
| 110 |
RunFileConverter.setOldJRE(false); |
| 111 |
assertEquals("Comparing Sloppy2ZigZags survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 112 |
} |
| 113 |
|
| 114 |
@Test |
| 115 |
public void testPocketTopoToSurvexT_LRUD() throws ParseException, FileNotFoundException { |
| 116 |
|
| 117 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 118 |
RunFileConverter.setOldJRE(oldJRE); |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "T_LRUD", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 128 |
RunFileConverter.defaultCharset ); |
| 129 |
|
| 130 |
RunFileConverter.setOldJRE(false); |
| 131 |
assertEquals("Comparing T_LRUD survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 132 |
} |
| 133 |
|
| 134 |
@Test |
| 135 |
public void testPocketTopoToSurvexTripComment() throws ParseException, FileNotFoundException { |
| 136 |
|
| 137 |
boolean oldJRE = TestHelper.jreRoundingBug(); |
| 138 |
RunFileConverter.setOldJRE(oldJRE); |
| 139 |
|
| 140 |
String fileCompare = RunFileConverter.convertPocketTopoToSurvex( "TripComment", CmdlineSplaysOpt.Default, CmdlineOpt.T, |
| 141 |
RunFileConverter.defaultCharset ); |
| 142 |
|
| 143 |
RunFileConverter.setOldJRE(false); |
| 144 |
assertEquals("Comparing TripComment survex file from PocketTopo with reference.", DiffFiles.FILES_IDENTICAL, fileCompare); |
| 145 |
} |
| 146 |
|
| 147 |
} |