Cleanup testcases (split, dependencies, assertions)

This commit is contained in:
Manuel Fuhr 2022-10-23 10:51:02 +02:00
parent 3787076839
commit fd158dc0ce
4 changed files with 38 additions and 39 deletions

View file

@ -6,4 +6,8 @@ dependencies {
implementation project(':brouter-util')
implementation project(':brouter-codec')
implementation project(':brouter-expressions')
testImplementation 'junit:junit:4.13.2'
}
// MapcreatorTest generates segments which are used in tests
test.dependsOn ':brouter-map-creator:test'

View file

@ -1,28 +1,24 @@
package btools.mapaccess;
import java.io.File;
import java.net.URL;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Assert;
import org.junit.Test;
import btools.mapaccess.PhysicalFile;
import java.io.File;
import java.io.IOException;
public class IntegrityCheckTest {
private File workingDir;
@Test
public void integrityTest() throws Exception {
URL resulturl = this.getClass().getResource("/testtrack0.gpx");
Assert.assertTrue("reference result not found: ", resulturl != null);
File resultfile = new File(resulturl.getFile());
workingDir = resultfile.getParentFile();
File segmentDir = new File(workingDir, "/../../../../brouter-map-creator/build/resources/test/tmp/segments");
public void integrityTest() throws IOException {
File workingDir = new File(".").getCanonicalFile();
File segmentDir = new File(workingDir, "../brouter-map-creator/build/resources/test/tmp/segments");
File[] files = segmentDir.listFiles();
assertNotNull("Missing segments", files);
for (File f : files) {
PhysicalFile.checkFileIntegrity(f);
assertNull(PhysicalFile.checkFileIntegrity(f));
}
}