-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Solved #3823 File annotation: delete hyphens and new lines & wrap summary * Fixed: l10n for remove line breaks * Fixed: final variable name * Revert "Fixed: l10n for remove line breaks" This reverts commit ae2956b. * Fixed: revert changed formatter & wrap marking tooltip * Added: test for FileAnnotation * Fixed: keep newline&hyphen formatter using `\R`
- Loading branch information
1 parent
89f855d
commit 611ac55
Showing
9 changed files
with
71 additions
and
6 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
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
37 changes: 37 additions & 0 deletions
37
src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.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,37 @@ | ||
package org.jabref.gui.entryeditor.fileannotationtab; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Optional; | ||
|
||
import org.jabref.model.pdf.FileAnnotation; | ||
import org.jabref.model.pdf.FileAnnotationType; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class FileAnnotationViewModelTest { | ||
|
||
@Test | ||
public void removeOnlyLineBreaksNotPrecededByPeriodOrColon() { | ||
String content = "This is content"; | ||
String marking = String.format("This is paragraph 1.%n" + | ||
"This is paragr-%naph 2, and it crosses%nseveral lines,%nnow you can see next paragraph:%n" | ||
+ "This is paragraph%n3."); | ||
|
||
FileAnnotation linkedFileAnnotation = new FileAnnotation("John", LocalDateTime.now(), 3, content, FileAnnotationType.FREETEXT, Optional.empty()); | ||
FileAnnotation annotation = new FileAnnotation("Jaroslav Kucha ˇr", LocalDateTime.parse("2017-07-20T10:11:30"), 1, marking, FileAnnotationType.HIGHLIGHT, Optional.of(linkedFileAnnotation)); | ||
|
||
FileAnnotationViewModel annotationViewModel = new FileAnnotationViewModel(annotation); | ||
|
||
assertEquals("Jaroslav Kucha ˇr", annotationViewModel.getAuthor()); | ||
assertEquals(1, annotation.getPage()); | ||
assertEquals("2017-07-20 10:11:30", annotationViewModel.getDate()); | ||
assertEquals("This is content", annotationViewModel.getContent()); | ||
|
||
assertEquals(String.format("This is paragraph 1.%n" + | ||
"This is paragraph 2, and it crosses several lines, now you can see next paragraph:%n" | ||
+ "This is paragraph 3."), | ||
annotationViewModel.getMarking()); | ||
} | ||
} |
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