Skip to content

Commit

Permalink
Fixing dir listing in test to not be case sensitive (related to JENKI…
Browse files Browse the repository at this point in the history
  • Loading branch information
tfennelly committed Aug 27, 2014
1 parent f39c435 commit 80f78d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/src/test/java/hudson/model/UserTest.java
Expand Up @@ -231,7 +231,10 @@ public IdStrategy getUserIdStrategy() {
assertEquals("Bob Smith", bob.getFullName());
assertEquals("Bob Smith", User.get("Bob").getFullName());
assertEquals("nonexistent", User.get("nonexistent").getFullName());
assertEquals("[bob]", Arrays.toString(new File(j.jenkins.getRootDir(), "users").list()));

// users/Bob is what exists in migration.zip, so lowercasing dir list to make sure the test
// is not case sensitive.
assertEquals("[bob]", Arrays.toString(new File(j.jenkins.getRootDir(), "users").list()).toLowerCase());
}

@Test
Expand Down

3 comments on commit 80f78d5

@jglick
Copy link
Member

@jglick jglick commented on 80f78d5 Aug 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wrong to me; subverts the intent of the test. If this was failing for you, the migration really was failing to work as expected. User.getOrCreate calls File.renameTo and so should be moving Bob/ to bob/. If this does not work on some platforms then it is the code which should be fixed, not the test.

@jglick
Copy link
Member

@jglick jglick commented on 80f78d5 Aug 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And CC @stephenc since the test is to fix a problem in the migration he originally wrote.

@jglick
Copy link
Member

@jglick jglick commented on 80f78d5 Aug 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will amend this commit.

Please sign in to comment.