Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-11-20 20:47:22 +0000
committerThomas Wolf2019-11-23 16:34:17 +0000
commit1009fc591d26f3eb824d7c42edaefa9d9799cf72 (patch)
tree4b3920e9f040b895eb21fd7164d57f20982cda93 /org.eclipse.egit.ui.test
parent89de01fb8835e9840f302a78d3f8f8b342097294 (diff)
downloadegit-1009fc591d26f3eb824d7c42edaefa9d9799cf72.tar.gz
egit-1009fc591d26f3eb824d7c42edaefa9d9799cf72.tar.xz
egit-1009fc591d26f3eb824d7c42edaefa9d9799cf72.zip
Ref filter dialog: use standard Eclipse variable syntax
Use "${git_branch}" instead of "[CURRENT-BRANCH]". Adjust the explanation and the tests accordingly. GitHistoryReffilterConfigurationDialogTest didn't work on OS X. First, the key events were not sent on the UI thread, and second, they never arrived at the cell editor. Rewrite this part to use normal setText() following the example given by the SWTBot developers.[1] [1] https://github.com/ketan/swtbot/blob/master/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTableClickTest.java Bug: 553072 Change-Id: I8d092c0035b1d5cb3025552e5022a6b5ac53054f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/GitHistoryRefFilterConfigurationDialogTest.java87
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/RefFilterHelperTest.java44
3 files changed, 54 insertions, 81 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/GitHistoryRefFilterConfigurationDialogTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/GitHistoryRefFilterConfigurationDialogTest.java
index 954013d12d..6065e20274 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/GitHistoryRefFilterConfigurationDialogTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/GitHistoryRefFilterConfigurationDialogTest.java
@@ -40,10 +40,7 @@ import org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTestUtils;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
@@ -103,7 +100,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilter> testFilters = new ArrayList<>();
testFilters.add(newRefFilter("HEAD", true, false));
- testFilters.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true, false));
+ testFilters.add(newRefFilter("refs/**/${git_branch}", true, false));
testFilters.add(newRefFilter("refs/heads/**", true, true));
testFilters.add(newRefFilter("refs/remotes/**", true, false));
testFilters.add(newRefFilter("refs/tags/**", true, false));
@@ -152,7 +149,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilter> defaults = new ArrayList<>();
defaults.add(newRefFilter("HEAD", true, true));
- defaults.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true, false));
+ defaults.add(newRefFilter("refs/**/${git_branch}", true, false));
defaults.add(newRefFilter("refs/heads/**", true, false));
defaults.add(newRefFilter("refs/remotes/**", true, false));
defaults.add(newRefFilter("refs/tags/**", true, false));
@@ -172,7 +169,9 @@ public class GitHistoryRefFilterConfigurationDialogTest
@After
public void teardown() {
myRepoViewUtil.dispose();
- display.asyncExec(dialog::close);
+ if (dialog != null) {
+ display.asyncExec(dialog::close);
+ }
}
private static class RefFilterInfo {
@@ -310,7 +309,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -330,7 +329,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, true));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -351,7 +350,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, true));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -371,7 +370,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -392,7 +391,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -413,7 +412,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -424,48 +423,22 @@ public class GitHistoryRefFilterConfigurationDialogTest
verifyTableContentsClickOkAndVerifyResult(expected);
}
- private Event createEvent(Control control) {
- Event event = new Event();
- event.keyCode = SWT.NONE;
- event.stateMask = SWT.NONE;
- event.doit = true;
- event.widget = control;
- event.button = 1;
- return event;
- }
-
- private void keyEvent(Control control, int keyCode) {
- Event event = createEvent(control);
- event.button = 0;
- event.type = SWT.KeyDown;
- event.keyCode = keyCode;
- event.character = (char) keyCode;
-
- Display.getDefault().post(event);
-
- event.type = SWT.KeyUp;
-
- Display.getDefault().post(event);
- }
-
- private void typeTextAndEnter(String text) {
- Control c = dialog.getShell();
- for (int i = 0; i < text.length(); i++) {
- keyEvent(c, text.charAt(i));
- }
- keyEvent(c, 13);
+ private void typeTextAndApply(String text) {
+ bot.text(0).setText(text);
+ // Click somewhere else; the editor applies its value
+ bot.table().click(0, 0);
}
@Test
public void testAdd() throws Exception {
click(UIText.GitHistoryPage_filterRefDialog_button_add);
- typeTextAndEnter("added");
+ typeTextAndApply("added");
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -518,7 +491,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -539,7 +512,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -555,12 +528,12 @@ public class GitHistoryRefFilterConfigurationDialogTest
table.getTableItem(5).select();
click(UIText.GitHistoryPage_filterRefDialog_button_edit);
- typeTextAndEnter("edited");
+ typeTextAndApply("edited");
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -577,12 +550,12 @@ public class GitHistoryRefFilterConfigurationDialogTest
SWTBotTableItem item = table.getTableItem(5);
item.doubleClick();
- typeTextAndEnter("edited");
+ typeTextAndApply("edited");
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -601,7 +574,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, true));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -618,7 +591,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, false));
- expected.add(new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, true));
+ expected.add(new RefFilterInfo("refs/**/${git_branch}", true, true));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -636,7 +609,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, true));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, true));
expected.add(new RefFilterInfo("refs/remotes/**", true, true));
expected.add(new RefFilterInfo("refs/tags/**", true, true));
@@ -654,7 +627,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, true));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -671,7 +644,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
List<RefFilterInfo> expected = new ArrayList<>();
expected.add(new RefFilterInfo("HEAD", true, true));
expected.add(
- new RefFilterInfo("refs/**/[CURRENT-BRANCH]", true, false));
+ new RefFilterInfo("refs/**/${git_branch}", true, false));
expected.add(new RefFilterInfo("refs/heads/**", true, false));
expected.add(new RefFilterInfo("refs/remotes/**", true, false));
expected.add(new RefFilterInfo("refs/tags/**", true, false));
@@ -724,7 +697,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
public void testCancelAfterAdd() throws Exception {
click(UIText.GitHistoryPage_filterRefDialog_button_add);
- typeTextAndEnter("added");
+ typeTextAndApply("added");
clickCancel();
verify(refFilterHelper, Mockito.never())
@@ -737,7 +710,7 @@ public class GitHistoryRefFilterConfigurationDialogTest
table.getTableItem(5).select();
click(UIText.GitHistoryPage_filterRefDialog_button_edit);
- typeTextAndEnter("edited");
+ typeTextAndApply("edited");
clickCancel();
verify(refFilterHelper, Mockito.never())
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
index 4190306773..c17ce589ea 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -670,10 +670,10 @@ public class HistoryViewTest extends GitRepositoriesViewTestBase {
uncheckRefFilter(selectedRefs, "HEAD");
assertNoCommit(table);
- checkRefFilter(selectedRefs, "refs/**/[CURRENT-BRANCH]");
+ checkRefFilter(selectedRefs, "refs/**/${git_branch}");
assertCommitsAfterBase(table, "testDa", "testDb");
- uncheckRefFilter(selectedRefs, "refs/**/[CURRENT-BRANCH]");
+ uncheckRefFilter(selectedRefs, "refs/**/${git_branch}");
assertNoCommit(table);
checkRefFilter(selectedRefs, "refs/heads/**");
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/RefFilterHelperTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/RefFilterHelperTest.java
index fb99454f32..97c5971ba1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/RefFilterHelperTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/RefFilterHelperTest.java
@@ -257,7 +257,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, true));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, false));
+ newRefFilterMatcher("refs/**/${git_branch}", true, false));
expected.add(newRefFilterMatcher("refs/heads/**", true, false));
expected.add(newRefFilterMatcher("refs/remotes/**", true, false));
expected.add(newRefFilterMatcher("refs/tags/**", true, false));
@@ -276,7 +276,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
.thenReturn("HEAD:test");
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -288,7 +288,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, true));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, false));
+ newRefFilterMatcher("refs/**/${git_branch}", true, false));
expected.add(newRefFilterMatcher("refs/heads/**", true, false));
expected.add(newRefFilterMatcher("refs/remotes/**", true, false));
expected.add(newRefFilterMatcher("refs/tags/**", true, false));
@@ -305,7 +305,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testSetFilters() throws Exception {
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -333,7 +333,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testSaveSelectionStateAsLastSelectionState() throws Exception {
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -398,7 +398,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
throws Exception {
checkMatchingRefsForSelectedRefFilters("HEAD",
Arrays.asList(ref(equalTo("HEAD"))));
- checkMatchingRefsForSelectedRefFilters("refs/**/[CURRENT-BRANCH]",
+ checkMatchingRefsForSelectedRefFilters("refs/**/${git_branch}",
Arrays.asList(ref(equalTo("refs/heads/master")),
ref(equalTo("refs/remotes/origin/master"))));
checkMatchingRefsForSelectedRefFilters("refs/heads/**",
@@ -414,7 +414,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testSelectOnlyHEAD() throws Exception {
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -426,7 +426,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, true));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, false));
+ newRefFilterMatcher("refs/**/${git_branch}", true, false));
expected.add(newRefFilterMatcher("refs/heads/**", true, false));
expected.add(newRefFilterMatcher("refs/remotes/**", true, false));
expected.add(newRefFilterMatcher("refs/tags/**", true, false));
@@ -443,7 +443,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testIsOnlyHEADSelected() throws Exception {
Set<RefFilter> testSet1 = new HashSet<>();
testSet1.add(newRefFilter("HEAD", true, false));
- testSet1.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet1.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet1.add(newRefFilter("refs/heads/**", true, true));
testSet1.add(
@@ -458,7 +458,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet2 = new HashSet<>();
testSet2.add(newRefFilter("HEAD", true, true));
- testSet2.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet2.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet2.add(newRefFilter("refs/heads/**", true, true));
testSet2.add(
@@ -473,7 +473,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet3 = new HashSet<>();
testSet3.add(newRefFilter("HEAD", true, true));
- testSet3.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet3.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet3.add(newRefFilter("refs/heads/**", true, false));
testSet3.add(
@@ -492,7 +492,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testSelectOnlyCurrentBranch() throws Exception {
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -504,7 +504,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, false));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, true));
+ newRefFilterMatcher("refs/**/${git_branch}", true, true));
expected.add(newRefFilterMatcher("refs/heads/**", true, false));
expected.add(newRefFilterMatcher("refs/remotes/**", true, false));
expected.add(newRefFilterMatcher("refs/tags/**", true, false));
@@ -521,7 +521,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testIsOnlyCurrentBranchSelected() throws Exception {
Set<RefFilter> testSet1 = new HashSet<>();
testSet1.add(newRefFilter("HEAD", true, false));
- testSet1.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet1.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet1.add(newRefFilter("refs/heads/**", true, true));
testSet1.add(
@@ -536,7 +536,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet2 = new HashSet<>();
testSet2.add(newRefFilter("HEAD", true, false));
- testSet2.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet2.add(newRefFilter("refs/**/${git_branch}",
true, true));
testSet2.add(newRefFilter("refs/heads/**", true, true));
testSet2.add(
@@ -551,7 +551,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet3 = new HashSet<>();
testSet3.add(newRefFilter("HEAD", true, false));
- testSet3.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet3.add(newRefFilter("refs/**/${git_branch}",
true, true));
testSet3.add(newRefFilter("refs/heads/**", true, false));
testSet3.add(
@@ -570,7 +570,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testSelectExactlyAllBranchesAndTags() throws Exception {
Set<RefFilter> testSet = new HashSet<>();
testSet.add(newRefFilter("HEAD", true, false));
- testSet.add(newRefFilter("refs/**/[CURRENT-BRANCH]", true,
+ testSet.add(newRefFilter("refs/**/${git_branch}", true,
false));
testSet.add(newRefFilter("refs/heads/**", true, true));
testSet.add(newRefFilter("refs/remotes/**", true, false));
@@ -582,7 +582,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, true));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, false));
+ newRefFilterMatcher("refs/**/${git_branch}", true, false));
expected.add(newRefFilterMatcher("refs/heads/**", true, true));
expected.add(newRefFilterMatcher("refs/remotes/**", true, true));
expected.add(newRefFilterMatcher("refs/tags/**", true, true));
@@ -599,7 +599,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
public void testIsExactlyAllBranchesAndTagsSelected() throws Exception {
Set<RefFilter> testSet1 = new HashSet<>();
testSet1.add(newRefFilter("HEAD", true, false));
- testSet1.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet1.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet1.add(newRefFilter("refs/heads/**", true, true));
testSet1.add(
@@ -614,7 +614,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet2 = new HashSet<>();
testSet2.add(newRefFilter("HEAD", true, true));
- testSet2.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet2.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet2.add(newRefFilter("refs/heads/**", true, true));
testSet2.add(newRefFilter("refs/remotes/**", true, true));
@@ -628,7 +628,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
Set<RefFilter> testSet3 = new HashSet<>();
testSet3.add(newRefFilter("HEAD", true, true));
- testSet3.add(newRefFilter("refs/**/[CURRENT-BRANCH]",
+ testSet3.add(newRefFilter("refs/**/${git_branch}",
true, false));
testSet3.add(newRefFilter("refs/heads/**", true, true));
testSet3.add(newRefFilter("refs/remotes/**", true, true));
@@ -655,7 +655,7 @@ public class RefFilterHelperTest extends LocalRepositoryTestCase {
List<Matcher<? super RefFilter>> expected = new ArrayList<>();
expected.add(newRefFilterMatcher("HEAD", true, true));
expected.add(
- newRefFilterMatcher("refs/**/[CURRENT-BRANCH]", true, false));
+ newRefFilterMatcher("refs/**/${git_branch}", true, false));
expected.add(newRefFilterMatcher("refs/heads/**", true, false));
expected.add(newRefFilterMatcher("refs/remotes/**", true, false));
expected.add(newRefFilterMatcher("refs/tags/**", true, false));

Back to the top