Package com.atlassian.jgitflow.core

Examples of com.atlassian.jgitflow.core.JGitFlow.featureStart()


        //update local
        flow.git().checkout().setName(flow.getDevelopBranchName()).call();
        git.pull().call();
       
        flow.featureStart("my-feature").setFetch(true).call();

    }

    @Test
    public void startFeatureWithPush() throws Exception
View Full Code Here


        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("develop").call();

        flow.featureStart("myFeature").setFetch(true).setPush(true).call();

        assertTrue(GitHelper.remoteBranchExists(git, "feature/myFeature",flow.getReporter()));

    }
View Full Code Here

        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();

        flow.featureStart("my-feature").setFetch(true).call();

    }

    public void startFeatureWithFetchNoRemote() throws Exception
    {
View Full Code Here

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.featureStart("my-feature").setFetch(true).call();
    }

    @Test(expected = LocalBranchExistsException.class)
    public void startFeatureWithExistingLocalBranch() throws Exception
    {
View Full Code Here

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
       
        git.branchCreate().setName(flow.getFeatureBranchPrefix() + "my-feature").call();
       
        flow.featureStart("my-feature").call();
    }

    @Test
    public void startFeatureWithLocalBehindMasterNoFetch() throws Exception
    {
View Full Code Here

        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();

        flow.featureStart("my-feature").call();

        assertEquals(flow.getFeatureBranchPrefix() + "my-feature", git.getRepository().getBranch());

    }
   
View Full Code Here

    public void startFeatureWithoutFlowInit() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlow flow = JGitFlow.get(git.getRepository().getWorkTree());

        flow.featureStart("my-feature").call();
    }
}
View Full Code Here

        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("develop").call();

        FeatureStartExtensionForTests extension = new FeatureStartExtensionForTests();

        flow.featureStart("myFeature").setFetch(true).setPush(true).setExtension(extension).call();

        assertTrue("before was not called", extension.wasCalled(BaseExtensionForTests.BEFORE));
        assertTrue("beforeFetch was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_FETCH));
        assertTrue("afterFetch was not called", extension.wasCalled(BaseExtensionForTests.AFTER_FETCH));
        assertTrue("beforeCreateBranch was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_CREATE_BRANCH));
View Full Code Here

        FeatureStartExtensionForTests extension = new FeatureStartExtensionForTests();
        extension.withException(BaseExtensionForTests.AFTER_CREATE_BRANCH, ExtensionFailStrategy.ERROR);

        try
        {
            flow.featureStart("myFeature").setFetch(true).setPush(true).setExtension(extension).call();

            fail("Exception should have been thrown!!");
        }
        catch (JGitFlowExtensionException e)
        {
View Full Code Here

        git.push().setRemote("origin").add("develop").call();

        FeatureStartExtensionForTests extension = new FeatureStartExtensionForTests();
        extension.withException(BaseExtensionForTests.AFTER_CREATE_BRANCH, ExtensionFailStrategy.WARN);

        flow.featureStart("myFeature").setFetch(true).setPush(true).setExtension(extension).call();

        assertTrue("before was not called", extension.wasCalled(BaseExtensionForTests.BEFORE));
        assertTrue("beforeFetch was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_FETCH));
        assertTrue("afterFetch was not called", extension.wasCalled(BaseExtensionForTests.AFTER_FETCH));
        assertTrue("beforeCreateBranch was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_CREATE_BRANCH));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.