Exemplo n.º 1
0
 @Test
 public void testCreateTempProjectWithBuildSystem() throws Exception {
   ProjectProvider buildSystem = buildSystems.get();
   try {
     Project project = projectFactory.createTempProject(buildSystem);
     Assert.assertNotNull(project);
   } finally {
     buildSystems.release(buildSystem);
   }
 }
Exemplo n.º 2
0
 @Test
 public void testCreateTempProjectWithBuildSystemAndFacets() {
   ProjectProvider buildSystem = buildSystems.get();
   try {
     Project project =
         projectFactory.createTempProject(
             buildSystem, Arrays.<Class<? extends ProjectFacet>>asList(WebResourcesFacet.class));
     Assert.assertNotNull(project);
     Assert.assertTrue(project.hasFacet(WebResourcesFacet.class));
   } finally {
     buildSystems.release(buildSystem);
   }
 }
Exemplo n.º 3
0
  @Test
  public void testContainsProjectWithBuildSystem() {
    ProjectProvider buildSystem = buildSystems.get();
    try {
      Project project = projectFactory.createTempProject(buildSystem);
      Assert.assertNotNull(project);
      Resource<?> projectRoot = project.getRoot();
      Assert.assertTrue(projectFactory.containsProject(projectRoot, projectRoot, buildSystem));
      Assert.assertTrue(
          projectFactory.containsProject(projectRoot, projectRoot.getChild("src"), buildSystem));

      projectRoot.delete(true);
      Assert.assertFalse(projectFactory.containsProject(projectRoot, projectRoot, buildSystem));
    } finally {
      buildSystems.release(buildSystem);
    }
  }
Exemplo n.º 4
0
 @Override
 public Iterable<UICommand> getCommands() {
   Set<UICommand> result = new HashSet<>();
   synchronized (this) {
     Imported<CommandProvider> instances = registry.getServices(CommandProvider.class);
     for (CommandProvider provider : instances) {
       Iterable<UICommand> commands = provider.getCommands();
       Iterator<UICommand> iterator = commands.iterator();
       while (iterator.hasNext()) {
         try {
           UICommand command = iterator.next();
           if (!(command instanceof UIWizardStep)) {
             result.add(command);
           }
         } catch (Exception e) {
           log.log(Level.SEVERE, "Error while retrieving command instance", e);
         }
       }
       instances.release(provider);
     }
   }
   return result;
 }