Package net.sf.collabreview.core

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


* @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

  /**
   * 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

    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

TOP

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

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.