Package net.sf.collabreview.core

Examples of net.sf.collabreview.core.CollabReview


   * Terminate flag settable through cancel() method.
   */
  private boolean terminate = false;

  public static void main(String[] args) {
    CollabReview collabReview = AutoConfigurator.newConfiguredApplication();
    Importer importer = collabReview.getImporter();
    importer.start();
    try {
      Thread.sleep(3600 * 1000);
    } catch (InterruptedException e) {
      logger.error("Interrupted", e);
View Full Code Here


public class ImporterDemo {
  private static final Log logger = LogFactory.getLog(ImporterDemo.class);

  @SuppressWarnings({"deprecation"})
  public static void main(String[] args) {
    CollabReview collabReview = AutoConfigurator.newConfiguredApplication();
    ArrayList<ImportProgressInfo> ipis = new ArrayList<ImportProgressInfo>();
    Importer importer = collabReview.getImporter();
    importer.start();
    long startTime = System.currentTimeMillis();
    ImportProgressInfo currentIpi = null;
    while (System.currentTimeMillis() < startTime + 10000) {
      ImportProgressInfo ipi = importer.getProgressInfo();
      if (!ipi.equals(currentIpi)) {
        currentIpi = ipi;
        ipis.add(ipi);
      }
      try {
        Thread.sleep(10);
      } catch (InterruptedException e) {
      }
    }
    importer.shutdown();
    for (ImportProgressInfo ipi : ipis) {
      logger.debug(ipi);
    }
    logger.info("The repository contains " + collabReview.getRepository().listAllArtifacts().size()
        + " artifacts, out of which " + collabReview.getRepository().listNonObsoleteArtifacts(null).size()
        + " artifacts are non-obsolete.");
    System.exit(0);
  }
View Full Code Here

  private ArtifactIdentifier a1, a2, a3, a4, a5, a6;

  @Override
  protected void setUp() throws Exception {
    CollabReview collabReview = AutoConfigurator.newConfiguredApplication();
    repository = collabReview.getRepository();
    a1 = new ArtifactIdentifier("", 0, "");
    a2 = new ArtifactIdentifier("HelloWorld.java", 5, "");
    a3 = new ArtifactIdentifier("xyz", 534, "tag");
    a4 = new ArtifactIdentifier("ping/pong/Plop.cs", 1, "branch");
    a5 = new ArtifactIdentifier("JibbyJabba.java", 70, "");
View Full Code Here

  private static final Log logger = LogFactory.getLog(MailManagerTest.class);

  private MailManager mm;

  public void setUp() throws InterruptedException {
    CollabReview collabReview = AutoConfigurator.newConfiguredApplication();
    mm = collabReview.getMailManager();
    mm.resetMailsPerMinuteCounter();
    mm.MillisPerMinute = 1000;
  }
View Full Code Here

* @date 2012-04-22 12:16
*/
public class CheckstyleViolationsPerSourceLineOfCodeAgent extends CheckstyleAgent {
  @Override
  public void writeReview(CheckstyleAgent.AuditEventList auditEventList) {
    CollabReview collabReview = getAgentManager().getCollabReview();
    Artifact artifact = collabReview.getRepository().getArtifact(auditEventList.getArtifactIdentifier());
    int lines = LineCounter.countNonEmptyLines(getAgentManager().getCollabReview().getRepository(), auditEventList.getArtifactIdentifier());
    int violations = auditEventList.getInfoCount() + auditEventList.getWarnCount() * 2 + auditEventList.getErrorCount() * 3;
    float violationsPerLine = (float) violations / lines;
    float quality = violationsPerLine <= 1 ?
        (10 - 10 * violationsPerLine)
        :
        (-10 + 10 / violationsPerLine);
    int rating = Math.round(quality);
    String review = String.format("Source file statistics:   Lines: %d  Violations: %d (%d x1, %d x2, %d x3)  Violations per Line: %.1f"
        + (auditEventList.hasException() ? "  (EXCEPTION)\n" : "\n"),
        lines, violations, auditEventList.getInfoCount(), auditEventList.getWarnCount(), auditEventList.getErrorCount(), violationsPerLine);
    for (AuditEvent auditEvent : auditEventList.getEvents()) {
      String severityString = ":     ";
      if (auditEvent.getSeverityLevel() == SeverityLevel.WARNING) {
        severityString = " (!): ";
      } else if (auditEvent.getSeverityLevel() == SeverityLevel.ERROR) {
        severityString = " (!!):";
      }
      review += String.format("Line %3d%s %s\n",
          auditEvent.getLine(),
          severityString,
          auditEvent.getMessage()
          //auditEvent.getLine() > 0 ? artifact.getContent().split("\n")[auditEvent.getLine() - 1].trim() : ""
      );
    }
    collabReview.getRepository().setReview(auditEventList.getArtifactIdentifier(), collabReview.getAuthorManager().getAuthor(getProposedName()), rating, review, false);
  }
View Full Code Here

  private Author user1;

  private Repository repository;

  public void setUp() {
    CollabReview collabReview = AutoConfigurator.newConfiguredApplication();
    user1 = collabReview.getAuthorManager().createAuthor("abcyx");
    collabReview.getAuthorManager().storeAuthor(user1);
    repository = collabReview.getRepository();
    repository.addArtifact(aid1, new Date(), "some content", user1);
    repository.commit();
  }
View Full Code Here

TOP

Related Classes of net.sf.collabreview.core.CollabReview

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.