-
-
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.
replace most of Deprecated APIs (#12045)
* fix CONSTRAINED_RESIZE_POLICY_FLEX_LAST_COLUMN fix CONSTRAINED_RESIZE_POLICY_FLEX_LAST_COLUMN Deprecated issue in comment * fix override deprecated method fix override deprecated method in IconValidationDecorator * fix Deprecated ANTLRInputStream replace ANTLRInputStream to CharStreams * fix Deprecated BOMInputStream use builder instead. * fix wrong CharStreams method fromFileName -> fromString * fix requested changes 1.fix requested changes 2.add more unit test to support change in IconValidationDecorator * fix last Deprecated API remove Deprecated setGroup * remove unnecessary IOException and add comment remove unnecessary IOException and add comment * revert wrong change revert wrong change with added comment * merge from main merge from main * Discard changes to src/main/java/org/jabref/logic/database/DatabaseMerger.java --------- Co-authored-by: Oliver Kopp <[email protected]>
- Loading branch information
Showing
5 changed files
with
59 additions
and
17 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
50 changes: 50 additions & 0 deletions
50
src/test/java/org/jabref/logic/util/IconValidationDecoratorTest.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,50 @@ | ||
package org.jabref.logic.util; | ||
|
||
import javafx.scene.control.Control; | ||
import javafx.scene.control.Label; | ||
|
||
import org.jabref.gui.icon.IconTheme; | ||
import org.jabref.gui.util.IconValidationDecorator; | ||
|
||
import org.controlsfx.validation.Severity; | ||
import org.controlsfx.validation.ValidationMessage; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
import org.testfx.framework.junit5.ApplicationExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
@ExtendWith(ApplicationExtension.class) | ||
public class IconValidationDecoratorTest { | ||
static Object[][] decorationTestData() { | ||
return new Object[][]{ | ||
{Severity.ERROR, IconTheme.JabRefIcons.ERROR.getGraphicNode().toString()}, | ||
{Severity.WARNING, IconTheme.JabRefIcons.WARNING.getGraphicNode().toString()} | ||
}; | ||
} | ||
|
||
@ParameterizedTest | ||
@MethodSource("decorationTestData") | ||
public void createDecorationNodeTest(Severity severity, String expectedGraphic) { | ||
IconValidationDecorator iconValidationDecorator = new IconValidationDecorator(); | ||
Label node = (Label) iconValidationDecorator.createDecorationNode(new ValidationMessage() { | ||
@Override | ||
public String getText() { | ||
return "test"; | ||
} | ||
|
||
@Override | ||
public Severity getSeverity() { | ||
return severity; | ||
} | ||
|
||
@Override | ||
public Control getTarget() { | ||
return null; | ||
} | ||
}); | ||
|
||
assertEquals(node.getGraphic().toString(), expectedGraphic); | ||
} | ||
} |