Package uk.ac.osswatch.simal.model

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


 
 
  @Test
  public void testProjectImport() throws FileNotFoundException, IOException, SimalRepositoryException, DuplicateURIException {
    Iterator<IProject> projects = repo.getAllProjects().iterator();
    IProject project;
   
    boolean projectAIsValid = false;
    while (projects.hasNext()) {
      project = projects.next();
      String name = project.getName();
      Set<IDocument> homepages = project.getHomepages();
      if (name.equals("Project A")) {
        if (!homepages.toString().contains("Homepage")) {
          break;
        }
        projectAIsValid = true;
View Full Code Here


      if (name.contains("Person A")) {
        personIsValid = true;
       
        Set<IProject> projects = person.getProjects();
        assertEquals("Don't have the right number of projects for Person A",2, projects.size());
        IProject prj = (IProject) projects.toArray()[0];
        assertTrue("Person A is not associated with project foo", prj.getName().equals("Project A") || prj.getName().equals("Project D"));
       
        Set<IInternetAddress> emails = person.getEmail();
        assertTrue("Persons A has an invalid email setting", emails.toString().contains("persona@institutiona.ac.uk"));
       
        break;
View Full Code Here

    assertTrue("Person has not been properly imported", personIsValid)
  }
 
  @Test
  public void testProjectCategories() throws SimalRepositoryException {
    IProject project = SimalRepositoryFactory.getProjectService().getProject("http://jisc.ac.uk/project#10");
    Set<IDoapCategory> cats = project.getCategories();
    assertEquals("Project A has an incorrect number of categories", 1, cats.size());
  }
View Full Code Here

    assertEquals("Project A has an incorrect number of categories", 1, cats.size());
  }
 
  @Test
  public void testProjectHomepages() throws SimalRepositoryException {
    IProject project = SimalRepositoryFactory.getProjectService().getProject("http://jisc.ac.uk/project#10");
    Set<IDocument> pages = project.getHomepages();
    assertEquals("Project A has an incorrect number of homepages", 1, pages.size());
  }
View Full Code Here

    assertEquals("Project A has an incorrect number of homepages", 1, pages.size());
  }
 
  @Test
  public void testProjectToXMLAfterImport() throws SimalRepositoryException {
    IProject project = SimalRepositoryFactory.getProjectService().getProject("http://jisc.ac.uk/project#10");
    String xml = project.toXML();
    assertTrue("There appears to be no project identifer in the returned XML", xml.contains("http://jisc.ac.uk/project#10"));
  }
View Full Code Here

    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithRCS();
   
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has an RCS: " + project.getRepositories());
    }
   
    assertEquals("Got incorrect number of projects with RCS", 2, projects.size());
  }
View Full Code Here

    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithoutRCS();
   
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has no RCS: " + project.getRepositories());
    }
   
    assertEquals("Got incorrect number of projects without RCS", 7, projects.size());
  }
View Full Code Here

  }

  @Test
  public void testGetProjectsById() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    IProject project = service.getProjectById(testProjectID);
    assertEquals("Got incorect project by ID","Simal DOAP Test", project.getName());
   
    logger.debug("Project RDF is:\n" + project.toXML());
   
    String shortID = testProjectID.substring(testProjectID.lastIndexOf("-") + 1);
    project = service.getProjectById(shortID);
    assertEquals("Got incorect project by ID","Simal DOAP Test", project.getName());
  }
View Full Code Here

    ohloh.importProjects(file);
   
    Set<IProject> allProjects = repo.getAllProjects();
    int numProjectsbefore = allProjects.size();
    Iterator<IProject> projects = allProjects.iterator();
    IProject project;
   
    boolean projectAIsValid = false;
    while (projects.hasNext()) {
      project = projects.next();
      String name = project.getName();
      //Set<IDoapHomepage> homepages = project.getHomepages();
      if (name.equals("Apache HTTP Server")) {
        projectAIsValid = true;
      }
    }
View Full Code Here

  public void testGetProjectsWithHomepage() throws SimalRepositoryException {
    IProjectService service = SimalRepositoryFactory.getProjectService();
    Set<IProject> projects = service.getProjectsWithHomepage();
    Iterator<IProject> itr = projects.iterator();
    while (itr.hasNext()) {
      IProject project = itr.next();
      System.out.println(project + " has homepages: " + project.getHomepages());
    }
      assertEquals("Got incorect number of projects with Homepage", 8, projects.size());
  }
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.