Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureListOperationTest.java')
-rw-r--r--org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureListOperationTest.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureListOperationTest.java b/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureListOperationTest.java
new file mode 100644
index 0000000000..1591bdab2b
--- /dev/null
+++ b/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureListOperationTest.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.gitflow.op;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.eclipse.egit.gitflow.GitFlowRepository;
+import static org.eclipse.jgit.lib.Constants.*;
+import org.eclipse.jgit.lib.Ref;
+import org.junit.Test;
+
+import static org.eclipse.egit.gitflow.op.AbstractFeatureOperation.*;
+
+public class FeatureListOperationTest extends AbstractDualRepositoryTestCase {
+ @Test
+ public void testFeatureList() throws Exception {
+ GitFlowRepository gfRepo1 = new GitFlowRepository(
+ repository1.getRepository());
+ GitFlowRepository gfRepo2 = new GitFlowRepository(
+ repository2.getRepository());
+ new FeatureStartOperation(gfRepo1, MY_FEATURE).execute(null);
+
+ FeatureListOperation featureListOperation = new FeatureListOperation(
+ gfRepo2, 0);
+ featureListOperation.execute(null);
+ String name = gfRepo2.getConfig().getFullFeatureBranchName(MY_FEATURE);
+ assertNotNull(featureListOperation.getOperationResult()
+ .getAdvertisedRef(name));
+ List<Ref> result = featureListOperation.getResult();
+ assertEquals(1, result.size());
+ assertEquals(
+ R_REMOTES + DEFAULT_REMOTE_NAME + SEP
+ + gfRepo2.getConfig().getFeatureBranchName(MY_FEATURE),
+ result.get(0).getName());
+ }
+}

Back to the top