Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java1
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java13
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishKeepBranchHandlerTest.java11
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishSquashHandlerTest.java10
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureStartFinishHandlerTest.java10
5 files changed, 45 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
index 1377d4008f..a7bf42e2f0 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
@@ -44,6 +44,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa
}
});
selectOptions();
+ bot.checkBox(UIText.FinishFeatureDialog_saveAsDefault).click();
bot.button("OK").click();
preFinish();
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java
index a52e8af58c..c6bee24e0d 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java
@@ -8,6 +8,8 @@
*******************************************************************************/
package org.eclipse.egit.ui.gitflow;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_KEEP_BRANCH;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_SQUASH;
import static org.eclipse.jgit.lib.Constants.R_HEADS;
import java.io.File;
@@ -17,8 +19,10 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.egit.gitflow.GitFlowRepository;
import org.eclipse.egit.gitflow.op.FeatureCheckoutOperation;
import org.eclipse.egit.gitflow.op.FeatureStartOperation;
+import org.eclipse.egit.gitflow.ui.Activator;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.test.TestUtil;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.AbortedByHookException;
@@ -49,6 +53,15 @@ public abstract class AbstractGitflowHandlerTest extends LocalRepositoryTestCase
public void setup() throws Exception {
File repositoryFile = createProjectAndCommitToRepository();
repository = lookupRepository(repositoryFile);
+
+ resetPreferences();
+ }
+
+ private void resetPreferences() {
+ IPreferenceStore prefStore = Activator.getDefault()
+ .getPreferenceStore();
+ prefStore.setValue(FEATURE_FINISH_SQUASH, false);
+ prefStore.setValue(FEATURE_FINISH_KEEP_BRANCH, false);
}
protected RevCommit setContentAddAndCommit(String newContent) throws Exception, GitAPIException, NoHeadException,
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishKeepBranchHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishKeepBranchHandlerTest.java
index 790d7d5378..ce55a26b42 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishKeepBranchHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishKeepBranchHandlerTest.java
@@ -8,11 +8,17 @@
*******************************************************************************/
package org.eclipse.egit.ui.gitflow;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_KEEP_BRANCH;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_SQUASH;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import org.eclipse.egit.gitflow.GitFlowRepository;
+import org.eclipse.egit.gitflow.ui.Activator;
import org.eclipse.egit.gitflow.ui.internal.UIText;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.Test;
@@ -45,6 +51,11 @@ public class FeatureFinishKeepBranchHandlerTest extends
assertEquals(developHead, featureBranchCommit);
assertNotNull(findBranch(gfRepo.getConfig().getFeatureBranchName(FEATURE_NAME)));
+
+ IPreferenceStore prefStore = Activator.getDefault()
+ .getPreferenceStore();
+ assertFalse(prefStore.getBoolean(FEATURE_FINISH_SQUASH));
+ assertTrue(prefStore.getBoolean(FEATURE_FINISH_KEEP_BRANCH));
}
@Override
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishSquashHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishSquashHandlerTest.java
index 01e2a138a8..5393b84b66 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishSquashHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureFinishSquashHandlerTest.java
@@ -8,7 +8,10 @@
*******************************************************************************/
package org.eclipse.egit.ui.gitflow;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_KEEP_BRANCH;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_SQUASH;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
@@ -16,7 +19,9 @@ import java.io.IOException;
import java.util.Iterator;
import org.eclipse.egit.gitflow.GitFlowRepository;
+import org.eclipse.egit.gitflow.ui.Activator;
import org.eclipse.egit.gitflow.ui.internal.UIText;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.NoHeadException;
@@ -64,6 +69,11 @@ public class FeatureFinishSquashHandlerTest extends
assertTrue(developHead.getFullMessage().startsWith(
SQUASHED_COMMENT_SUMMARY));
+
+ IPreferenceStore prefStore = Activator.getDefault()
+ .getPreferenceStore();
+ assertTrue(prefStore.getBoolean(FEATURE_FINISH_SQUASH));
+ assertFalse(prefStore.getBoolean(FEATURE_FINISH_KEEP_BRANCH));
}
private int countCommits() throws GitAPIException, NoHeadException,
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureStartFinishHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureStartFinishHandlerTest.java
index 4583be24ea..d3f145ca56 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureStartFinishHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/FeatureStartFinishHandlerTest.java
@@ -8,10 +8,15 @@
*******************************************************************************/
package org.eclipse.egit.ui.gitflow;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_KEEP_BRANCH;
+import static org.eclipse.egit.gitflow.ui.internal.UIPreferences.FEATURE_FINISH_SQUASH;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import org.eclipse.egit.gitflow.GitFlowRepository;
+import org.eclipse.egit.gitflow.ui.Activator;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.Test;
@@ -43,6 +48,11 @@ public class FeatureStartFinishHandlerTest extends AbstractFeatureFinishHandlerT
assertEquals(developHead, featureBranchCommit);
assertNull(findBranch(gfRepo.getConfig().getFeatureBranchName(FEATURE_NAME)));
+
+ IPreferenceStore prefStore = Activator.getDefault()
+ .getPreferenceStore();
+ assertFalse(prefStore.getBoolean(FEATURE_FINISH_SQUASH));
+ assertFalse(prefStore.getBoolean(FEATURE_FINISH_KEEP_BRANCH));
}
@Override

Back to the top