Package org.evolizer.versioncontrol.cvs.model.entities

Examples of org.evolizer.versioncontrol.cvs.model.entities.Transaction


         * Testing the branch revision creation when related to a new branch.
         * If the branch does not exists already (can happen if the project was moved around),
         * it is created on the fly.
         */

        Transaction t = sModelMapper.createTransaction(new Date(13143647));
        ModificationReport m = sModelMapper.createModificationReport(new Date(132323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/file.txt");
        SVNRevision rev2 =
            sModelMapper.createBranchRevision(2, f, t, m, null, false, "These are the new contents", "branch");

View Full Code Here


        //First I call the method
        sModelMapper.finalizeTransaction(sTrans, new ArrayList<String>());

        //Now I check that all the required entities were saved correctly
        List<Transaction> transactions = sSession.query("from Transaction", Transaction.class);
        Transaction toAnalyze = null;
        for (Transaction t : transactions) {
            if (t.getStarted().equals(sTrans.getStarted())) {
                toAnalyze = t;
            }
        }
        assertNotNull(toAnalyze);

        assertEquals("The number of involved revisions for the test transaction is not what expected", 1, toAnalyze.getInvolvedRevisions().size());
        assertEquals("The revision transaction is not the one expected", toAnalyze.getId(), sRev.getChangeSet().getId());
        assertEquals("The test transaction does not contain the test revision", sRev.getId(), toAnalyze.getInvolvedRevisions().iterator().next().getId());
        assertEquals("The test revision's author is not what expected", sRev.getAuthor().getId(), toAnalyze.getInvolvedRevisions().iterator().next().getAuthor().getId());

        Person p = sSession.uniqueResult("from Person as p where p.firstName ='" + sAuthor.getFirstName() + "'", Person.class);
        CommitterRole r = (CommitterRole) p.getRoles().iterator().next();
        SVNVersionedFile f = sSession.uniqueResult("from SVNVersionedFile where path= '/rootDir/dir/file.txt'", SVNVersionedFile.class);
        assertEquals(toAnalyze.getInvolvedRevisions().iterator().next().getId(), f.getRevisions().iterator().next().getId());
        assertEquals("The saved revision was not associated to its saved author", r.getArtifacts().iterator().next(), toAnalyze.getInvolvedRevisions().iterator().next());
    }
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testReleaseCreation() throws Exception{
        Date d = new Date(1234563999);
        Transaction newTrans = sModelMapper.createTransaction(d);        
        sRel =
            sModelMapper.createRelease(
                    new Date(1234563999),
                    newTrans,
                    "Test release creation message",
View Full Code Here

     * Testing that the mapper removes everything related to a {@link Release} from the DB and from its in memory data.
     */
    @Test
    public void testDeleteRelease(){
        Date d = new Date(1234565999);
        Transaction newTrans = sModelMapper.createTransaction(d);        
        sRel =
            sModelMapper.createRelease(
                    d,
                    newTrans,
                    "Test release creation message",
View Full Code Here

    public void testBranchCreation()
    throws SecurityException,
    NoSuchFieldException,
    IllegalArgumentException,
    IllegalAccessException {
        Transaction t = sModelMapper.createTransaction(new Date(13147));
        sBranch =
            sModelMapper.createBranch(
                    new Date(1324),
                    t,
                    "branch creation",
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testDeleteRevision() throws Exception{
        Date d = new Date(1234563999);
        Transaction newTrans = sModelMapper.createTransaction(d);
        ModificationReport newReport = sModelMapper.createModificationReport(new Date(1243548890), "test message", sAuthorName);
        Long previousRevId = sFile.getLatestRevision().getId();
        sModelMapper.createRevision(6, sFile, newTrans, newReport, null, false, "These are the contents");
        sModelMapper.finalizeTransaction(newTrans, new ArrayList<String>());
        SVNRevision fetched = sSession.uniqueResult("from SVNRevision where number = " + 6, SVNRevision.class);
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testDeleteBranch() throws Exception{

        Transaction t = sModelMapper.createTransaction(new Date(19847));
        Branch newBranch =
            sModelMapper.createBranch(
                    new Date(4562),
                    t,
                    "branch 2 creation",
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testConvertReleaseToBranch() throws Exception{
        //First I need to create a release to then convert to a branch
        Transaction newTrans = sModelMapper.createTransaction(new Date(1576563999));        
        SVNRelease newRel =
            sModelMapper.createRelease(
                    new Date(1576563999),
                    newTrans,
                    "Test release creation message",
View Full Code Here

     * Testing that a {@link File} is correctly removed from a {@link Release}.
     * @throws Exception
     */
    @Test
    public void testRemoveFromRelease() throws Exception{
        Transaction t = sModelMapper.createTransaction(new Date(97897899));
        ModificationReport m = sModelMapper.createModificationReport(new Date(155323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/rootDir/dir/file2.txt");
        sModelMapper.createRevision(2, f, t, m, null, false, "These are the new contents");
        sModelMapper.finalizeTransaction(t, new ArrayList<String>());
       
        Transaction newTrans = sModelMapper.createTransaction(new Date(1576763378));
        SVNRelease newRel =
            sModelMapper.createRelease(
                    new Date(1576763378),
                    newTrans,
                    "Test release creation message",
View Full Code Here

     * Testing that a {@link File} is correctly replaced in a {@link Release}.
     * @throws Exception
     */
    @Test
    public void testReplaceInRelease() throws Exception{
        Transaction t = sModelMapper.createTransaction(new Date(97897899));
        ModificationReport m = sModelMapper.createModificationReport(new Date(155323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/rootDir2/dir/file3.txt");
        sModelMapper.createRevision(2, f, t, m, null, false, "These are the new contents");
        sModelMapper.finalizeTransaction(t, new ArrayList<String>());
       
       
        Transaction newTrans = sModelMapper.createTransaction(new Date(1599997378));
        SVNRelease newRel =
            sModelMapper.createRelease(
                    new Date(1576763378),
                    newTrans,
                    "Test release creation message",
View Full Code Here

TOP

Related Classes of org.evolizer.versioncontrol.cvs.model.entities.Transaction

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.