Package uk.ac.osswatch.simal.model

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


  @SuppressWarnings("serial")
  public void testRenderPanel() {
    tester.startPanel(new TestPanelSource() {
      public Panel getTestPanel(String panelId) {
        try {
          IProject project =  SimalRepositoryFactory.getProjectService().getProject(projectURI);
          ReadOnlyStyleBehavior rosb = new EditProjectPanel(panelId, project).new ReadOnlyStyleBehavior();
          return new SourceRepositoriesPanel(panelId, "Source Repositories", project.getRepositories(), rosb, project);
        } catch (SimalRepositoryException e) {
          fail(e.getMessage());
          return null;
        }
      }
View Full Code Here


  @Test
  public void testDeleteEntity() throws SimalRepositoryException,
      URISyntaxException {
    assertNotNull(project1);
    project1.delete();
    IProject project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(
        TEST_PROJECT_URI);
    assertNull("The simal project should have been deleted", project);
    // force the repo to be rebuilt
    getRepository().destroy();
    initRepository();
View Full Code Here

    out.writeObject(project1);
    out.close();

    FileInputStream fis = new FileInputStream(filename);
    ObjectInputStream in = new ObjectInputStream(fis);
    IProject project = (IProject) in.readObject();
    in.close();

    assertNotNull(project);
    assertEquals("URI after serialisation is not the same", project.getURI(),
        project1.getURI());
    assertEquals("Label after serialisation is not the same", project
        .getLabel(), project1.getLabel());
  }
View Full Code Here

  @SuppressWarnings("serial")
  public void testRenderPanel() {
    tester.startPanel(new TestPanelSource() {
      public Panel getTestPanel(String panelId) {
        try {
          IProject project = SimalRepositoryFactory.getProjectService().getProject(projectURI);
          EditProjectPanel editProjectPanel = new EditProjectPanel("editProjectPanel", project);
          return new ReleasesPanel(panelId, project.getReleases(), editProjectPanel.new ReadOnlyStyleBehavior());
        } catch (SimalRepositoryException e) {
          fail(e.getMessage());
          return null;
        }
      }
View Full Code Here

  public static void setUpBeforeClass() throws SimalRepositoryException {
    logger.error(" *************  QQQQQQQQQQQQQQ ********");
    UserApplication.setIsTest(true);
    UserApplication.initRepository(); // this initialises the repository and adds test data

    IProject project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(TEST_PROJECT_SEEALSO);
    projectURI = project.getURI();

    IPerson developer = SimalRepositoryFactory.getPersonService().findBySeeAlso("http://foo.org/~developer/#me");
    developerURI = developer.getURI();

    logProjectData("before");
View Full Code Here

    }
   
    Panel panel = tester.startPanel(new TestPanelSource() {
      public Panel getTestPanel(String panelId) {
        try {
          IProject project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(TEST_PROJECT_SEEALSO);
          Set<IDocument> homepages = project.getHomepages();
          return new DocumentSetPanel(panelId, "Homepage List", homepages, project) {

            public void addToModel(IDocument document) throws SimalException {
              getProject().addHomepage(document);
            }
View Full Code Here

    this.uri = uri;
  }

  @Override
  protected IResource load() {
    IProject project;
    try {
      project = SimalRepositoryFactory.getProjectService().getProject(uri);
    } catch (SimalRepositoryException e) {
      e.printStackTrace();
      project = null;
View Full Code Here

  }

  @After
  public void cleanUp() throws SimalRepositoryException {
    logProjectData("after");
    IProject project = SimalRepositoryFactory.getProjectService().getProject(
        "http://simal.oss-watch.ac.uk/loadFromFormTest#");
    if (project != null) {
      project.delete();
    }
    project = SimalRepositoryFactory.getProjectService().getProject(formInputURI);
    if (project != null) {
      project.delete();
    }
  }
View Full Code Here

    tester.assertNoErrorMessage();
   
    Set<IProject> projects = SimalRepositoryFactory.getProjectService().filterByName(TEST_RAW_RDF_PROJECT_NAME);
    assertEquals("Should only have one project returned with the raw RDF project name", 1, projects.size());
   
    IProject project = (IProject) projects.toArray()[0];

    project.delete();
    project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(
        TEST_RAW_RDF_URI);
    assertNull(project);
  }
View Full Code Here

  @Test
  public void testAddProjectFromScratch() throws SimalRepositoryException,
      URISyntaxException {
    String uri = RDFUtils.PROJECT_NAMESPACE_URI + "TestingProjectFromScratch";
    IProject project;
    try {
      project = SimalRepositoryFactory.getProjectService().createProject(uri);
      project.addName("Testing");
      project.setShortDesc("Just testing adding a manually built project");

      project = SimalRepositoryFactory.getProjectService().getProject(uri);
      assertNotNull("Project has not been added to repository", project);
      assertEquals("Project name is incorrectly set", "Testing", project
          .getName());

      project.delete();
    } catch (DuplicateURIException e) {
      fail(e.getMessage());
    }
  }
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.