Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2018-05-17 16:47:24 -0400
committerWim Jongman2018-05-21 11:52:11 -0400
commit22cef14145400b4f47d47c0f74e6f33a8dab1719 (patch)
tree7c68b5e64386d83cc1ade8ce6de4747ad66740e9 /org.eclipse.tips.tests
parent6c2c96714c5c1add856dc0baf9042d122e6e06a0 (diff)
downloadeclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.tar.gz
eclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.tar.xz
eclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.zip
Bug 534376: [Tips] (fetch) job runs even if I have disabled tipsI20180521-2000
* Added "Disabled" Option * Tips startup default can be controlled by property * Fixed internal api * Fixed documentation * Fixed tests * V3 fixed preferences initializer * V4 lightbulb in trim goes away in "Disabled" mode * V5 replaced combo with menu * V6 replaced tip to reflect new menu Change-Id: I958c1d583948341ef3ef0587655bdf1b78a4f0a4 Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
Diffstat (limited to 'org.eclipse.tips.tests')
-rw-r--r--org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipManager.java10
-rw-r--r--org.eclipse.tips.tests/src/org/eclipse/tips/core/TipImageURLTest.java4
-rw-r--r--org.eclipse.tips.tests/src/org/eclipse/tips/core/TipManagerTest.java35
-rw-r--r--org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/SleakTipManager.java2
4 files changed, 27 insertions, 24 deletions
diff --git a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipManager.java b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipManager.java
index 85c016b27..ce823a2a6 100644
--- a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipManager.java
+++ b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipManager.java
@@ -20,18 +20,18 @@ import org.eclipse.tips.core.internal.TipManager;
@SuppressWarnings("restriction")
public class TestTipManager extends TipManager {
- private boolean fShouldRun = true;
private List<Integer> fReadList = new ArrayList<>();
+ private int fStartupBehavior = TipManager.START_DIALOG;
@Override
- public TipManager setRunAtStartup(boolean shouldRun) {
- fShouldRun = shouldRun;
+ public TipManager setStartupBehavior(int pStartupBehavior) {
+ fStartupBehavior = pStartupBehavior;
return this;
}
@Override
- public boolean isRunAtStartup() {
- return fShouldRun;
+ public int getStartupBehavior() {
+ return fStartupBehavior;
}
@Override
diff --git a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipImageURLTest.java b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipImageURLTest.java
index c182d09fe..6d52977de 100644
--- a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipImageURLTest.java
+++ b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipImageURLTest.java
@@ -92,12 +92,12 @@ public class TipImageURLTest {
}
@Test
- public void testSetExtension() throws IOException {
+ public void testSetExtension() {
// assertTrue(getTipImage().getIMGAttributes(19, 10).contains("png"));
}
@Test
- public void testSetExtension2() throws IOException {
+ public void testSetExtension2() {
// assertTrue(getTipImage().setExtension("bmp").getBase64Image().contains("bmp"));
// assertTrue(getTipImage().getIMGAttributes(19, 10).contains("png"));
}
diff --git a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipManagerTest.java b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipManagerTest.java
index 2ef74005e..dd3fd19c3 100644
--- a/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipManagerTest.java
+++ b/org.eclipse.tips.tests/src/org/eclipse/tips/core/TipManagerTest.java
@@ -64,17 +64,20 @@ public class TipManagerTest {
}
@Test
- public void testIsRunAtStartup() {
- assertTrue(fManager.isRunAtStartup());
- fManager.setRunAtStartup(false);
- assertTrue(!fManager.isRunAtStartup());
- }
+ public void testGetStartupBeahvior() {
+ assertTrue(fManager.getStartupBehavior() == TipManager.START_DIALOG);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_BACKGROUND);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_DISABLE);
- @Test
- public void testSetRunAtStartup() {
- assertTrue(fManager.isRunAtStartup());
- fManager.setRunAtStartup(false);
- assertTrue(!fManager.isRunAtStartup());
+ fManager.setStartupBehavior(TipManager.START_BACKGROUND);
+ assertTrue(fManager.getStartupBehavior() == TipManager.START_BACKGROUND);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_DIALOG);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_DISABLE);
+
+ fManager.setStartupBehavior(TipManager.START_DISABLE);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_BACKGROUND);
+ assertTrue(fManager.getStartupBehavior() != TipManager.START_DIALOG);
+ assertTrue(fManager.getStartupBehavior() == TipManager.START_DISABLE);
}
@Test
@@ -147,8 +150,8 @@ public class TipManagerTest {
@Test
public void testIsRead() {
fManager.register(fProvider1);
- fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(),"<b>bold</b>", "Tip 1"),
- new TestTip(fProvider1.getID(),"<b>bold2</b>", "Tip 2")));
+ fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(), "<b>bold</b>", "Tip 1"),
+ new TestTip(fProvider1.getID(), "<b>bold2</b>", "Tip 2")));
fManager.setAsRead(fProvider1.getCurrentTip());
assertTrue(fManager.isRead(fProvider1.getCurrentTip()));
}
@@ -156,8 +159,8 @@ public class TipManagerTest {
@Test
public void testSetRead() {
fManager.register(fProvider1);
- fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(),"<b>bold</b>", "Tip 1"),
- new TestTip(fProvider1.getID(),"<b>bold2</b>", "Tip 2")));
+ fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(), "<b>bold</b>", "Tip 1"),
+ new TestTip(fProvider1.getID(), "<b>bold2</b>", "Tip 2")));
fManager.setAsRead(fProvider1.getCurrentTip());
assertTrue(fManager.isRead(fProvider1.getCurrentTip()));
}
@@ -165,8 +168,8 @@ public class TipManagerTest {
@Test
public void testSetServeUnread() {
fManager.register(fProvider1);
- fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(),"<b>bold</b>", "Tip 1"),
- new TestTip(fProvider1.getID(),"<b>bold2</b>", "Tip 2")));
+ fProvider1.setTips(Arrays.asList(new TestTip(fProvider1.getID(), "<b>bold</b>", "Tip 1"),
+ new TestTip(fProvider1.getID(), "<b>bold2</b>", "Tip 2")));
fManager.setAsRead(fProvider1.getCurrentTip());
assertTrue(fProvider1.getTips().size() + "", fProvider1.getTips().size() == 1);
fManager.setServeReadTips(true);
diff --git a/org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/SleakTipManager.java b/org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/SleakTipManager.java
index 9d2de1702..bca0a2179 100644
--- a/org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/SleakTipManager.java
+++ b/org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/SleakTipManager.java
@@ -116,7 +116,7 @@ public class SleakTipManager extends TipManager {
}
@Override
- public TipManager setRunAtStartup(boolean pShouldRun) {
+ public TipManager setStartupBehavior(int pStartupBehavior) {
return this;
}

Back to the top