Package ut.com.atlassian.jgitflow.core.testutils

Examples of ut.com.atlassian.jgitflow.core.testutils.HotfixFinishExtensionForTests


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

        HotfixFinishExtensionForTests extension = new HotfixFinishExtensionForTests();

        ReleaseMergeResult result = flow.hotfixFinish("1.0").setFetch(true).setPush(true).setExtension(extension).call();

        assertTrue(result.wasSuccessful());

        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("beforeMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_CHECKOUT));
        assertTrue("afterMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_CHECKOUT));
        assertTrue("beforeMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_MERGE));
        assertTrue("afterMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_MERGE));
        assertTrue("beforeDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT));
        assertTrue("afterDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_CHECKOUT));
        assertTrue("beforeDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_MERGE));
        assertTrue("afterDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_MERGE));
        assertTrue("afterPush was not called", extension.wasCalled(BaseExtensionForTests.AFTER_PUSH));
        assertTrue("after was not called", extension.wasCalled(BaseExtensionForTests.AFTER));

    }
View Full Code Here


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

        HotfixFinishExtensionForTests extension = new HotfixFinishExtensionForTests();
        extension.withException(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT, ExtensionFailStrategy.ERROR);
       
        try
        {
            ReleaseMergeResult result = flow.hotfixFinish("1.0").setFetch(true).setPush(true).setExtension(extension).call();

            fail("Exception should have been thrown!!");
        }
        catch (JGitFlowExtensionException e)
        {
            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("beforeMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_CHECKOUT));
            assertTrue("afterMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_CHECKOUT));
            assertTrue("beforeMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_MERGE));
            assertTrue("afterMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_MERGE));
        }

    }
View Full Code Here

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

        HotfixFinishExtensionForTests extension = new HotfixFinishExtensionForTests();
        extension.withException(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT, ExtensionFailStrategy.WARN);

        ReleaseMergeResult result = flow.hotfixFinish("1.0").setFetch(true).setPush(true).setExtension(extension).call();

        assertTrue(result.wasSuccessful());

        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("beforeMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_CHECKOUT));
        assertTrue("afterMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_CHECKOUT));
        assertTrue("beforeMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_MERGE));
        assertTrue("afterMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_MERGE));
        assertTrue("beforeDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT));
        assertTrue("afterDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_CHECKOUT));
        assertTrue("beforeDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_MERGE));
        assertTrue("afterDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_MERGE));
        assertTrue("afterPush was not called", extension.wasCalled(BaseExtensionForTests.AFTER_PUSH));
        assertTrue("after was not called", extension.wasCalled(BaseExtensionForTests.AFTER));

    }
View Full Code Here

TOP

Related Classes of ut.com.atlassian.jgitflow.core.testutils.HotfixFinishExtensionForTests

Copyright © 2018 www.massapicom. 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.