From 89783fd8b12b50270d561017d5481de089d86d70 Mon Sep 17 00:00:00 2001 From: hansonr Date: Tue, 27 Aug 2019 23:52:24 -0500 Subject: [PATCH] JAL-3253-applet JAL-3423 Windows TestNG mac CTRL test is only for Macs. --- test/jalview/gui/PairwiseAlignmentPanelTest.java | 10 ++++++---- test/jalview/util/PlatformTest.java | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/jalview/gui/PairwiseAlignmentPanelTest.java b/test/jalview/gui/PairwiseAlignmentPanelTest.java index 3322ee8..e74849f 100644 --- a/test/jalview/gui/PairwiseAlignmentPanelTest.java +++ b/test/jalview/gui/PairwiseAlignmentPanelTest.java @@ -9,10 +9,10 @@ import jalview.io.FileLoader; import javax.swing.JTextArea; -import junit.extensions.PA; - import org.testng.annotations.Test; +import junit.extensions.PA; + public class PairwiseAlignmentPanelTest { @Test(groups = "Functional") @@ -37,7 +37,8 @@ public class PairwiseAlignmentPanelTest PairwiseAlignPanel testee = new PairwiseAlignPanel(viewport); - String text = ((JTextArea) PA.getValue(testee, "textarea")).getText(); + String text = ((JTextArea) PA.getValue(testee, "textarea")).getText() + .replaceAll("\r", ""); String expected = "Score = 80.0\n" + "Length of alignment = 4\n" + "Sequence FER1_PEA/29-32 (Sequence length = 7)\n" + "Sequence Q93XJ9_SOLTU/23-26 (Sequence length = 7)\n\n" @@ -62,7 +63,8 @@ public class PairwiseAlignmentPanelTest PairwiseAlignPanel testee = new PairwiseAlignPanel(viewport); - String text = ((JTextArea) PA.getValue(testee, "textarea")).getText(); + String text = ((JTextArea) PA.getValue(testee, "textarea")).getText() + .replaceAll("\r", ""); String expected = "Score = 80.0\n" + "Length of alignment = 4\n" + "Sequence FER1_PEA/29-32 (Sequence length = 7)\n" + "Sequence Q93XJ9_SOLTU/23-26 (Sequence length = 7)\n\n" diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index 5052894..c8616ad 100644 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@ -53,11 +53,16 @@ public class PlatformTest public void testIsControlDown_mac() { String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); - if ("sun.awt.X11.XToolkit".equals(toolkit)) + if (toolkit.endsWith("XToolkit") || toolkit.endsWith("WToolkit")) { /* * this toolkit on the build server fails these tests, * because it returns 2, not 4, for getMenuShortcutKeyMask + * + * Same for windows, because the Platform test "mac" must match the + * actual platform that is running the test. + * + * */ return; } -- 1.7.10.2