Package uk.ac.osswatch.simal.model

Examples of uk.ac.osswatch.simal.model.IProject


  public void testGetProjectsWithoutHomepage() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithoutHomepage();
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has no homepages: " + project.getHomepages());
    }
      assertEquals("Got incorect number of projects with Homepage", 1, projects.size());
  }
View Full Code Here


  public void testGetProjectsWithReview() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithReview();
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has at least one review: " + project.getHomepages());
    }
    assertEquals("Got incorect number of projects with a review", 1, projects.size());
  }
View Full Code Here

  public void testGetProjectsWithoutReview() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithoutReview();
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has no reviews: " + project.getHomepages());
    }
    assertEquals("Got incorect number of projects without review", 9, projects.size());
  }
View Full Code Here

  }
 
  @Test
  public void testGetProject() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    IProject project = service.getProject(testProjectURI);
    assertNotNull("Failed to get the test project from the repository", project);
  }
View Full Code Here

    @Test
    public void testFindProject() throws SimalRepositoryException,
        URISyntaxException {
      logger.debug("Starting testFindProject()");
      String uri = "http://foo.org/nonExistent";
      IProject project = SimalRepositoryFactory.getProjectService().getProject(uri);
      assertNull(project);

      // test a known valid file
      project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(TEST_PROJECT_URI);
      assertEquals("Simal DOAP Test", project.getName());
      logger.debug("Finished testFindProject()");
    }
View Full Code Here

      logger.debug("Finished testFindProject()");
    }
   
    @Test
    public void testFindProjectById() throws SimalRepositoryException {
      IProject project = SimalRepositoryFactory.getProjectService().getProjectById(testProjectID);
      assertNotNull("Failed to get project with ID " + testProjectID, project);
    }
View Full Code Here

    }

    @Test
    public void testFindProjectBySeeAlso() throws SimalRepositoryException {
      logger.debug("Starting testFindProjectBySeeAlso()");
      IProject project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(project1SeeAlso);
      assertNotNull(project);
      logger.debug("Finished testFindProjectBySeeAlso()");
    }
View Full Code Here

    public IProject getOrCreateProject(String uri)
        throws SimalRepositoryException {
    if (SimalRepositoryFactory.getInstance().containsResource(uri)) {
      return getProject(uri);
    } else {
      IProject project = findProjectBySeeAlso(uri);
      if (project == null) {
        try {
          return createProject(uri);
        } catch (DuplicateURIException e) {
          LOGGER.error("Threw a DuplicateURIEception when we had already checked for resource existence", e);
View Full Code Here

          com.hp.hpl.jena.rdf.model.Resource res = model.createResource(uri);
          s = model.createStatement(r, RDFS.seeAlso, res);
          model.add(s);
        }

      IProject project = new Project(r);
      project.setSimalID(getNewProjectID());
      return project;
    }
View Full Code Here

            + "> " + "PREFIX rdf: <" + AbstractSimalRepository.RDF_NAMESPACE_URI + ">"
            + "PREFIX simal: <" + AbstractSimalRepository.SIMAL_NAMESPACE_URI + ">"
            + "SELECT DISTINCT ?project WHERE { " + "?project simal:projectId \""
            + id + "\" }";

        IProject project = findProjectBySPARQL(queryStr);

        if (project == null) {
          LOGGER.debug("No project with that ID found");
        } else {
          LOGGER.debug("Retrieved project name: " + project.getName());
        }
       
        return project;
      }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.model.IProject

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.