use of com.graphhopper.routing.ProfileResolver in project graphhopper by graphhopper.
the class LMProfileSelectorTest method assertLMProfileSelectionError.
private String assertLMProfileSelectionError(String expectedError, List<Profile> profiles, List<LMProfile> lmProfiles, String vehicle, String weighting, Boolean edgeBased, Integer uTurnCosts) {
PMap hintsMap = createHintsMap(vehicle, weighting, edgeBased, uTurnCosts);
try {
new ProfileResolver(encodingManager, profiles, Collections.<CHProfile>emptyList(), lmProfiles).selectProfileLM(hintsMap);
fail("There should have been an error");
return "";
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().contains(expectedError), "There should have been an error message containing:\n'" + expectedError + "'\nbut was:\n'" + e.getMessage() + "'");
return e.getMessage();
}
}
use of com.graphhopper.routing.ProfileResolver in project graphhopper by graphhopper.
the class LMProfileSelectorTest method assertProfileFound.
private void assertProfileFound(Profile expectedProfile, List<Profile> profiles, List<LMProfile> lmProfiles, String vehicle, String weighting, Boolean edgeBased, Integer uTurnCosts) {
PMap hintsMap = createHintsMap(vehicle, weighting, edgeBased, uTurnCosts);
try {
Profile selectedProfile = new ProfileResolver(encodingManager, profiles, Collections.<CHProfile>emptyList(), lmProfiles).selectProfileLM(hintsMap);
assertEquals(expectedProfile, selectedProfile);
} catch (IllegalArgumentException e) {
fail("no profile found\nexpected: " + expectedProfile + "\nerror: " + e.getMessage());
}
}
use of com.graphhopper.routing.ProfileResolver in project graphhopper by graphhopper.
the class CHProfileSelectorTest method assertProfileFound.
private void assertProfileFound(Profile expectedProfile, List<Profile> profiles, List<CHProfile> chProfiles, String vehicle, String weighting, Boolean edgeBased, Integer uTurnCosts) {
PMap hintsMap = createHintsMap(vehicle, weighting, edgeBased, uTurnCosts);
try {
Profile selectedProfile = new ProfileResolver(encodingManager, profiles, chProfiles, Collections.<LMProfile>emptyList()).selectProfileCH(hintsMap);
assertEquals(expectedProfile, selectedProfile);
} catch (IllegalArgumentException e) {
fail("no profile found\nexpected: " + expectedProfile + "\nerror: " + e.getMessage());
}
}
use of com.graphhopper.routing.ProfileResolver in project graphhopper by graphhopper.
the class CHProfileSelectorTest method assertCHProfileSelectionError.
private String assertCHProfileSelectionError(String expectedError, List<Profile> profiles, List<CHProfile> chProfiles, String vehicle, String weighting, Boolean edgeBased, Integer uTurnCosts) {
PMap hintsMap = createHintsMap(vehicle, weighting, edgeBased, uTurnCosts);
try {
new ProfileResolver(encodingManager, profiles, chProfiles, Collections.<LMProfile>emptyList()).selectProfileCH(hintsMap);
fail("There should have been an error");
return "";
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().contains(expectedError), "There should have been an error message containing:\n'" + expectedError + "'\nbut was:\n'" + e.getMessage() + "'");
return e.getMessage();
}
}
Aggregations