Skip to content
Permalink
Browse files

[JENKINS-41124] Remove normalization left in by mistake when trying t…

…o make the test deterministic on all File systems

- Unnecessary now that we detect the normalization scheme of the system under test
  • Loading branch information...
stephenc committed Jan 20, 2017
1 parent c419016 commit 93e075a54da18f01b3c1336304eb1ddeea5e8768
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/test/java/com/cloudbees/hudson/plugins/folder/ChildNameGeneratorTest.java
@@ -273,6 +273,15 @@ private void checkChild(ComputedFolderImpl instance, String idealName) throws IO
assertThat("We have an item for name " + idealName, item, notNullValue());
assertThat("The root directory of the item for name " + idealName + " is mangled",
item.getRootDir().getName(), is(mangle(idealName)));
String altEncoding = Normalizer.normalize(idealName, Normalizer.Form.NFD);
if (idealName.equals(altEncoding)) {
altEncoding = Normalizer.normalize(idealName, Normalizer.Form.NFC);
}
if (!idealName.equals(altEncoding)) {
File altRootDir = instance.getRootDirFor(altEncoding);
assertThat("Alternative normalized form: " + altRootDir + " does not exist",
altRootDir.isDirectory(), is(false));
}
File nameFile = new File(item.getRootDir(), ChildNameGenerator.CHILD_NAME_FILE);
assertThat("We have the " + ChildNameGenerator.CHILD_NAME_FILE + " for the item for name " + idealName,
nameFile.isFile(), is(true));
@@ -591,14 +600,14 @@ public String dirNameFromItem(@Nonnull F parent,
@Override
public String itemNameFromLegacy(@Nonnull F parent,
@Nonnull String legacyDirName) {
return encode(Normalizer.normalize(legacyDirName, Normalizer.Form.NFC));
return encode(legacyDirName);
}

@Nonnull
@Override
public String dirNameFromLegacy(@Nonnull F parent,
@Nonnull String legacyDirName) {
return mangle(Normalizer.normalize(legacyDirName, Normalizer.Form.NFC));
return mangle(legacyDirName);
}

@Override

0 comments on commit 93e075a

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