[forge-dev] [JBoss JIRA] Created: (SEAMFORGE-268) Plugins plugin should have a command to create a new blank forge test-harness class

Lincoln Baxter III (JIRA) jira-events at lists.jboss.org
Thu Aug 4 13:01:31 EDT 2011


Plugins plugin should have a command to create a new blank forge test-harness class
-----------------------------------------------------------------------------------

                 Key: SEAMFORGE-268
                 URL: https://issues.jboss.org/browse/SEAMFORGE-268
             Project: Seam Forge
          Issue Type: Enhancement
          Components: Builtin Plugins
    Affects Versions: 1.0.0.Alpha4
            Reporter: Lincoln Baxter III


{code}/*
 * JBoss, Home of Professional Open Source
 * Copyright 2011, Red Hat, Inc., and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package com.example.plugin;

import javax.inject.Inject;

import org.jboss.arquillian.api.Deployment;
import org.jboss.forge.project.Project;
import org.jboss.forge.project.dependencies.DependencyResolver;
import org.jboss.forge.test.AbstractShellTest;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
 * 
 */
public class ExamplePluginTest extends AbstractShellTest
{
   // Notice that you may use injection to do verification of the internal state of the system. Or to perform additional
   // operations.
   @Inject
   private DependencyResolver resolver;

   @Deployment
   public static JavaArchive getDeployment()
   {
      // The deployment method is where you must add references to your classes, packages, and configuration files, via
      // Arquillian.
      return AbstractShellTest.getDeployment().addPackages(true, ExamplePlugin.class.getPackage());
   }

   @Test
   public void testInstallPrettyfaces() throws Exception
   {
      // Create a new barebones Java project
      Project p = initializeJavaProject();

      // Queue input lines to be read as the Shell executes.
      queueInputLines("y");

      // Execute a command. If any input is required, it will be read from queued input.
      getShell().execute("project add-dependency com.example:example-dependency");

      Assert.assertNotNull(resolver);
   }
}
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-dev mailing list