/******************************************************************************* * Copyright (C) 2015, Max Hohenegger * * 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.ui.gitflow; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.eclipse.egit.gitflow.GitFlowRepository; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.junit.Test; import org.junit.runner.RunWith; /** * Tests for the Team->Gitflow->Feature Start/Finish actions */ @RunWith(SWTBotJunit4ClassRunner.class) public class FeatureStartFinishHandlerTest extends AbstractFeatureFinishHandlerTest { @Test public void testFeatureStart() throws Exception { init(); setContentAddAndCommit("bar"); createFeature(FEATURE_NAME); RevCommit featureBranchCommit = setContentAddAndCommit("foo"); checkoutBranch(DEVELOP); checkoutFeature(FEATURE_NAME); finishFeature(); GitFlowRepository gfRepo = new GitFlowRepository(repository); RevCommit developHead = gfRepo.findHead(); assertEquals(developHead, featureBranchCommit); assertNull(findBranch(gfRepo.getConfig().getFeatureBranchName(FEATURE_NAME))); } @Override protected void selectOptions() { // do nothing } }