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

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


     */
    public void createRelease(String tag, String date) {
        if (fCurrRelease != null) {
            fSession.saveOrUpdate(fCurrRelease);
        }
        Release rel = new Release(tag);
        fCurrRelease = rel;
        try {
            rel.setTimeStamp(this.translateDateString(date));
        } catch (ParseException e) {
            rel.setTimeStamp(null);
        }
    }
View Full Code Here


        for (SymbolicName sn : sns) {
            String relName = sn.getReleaseOrBranchTag();
            String revNumber = sn.getRevisionOrBranchNumber();

            if (fAllocatedReleases.containsKey(relName) && hashedRevisions.containsKey(revNumber)) {
                Release release = fAllocatedReleases.get(relName);
                Revision revision = hashedRevisions.get(revNumber);
                release.addRevision(revision);
                revision.addRelease(release);
            }
        }
    }
View Full Code Here

                fTmpBranches.put(branchNumber, branch); // save the relation between revisions and the branch.
                // release
            } else {
                // new Release
                if (!fAllocatedReleases.containsKey(releaseOrBranchTag)) {
                    Release release = new Release(releaseOrBranchTag);
                    fAllocatedReleases.put(releaseOrBranchTag, release);
                }
            }
        }
    }
View Full Code Here

  }
 
 
  @Test
  public void testReleaseMapping() throws ParseException, EvolizerException{
    Release releaseOne = new Release("releaseNameOne");
    Release releaseTwo = new Release("releaseNameTwo");
    SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = df.parse("2006/01/02 01:02:03");
    releaseOne.setTimeStamp(date);
    releaseTwo.setTimeStamp(date);
   
    ModificationReport modReport = new ModificationReport();
   
    modReport.setAuthor(new Person());
   
    Revision revOne = new Revision("1.1");
    Revision revTwo = new Revision("1.2");
    Revision revThree= new Revision("1.3");
    Revision revFour = new Revision("1.4");
    Revision revFive = new Revision("1.5");
   
    //A dummy report otherwise Hibernate throws an eception
    revOne.setReport(modReport);
    revTwo.setReport(modReport);
    revThree.setReport(modReport);revOne.setReport(modReport);
    revFour.setReport(modReport);
    revFive.setReport(modReport);
   
    releaseOne.addRevision(revOne);
    releaseOne.addRevision(revFour);
    releaseOne.addRevision(revFive);
   

    releaseTwo.addRevision(revTwo);
    releaseTwo.addRevision(revThree);
    releaseTwo.addRevision(revOne);
   
    for(Iterator<Revision> iter = releaseOne.getRevisions().iterator();iter.hasNext();){
      iter.next().addRelease(releaseOne);
    }
   
    for(Iterator<Revision> iter = releaseTwo.getRevisions().iterator();iter.hasNext();){
      iter.next().addRelease(releaseTwo);
    }
   
    fEvolizerSession.startTransaction();
    fEvolizerSession.saveObject(modReport.getAuthor());
View Full Code Here

  @Test
  public void testReleaseEqualsAndHashCode(){
    Date date = new Date();
    Revision rev1 = new Revision("1.1");
    Revision rev2 = new Revision("1.2");
    Release r1 = new Release("name");
    Release r2 = new Release("name");
   
    r1.setTimeStamp(date);
    r2.setTimeStamp(date);
   
    r1.addRevision(rev1);
    r2.addRevision(rev1);
   
    assertFalse(r1.equals(null));
    assertFalse(r1.equals(new Object()));
    assertTrue(r1.equals(r1));
    assertTrue(r1.equals(r2));
    assertTrue(r1.hashCode()==r2.hashCode());
    r1.addRevision(rev2);
    assertFalse(r1.equals(r2));
  }
View Full Code Here

     * @throws ParseException
     *             if Date parsing problems happen
     */
    @Test
    public void testSpecificRelease() throws ParseException {
        Release release = sSession.uniqueResult("from Release where name = 'first_tag'", Release.class);
        SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZ");
        Date d = df.parse("Mon Jul 6 12:13:01 2009 +0200");
        assertTrue(d.equals(release.getTimeStamp()));
        List<Transaction> allTransactions = sSession.query("from Transaction", Transaction.class);
        int count = 0;
        for (Transaction t : allTransactions) {
            if (t.getInvolvedRevisions() != null && t.getInvolvedRevisions().iterator().hasNext()
                && t.getInvolvedRevisions().iterator().next().getReleases().contains(release)) {
                count++;
            }
        }
        assertEquals("Wrong number of transactions found for the tested release", 6, count);
        assertEquals("Wrong number of revisions associated to the tested release", 14, release.getRevisions().size());
    }
View Full Code Here

      }
  }
 
  @Test
  public void testSpecificRelease() throws ParseException{
      Release release = fSession.uniqueResult("from Release where name = 'REL_1.0.30'", Release.class);
      SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZ");
      Date d = df.parse("Wed Apr 29 14:31:27 2009 -0700");
      assertTrue(d.equals(release.getTimeStamp()));
      List<Transaction> allTransactions = fSession.query("from Transaction", Transaction.class);
      int count = 0;
      for(Transaction t : allTransactions){
          if(t.getInvolvedRevisions()!=null && t.getInvolvedRevisions().iterator().hasNext() && t.getInvolvedRevisions().iterator().next().getReleases().contains(release))
              count++;
View Full Code Here

TOP

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

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.