Examples of ArtifactIdentifier


Examples of net.sf.collabreview.core.ArtifactIdentifier

    assertEquals(1, repository.getReviewCount());
    repository.commit(); // release the database connection
  }

  public void testOneTooLongAgo() {
    Artifact artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,1,t)"), new Date(0), content + "a", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(0).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,2,t)"), new Date(1000 * 60 * 6), content + "a\nb", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(1000 * 60 * 6).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,3,t)"), new Date(1000 * 60 * 11), content + "a\nb\nc", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(1000 * 60 * 11).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,4,t)"), new Date(1000 * 60 * 14), content + "a\nb\nc\nd", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(1000 * 60 * 14).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,5,t)"), new Date(1000 * 60 * 17), content + "a\nb\ne", author1);
    repository.commit();
    assertEquals(1, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(1000 * 60 * 17).getTime(), 600 * 1000));
    assertEquals(1, repository.getReviewCount());
    repository.commit(); // release the database connection
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

    repository.commit(); // release the database connection
  }

  public void testInCombinationWithReputation() throws Exception {
    new Configurator().configureReputationMetricManager((ConfigurationConfigurableCollabReview) collabReview, reputationConfigurationData);
    Artifact artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,1,t)"), new Date(0), content + "a", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(0).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,2,t)"), new Date(5), content + "a\nb", author1);
    repository.commit();
    assertEquals(0, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(5).getTime(), 600 * 1000));
    assertEquals(0, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,3,t)"), new Date(15), content + "a\nb\nc", author1);
    repository.commit();
    assertEquals(1, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(15).getTime(), 600 * 1000));
    assertEquals(1, repository.getReviewCount());
    artifact = repository.addArtifact(new ArtifactIdentifier("ArtifactIdentifier(x,4,t)"), new Date(25), content + "a\nb\nc\nd", author1);
    repository.commit();
    assertEquals(1, MicroEditCastigator.countMicroEdits(repository, artifact, 3, 300 * 1000, new Date(25).getTime(), 600 * 1000));
    assertEquals(1, repository.getReviewCount());
    repository.commit(); // release the database connection
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

* @author Christian Prause (chris)
* @date 2009-07-31 10:29:41
*/
public class BasicPersistenceTest extends TestCase {
  private ArtifactIdentifier createIdentifier(int num) {
    return new ArtifactIdentifier("a", num, "");
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

  /**
   * Save an ArtifactIdentifier to the database and then load it back avoiding Hibernate's session cache
   * by using a new session so that the database has to be accessed).
   */
  public void testLoadArtifactIdentifierInNewSession() {
    ArtifactIdentifier aid = createIdentifier(1);
    HibernateUtil.save(aid);
    HibernateUtil.closeSession();
    ArtifactIdentifier aid2 = (ArtifactIdentifier) HibernateUtil.getCurrentSession().get(ArtifactIdentifier.class, aid.getPk());
    assertEquals(aid, aid2);
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

    assertNotNull(loaded);
    assertEquals("bula bula", loaded.getContent());
  }

  public void testStoreReview() {
    ArtifactIdentifier aid = createIdentifier(1);
    HibernateUtil.save(new HibernateArtifact(aid, null, new Date(), "bula bula"));
    HibernateUtil.closeSession();
    Author author = author(5);
    System.out.println("\n\n\n\n\n\n\n\n****\n\n\n\n");
    Review review = new HibernateReview(
        (ArtifactIdentifier) HibernateUtil.getCurrentSession().get(ArtifactIdentifier.class, aid.getPk()),
        author, "möhb", 2, true);
    HibernateUtil.getCurrentSession().save(review);
  }
View Full Code Here

Examples of org.gradle.api.artifacts.ArtifactIdentifier

            CachedArtifact cached = artifactAtRepositoryCachedResolutionIndex.lookup(artifactCacheKey(artifact));
            final BigInteger descriptorHash = moduleSource.getDescriptorHash();
            if (cached != null) {
                long age = timeProvider.getCurrentTime() - cached.getCachedAt();
                final boolean isChangingModule = moduleSource.isChangingModule();
                ArtifactIdentifier artifactIdentifier = ((ModuleComponentArtifactMetaData) artifact).toArtifactIdentifier();
                if (cached.isMissing()) {
                    if (!cachePolicy.mustRefreshArtifact(artifactIdentifier, null, age, isChangingModule, descriptorHash.equals(cached.getDescriptorHash()))) {
                        LOGGER.debug("Detected non-existence of artifact '{}' in resolver cache", artifact);
                        for (String location : cached.attemptedLocations()) {
                            result.attempted(location);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.