use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class MetadataTranslaterTest method testActiveStationIsTranslatedToJson.
@Test
public void testActiveStationIsTranslatedToJson() throws Exception {
Survey survey = new Survey("test");
String translated = MetadataTranslater.translate(survey);
String expected = "{\"active-station\":\"1\",\"connections\":{}}";
Assert.assertEquals(expected, translated.replaceAll("\\s", ""));
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurvexImporterTest method testBasicImportRecordsPromotions.
@Test
public void testBasicImportRecordsPromotions() throws Exception {
final String testContent = "1\t2\t5.0\t0.0\t0.0\t; {from: 5.0 0.0 0.0, 5.0 0.0 0.0, 5.0 0.0 0.0}";
Survey survey = new Survey("Test");
SurvexImporter.parse(testContent, survey);
Leg leg = survey.getOrigin().getConnectedOnwardLegs().get(0);
Assert.assertEquals(3, leg.getPromotedFrom().length);
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyJsonTranslaterTest method testSlightlyBiggerSurveyIsParsed.
@Test
public void testSlightlyBiggerSurveyIsParsed() throws Exception {
Survey survey = BasicTestSurveyCreator.createRightRight();
String text = SurveyJsonTranslater.toText(survey, "test", 0);
Survey newSurvey = new Survey(TEST_SURVEY_NAME);
SurveyJsonTranslater.populateSurvey(survey, text);
SurveyChecker.areEqual(survey, newSurvey);
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyJsonTranslaterTest method testEmptySurveyResultsIn1Station.
@Test
public void testEmptySurveyResultsIn1Station() throws Exception {
Survey survey = new Survey(TEST_SURVEY_NAME);
String text = SurveyJsonTranslater.toText(survey, "test", 0);
Survey newSurvey = new Survey(TEST_SURVEY_NAME);
SurveyJsonTranslater.populateSurvey(survey, text);
assert newSurvey.getAllStations().size() == 1;
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyJsonTranslaterTest method testRandomSurveyIsParsed.
@Test
public void testRandomSurveyIsParsed() throws Exception {
Survey survey = TestSurveyCreator.create(TEST_SURVEY_NAME, 10, 10);
String text = SurveyJsonTranslater.toText(survey, "test", 0);
Survey newSurvey = new Survey(TEST_SURVEY_NAME);
SurveyJsonTranslater.populateSurvey(survey, text);
SurveyChecker.areEqual(survey, newSurvey);
}
Aggregations