Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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