This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ROO-2745: Post 1.2.0.M1 code refactor and clean up - moved and rename…
…d some File utility methods, fixed potential NPE in FileDetails#hashCode, wrote unit tests, simplified Pom.java
- Loading branch information
Andrew Swan
committed
Oct 27, 2011
1 parent
1195a76
commit 598cc24
Showing
16 changed files
with
405 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
file-monitor/src/test/java/org/springframework/roo/file/monitor/event/FileDetailsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.springframework.roo.file.monitor.event; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.mockito.Mockito.mock; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* Unit test of {@link FileDetails} | ||
* | ||
* @author Andrew Swan | ||
* @since 1.2.0 | ||
*/ | ||
public class FileDetailsTest { | ||
|
||
@Test | ||
public void testInstancesWithSameFileAndNullTimestamp() { | ||
// Set up | ||
final File mockFile = mock(File.class); | ||
final FileDetails fileDetails1 = new FileDetails(mockFile, null); | ||
final FileDetails fileDetails2 = new FileDetails(mockFile, null); | ||
|
||
// Invoke and check | ||
assertTrue(fileDetails1.equals(fileDetails2) && fileDetails2.equals(fileDetails1)); | ||
assertEquals(fileDetails1.hashCode(), fileDetails2.hashCode()); | ||
assertEquals(0, fileDetails1.compareTo(fileDetails2)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.