Skip to content
Snippets Groups Projects

NSHM Unit tests

4 files
+ 27
65
Compare changes
  • Side-by-side
  • Inline
Files
4
package gov.usgs.earthquake.nshmp.model;
import java.io.IOException;
import java.util.stream.Stream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import gov.usgs.earthquake.nshmp.NamedLocation;
import gov.usgs.earthquake.nshmp.model.NshmTestUtils.Nshm;
import gov.usgs.earthquake.nshmp.model.NshmTestUtils.NshmModel;
@TestInstance(Lifecycle.PER_CLASS)
@Execution(ExecutionMode.CONCURRENT)
class Conus2018Tests {
Nshm nshm = NshmTests.NSHMS.get("nshm-conus-2018");
NshmModel nshmModel;
@BeforeAll
void load() {
nshmModel = NshmTestUtils.loadModel(nshm);
}
@AfterAll
void stop() {
nshmModel.exec.shutdown();
}
@ParameterizedTest
@MethodSource("conusSites")
final void testConus2018(NamedLocation location) throws IOException {
NshmTestUtils.testNshm(nshmModel, location);
}
private static Stream<NamedLocation> conusSites() {
return NshmTests.CONUS_LOCATIONS.stream();
}
}
Loading