Package org.sylfra.idea.plugins.revu.model

Examples of org.sylfra.idea.plugins.revu.model.Review


{
  public void testCheckCyclicLink()
  {
    ReviewManager reviewManager = new ReviewManager(getProject());

    Review review1 = new Review("review1");
    Review review2 = new Review("review2");
    Review review3 = new Review("review3");

    try
    {
      reviewManager.checkCyclicLink(review1, review1);
    }
    catch (RevuException e)
    {
      Assert.fail(e.getMessage());
    }

    review2.setExtendedReview(review1);
    try
    {
      reviewManager.checkCyclicLink(review1, review2);
    }
    catch (RevuException e)
    {
      Assert.fail(e.getMessage());
    }

    review2.setExtendedReview(review3);
    review3.setExtendedReview(review1);
    try
    {
      reviewManager.checkCyclicLink(review1, review2);
    }
    catch (RevuException e)
View Full Code Here


    IssueDialog dialog = new IssueDialog(project, true);
    dialog.show(issue);
    if ((dialog.isOK()) && dialog.updateData(issue))
    {
      Review review = issue.getReview();

      assert (RevuUtils.getCurrentUserLogin() != null) : "Login should be set";

      issue.setHistory(RevuUtils.buildHistory(review));

      if (RevuVcsUtils.fileIsModifiedFromVcs(project, vFile))
      {
        issue.setLocalRev(String.valueOf(System.currentTimeMillis()));
      }

      if (issue.getFile() != null)
      {
        VcsRevisionNumber vcsRev = RevuVcsUtils.getVcsRevisionNumber(project, issue.getFile());
        if (vcsRev != null)
        {
          issue.setVcsRev(vcsRev.toString());
        }
      }

      review.addIssue(issue);

      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      reviewManager.saveSilently(review);
    }
  }
View Full Code Here

        // Check that reviewingReviewName matches an existing review
        String reviewingReviewName = workspaceSettings.getReviewingReviewName();
        if (reviewingReviewName != null)
        {
          Review review = getReviewByName(reviewingReviewName);
          if ((review == null) || (!ReviewStatus.REVIEWING.equals(review.getStatus())))
          {
            workspaceSettings.setReviewingReviewName(null);
            project.getComponent(RevuWorkspaceSettingsComponent.class).loadState(workspaceSettings);
          }
        }
View Full Code Here

    metaReviews.put(review, new MetaReview(review, -1, false));
  }

  public void removeReview(@NotNull Review review)
  {
    Review oldReview = reviewsByFiles.remove(review.getFile());
    reviewsByNames.remove(review.getName());
    metaReviews.remove(oldReview);

    fireReviewDeleted(review);
  }
View Full Code Here

    reviewsByFiles.clear();
    metaReviews.clear();

    for (Map.Entry<File, String> entry : EMBEDDED_REVIEWS.entrySet())
    {
      Review review = new Review();
      review.setFile(entry.getKey());
      review.setEmbedded(true);
      load(review, false);
      addReview(review);
    }
  }
View Full Code Here

    {
      // Delete obsolete reviews
      Collection<Review> reviews = new HashSet<Review>(getReviews());
      for (Iterator<Review> it = reviews.iterator(); it.hasNext();)
      {
        Review review = it.next();
        if ((review.isEmbedded()) || (review.isShared() != sharedFilter))
        {
          continue;
        }

        String filePath = RevuVfsUtils.buildRelativePath(project, review.getFile());
        if (filePaths.contains(filePath))
        {
          changedReviews.put(filePath, review);
        }
        else
        {
          fireReviewDeleted(review);
        }
        Review oldReview = reviewsByFiles.remove(review.getFile());
        reviewsByNames.remove(review.getName());
        metaReviews.remove(oldReview);
        it.remove();
      }
    }
View Full Code Here

    }

    Set<Review> reviewsToSave = new HashSet<Review>();
    for (Issue issue : issues)
    {
      Review review = issue.getReview();
      review.removeIssue(issue);

      reviewsToSave.add(review);
    }

    ReviewManager reviewManager = project.getComponent(ReviewManager.class);
View Full Code Here

    // Update
    if (currentReview != null)
    {
      // Cyclic link
      Review importedReview = getImportedReview();
      if (importedReview != null)
      {
        try
        {
          reviewManager.checkCyclicLink(currentReview, importedReview);
View Full Code Here

    super.internalValidateInput(data);

    // Check if current user is contained in list
    boolean adminFound;

    Review enclosingReview = getEnclosingReview(data);
    if ((data == null) || (enclosingReview == null) || (enclosingReview.isEmbedded()))
    {
      adminFound = true;
    }
    else
    {
View Full Code Here

{
  public void testCheckCyclicLink()
  {
    ReviewManager reviewManager = new ReviewManager(getProject());

    Review review1 = new Review("review1");
    Review review2 = new Review("review2");
    Review review3 = new Review("review3");

    try
    {
      reviewManager.checkCyclicLink(review1, review1);
    }
    catch (RevuException e)
    {
      Assert.fail(e.getMessage());
    }

    review2.setExtendedReview(review1);
    try
    {
      reviewManager.checkCyclicLink(review1, review2);
    }
    catch (RevuException e)
    {
      Assert.fail(e.getMessage());
    }

    review2.setExtendedReview(review3);
    review3.setExtendedReview(review1);
    try
    {
      reviewManager.checkCyclicLink(review1, review2);
    }
    catch (RevuException e)
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.model.Review

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.