Merge branch 'maint-rel-1.6' into develop

This commit is contained in:
j2blake 2013-11-20 10:18:10 -05:00
commit 2978813f2c

View file

@ -286,18 +286,20 @@ public class FreemarkerTemplateLoaderTest {
* would. * would.
*/ */
private void assertFM(String searchTerm, int expectedNumberOfTries, private void assertFM(String searchTerm, int expectedNumberOfTries,
String expectedBestFit) { String expectedBestString) {
Path expectedBestFit = expectedBestString == null ? null : Paths
.get(expectedBestString);
PathPieces stPp = new PathPieces(searchTerm); PathPieces stPp = new PathPieces(searchTerm);
int actualNumberOfTries = 0; int actualNumberOfTries = 0;
String actualBestFit = null; Path actualBestFit = null;
if (StringUtils.isNotBlank(stPp.region)) { if (StringUtils.isNotBlank(stPp.region)) {
actualNumberOfTries++; actualNumberOfTries++;
SortedSet<PathPieces> matches = runTheVisitor(stPp.base SortedSet<PathPieces> matches = runTheVisitor(stPp.base
+ stPp.language + stPp.region + stPp.extension); + stPp.language + stPp.region + stPp.extension);
if (!matches.isEmpty()) { if (!matches.isEmpty()) {
actualBestFit = matches.last().path.toString(); actualBestFit = matches.last().path;
} }
} }
if (actualBestFit == null && StringUtils.isNotBlank(stPp.language)) { if (actualBestFit == null && StringUtils.isNotBlank(stPp.language)) {
@ -305,7 +307,7 @@ public class FreemarkerTemplateLoaderTest {
SortedSet<PathPieces> matches = runTheVisitor(stPp.base SortedSet<PathPieces> matches = runTheVisitor(stPp.base
+ stPp.language + stPp.extension); + stPp.language + stPp.extension);
if (!matches.isEmpty()) { if (!matches.isEmpty()) {
actualBestFit = matches.last().path.toString(); actualBestFit = matches.last().path;
} }
} }
if (actualBestFit == null) { if (actualBestFit == null) {
@ -313,7 +315,7 @@ public class FreemarkerTemplateLoaderTest {
SortedSet<PathPieces> matches = runTheVisitor(stPp.base SortedSet<PathPieces> matches = runTheVisitor(stPp.base
+ stPp.extension); + stPp.extension);
if (!matches.isEmpty()) { if (!matches.isEmpty()) {
actualBestFit = matches.last().path.toString(); actualBestFit = matches.last().path;
} }
} }