Package org.jboss.forge.addon.projects

Examples of org.jboss.forge.addon.projects.Project


   @Test
   public void testMergedConfigList() throws Exception
   {
      addPropsToUserConfig();
      Project project = projectFactory.createTempProject();
      Configuration projectConfig = project.getFacet(ConfigurationFacet.class).getConfiguration();
      addPropsToProjectConfig(projectConfig);
      test.getShell().setCurrentResource(project.getRoot());
      test.execute("config-list", 5, TimeUnit.SECONDS);
      Assert.assertThat(test.getStdOut(), containsString("key1=user: [userValue1]"));
      Assert.assertThat(test.getStdOut(), containsString("key2=user: [userValue2], project: [projectValue2]"));
      Assert.assertThat(test.getStdOut(), containsString("key3=project: [projectValue3]"));
   }
View Full Code Here


   {
      String beanName = named.getValue();
      String beanPackage = targetPackage.getValue();
      DirectoryResource targetDir = targetLocation.getValue();
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JavaResource javaResource;
      if (project == null)
      {
         javaResource = facesOperations.newBackingBean(targetDir, beanName, beanPackage);
      }
View Full Code Here

   @Override
   public NavigationResult getPrerequisiteCommands(UIContext context)
   {
      NavigationResultBuilder builder = NavigationResultBuilder.create();
      Project project = getSelectedProject(context);
      if (project != null)
      {
         if (!project.hasFacet(CDIFacet.class))
         {
            builder.add(CDISetupCommand.class);
         }
         if (!project.hasFacet(FacesFacet.class))
         {
            builder.add(FacesSetupWizardImpl.class);
         }
      }
      return builder.build();
View Full Code Here

   private ProjectFactory projectFactory;

   @Test
   public void testLsCommand() throws Exception
   {
      Project project = projectFactory.createTempProject();
      String projectPath = project.getRoot().getFullyQualifiedName();
      shellTest.execute("cd " + projectPath, 5, TimeUnit.SECONDS);
      shellTest.execute("touch file.txt", 5, TimeUnit.SECONDS);
      shellTest.clearScreen();
      shellTest.execute("ls *file*", 5, TimeUnit.SECONDS);
      Assert.assertThat(shellTest.getStdOut(), CoreMatchers.containsString("file.txt"));
View Full Code Here

   }

   @Test
   public void testLsCommandFailed() throws Exception
   {
      Project project = projectFactory.createTempProject();
      String projectPath = project.getRoot().getFullyQualifiedName();
      shellTest.execute("cd " + projectPath, 5, TimeUnit.SECONDS);
      shellTest.clearScreen();
      Result result = shellTest.execute(
               "ls foo" + File.separator + "jee-example-app-1.0.0.ear", 5,
               TimeUnit.SECONDS);
View Full Code Here

   }

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      final Project project = getSelectedProject(builder);
      setupEntities(builder.getUIContext());
      setupRelationshipType();
      final List<String> types = Arrays.asList("byte", "float", "char", "double", "int", "long", "short", "boolean",
               "String", "java.util.Date");
      type.setCompleter(new UICompleter<String>()
View Full Code Here

   }

   private void setupEntities(UIContext context)
   {
      UISelection<FileResource<?>> selection = context.getInitialSelection();
      Project project = getSelectedProject(context);
      final List<JavaResource> entities = getProjectEntities(project);
      targetEntity.setValueChoices(entities);
      int idx = -1;
      if (!selection.isEmpty())
      {
View Full Code Here

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Project project = getSelectedProject(context);
      JavaResource javaResource = targetEntity.getValue();
      String fieldNameStr = named.getValue();
      JavaClassSource targetEntity = javaResource.getJavaType();
      FieldSource<JavaClassSource> field = targetEntity.getField(fieldNameStr);
      String action = (field == null) ? "created" : "updated";
View Full Code Here

    */
   private void setCurrentWorkingResource(UIExecutionContext context, JavaResource javaResource,
            Field<JavaClassSource> field)
            throws FileNotFoundException
   {
      Project selectedProject = getSelectedProject(context);
      if (selectedProject != null)
      {
         JavaSourceFacet facet = selectedProject.getFacet(JavaSourceFacet.class);
         facet.saveJavaSource(field.getOrigin());
      }
      context.getUIContext().setSelection(javaResource);
   }
View Full Code Here

   @Override
   public NavigationResult getPrerequisiteCommands(UIContext context)
   {
      NavigationResultBuilder builder = NavigationResultBuilder.create();
      Project project = getSelectedProject(context);
      if (project != null)
      {
         if (!project.hasFacet(JPAFacet.class))
         {
            builder.add(JPASetupWizard.class);
         }
      }
      return builder.build();
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.projects.Project

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.