Skip to content
Permalink
Browse files

[JENKINS-41124] Fix the one failing test (I hope)

  • Loading branch information...
stephenc committed Jan 19, 2017
1 parent 089eac1 commit c9730b16046b09d57e3e41902a37379f371b3757
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/test/java/com/cloudbees/hudson/plugins/folder/ChildNameGeneratorTest.java
@@ -222,8 +222,15 @@ public static String encode(String s) {
}

public static String mangle(String s) {
String hash = Util.getDigestOf(s);
String base = Normalizer.normalize(s, Normalizer.Form.NFD).toLowerCase(Locale.ENGLISH);
// NOTE: some file systems can use a different normalization strategy so we break from the ideal
// and force normalization to a particular form in order to ensure the test is filesystem independent
//
// individual real implementations should probably make a careful decision with regards to normalization
// where they are unable to recover the legacy name from the item's config and thus have to rely
// on the name on disk in the filesystem.
String normalized = Normalizer.normalize(s, Normalizer.Form.NFD);
String hash = Util.getDigestOf(normalized);
String base = normalized.toLowerCase(Locale.ENGLISH);
StringBuilder buf = new StringBuilder(32);
for (char c : base.toCharArray()) {
if (buf.length() >= 8) break;

0 comments on commit c9730b1

Please sign in to comment.
You can’t perform that action at this time.