Package uk.ac.osswatch.simal.service

Examples of uk.ac.osswatch.simal.service.IReviewService


  private static final Logger logger = LoggerFactory
      .getLogger(TestReviewService.class);

  @Test
  public void getAllReviews() throws SimalRepositoryException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    Set<IReview> reviews = service.getReviews();
    Iterator<IReview> itr = reviews.iterator();
    while (itr.hasNext()) {
      logger.debug(itr.next().toString());
    }
    assertEquals("We have an incorrect number of reviews in the repository", 1, reviews.size());
View Full Code Here


    assertEquals("URI of review is incorrect", "http://simal.oss-watch.ac.uk/Review#testReview", review.getURI());
  }
 
  @Test
  public void getReview() throws SimalRepositoryException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    IReview review = service.getReview("http://simal.oss-watch.ac.uk/Review#testReview");
    assertNotNull("Failed to get the review from the repository", review);
  }
View Full Code Here

  }

   
    @Test
    public void testGetReviewsForProject() throws SimalRepositoryException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    IProjectService projectService = SimalRepositoryFactory.getProjectService();
    Set<IReview> reviews = service.getReviewsForProject(projectService.getProject(testProjectURI))
    assertTrue("We should have a project review", 1 == reviews.size());
    IReview review = (IReview) reviews.toArray()[0];
    String label = review.getLabel();
    assertTrue("Review label is incorrect: " + label, label.contains("performed by"));
    assertFalse("Review label is incorrect: " + label, label.contains("null"));
View Full Code Here

   
    return url.toString();
  }

  public int getOpennessRating() throws SimalRepositoryException {
  IReviewService service = SimalRepositoryFactory.getReviewService();
  Set<IReview> reviews = service.getReviewsForProject(this);
  if (reviews.size() == 0) {
    logger.debug(this.toString() + " project does not have a review and thus has no openness rating.");
    throw new SimalRepositoryException("Unable to get an openness rating since there has been no review of this entry yet");
  }
 
View Full Code Here

 
  static IReview review;

    @BeforeClass
  public static void getTestReview() throws SimalRepositoryException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    Set<IReview> reviews = service.getReviews();
    review = (IReview) reviews.toArray()[0];
  }
View Full Code Here

    assertEquals("We have the wrong project for the test review", "http://simal.oss-watch.ac.uk/simalTest#", project.getURI());
  }
 
  @Test
  public void setSetProject() throws DuplicateURIException, SimalException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    IReview review = service.create("http://test.org/Review");
    review.setProject(project1);
   
    IProject project = review.getProject();
    assertEquals("Incorrectly setting the project", project1.getName(), project.getName());
    review.delete();
View Full Code Here

   *
   * @return
   * @throws SimalRepositoryException
   */
  public IReview getReview() throws SimalRepositoryException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    String id = service.getNewReviewID();
    String uri = RDFUtils.getDefaultReviewURI(id);
    IReview review;
    try {
      review = service.create(uri);
      review.setSimalID(id);
      populateReview(review, IReview.TYPE_OPENNESS);
    } catch (DuplicateURIException e) {
      throw new SimalRepositoryException("Unable to create a new review", e);
    }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.service.IReviewService

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.