Package org.apache.maven.plugin.testing.stubs

Examples of org.apache.maven.plugin.testing.stubs.MavenProjectStub


    @Test
    public void validateNoEvaluationIfProjectIsNotIncluded() throws Exception {

        // Assemble
        final MavenProjectStub excludedProject = new MavenProjectStub();
        excludedProject.setGroupId("org.foobar.api");
        excludedProject.setArtifactId("bar-api");
        excludedProject.setVersion("1.0.0");
        excludedProject.setPackaging("bundle");

        // Act & Assert
        unitUnderTest.execute(new MockEnforcerRuleHelper(excludedProject));
    }
View Full Code Here


    private MavenProject getStub(final String groupID,
                                 final String artifactID,
                                 final String version,
                                 final String packaging) {

        final MavenProject toReturn = new MavenProjectStub();
        toReturn.setGroupId(groupID);
        toReturn.setArtifactId(artifactID);
        toReturn.setVersion(version);
        toReturn.setPackaging(packaging);

        // Make sure we have a non-null DependencyArtifacts set.
        toReturn.setDependencyArtifacts(new HashSet<Object>());

        return toReturn;
    }
View Full Code Here

   {
      final File outputDirectoryToBeSet = new File( "target/pmd" );

      outputDirectoryToBeSet.mkdirs();

      final FlexPmdMojo mojo = new FlexPmdMojo( new MavenProjectStub(),
                                                new FlexPmdParameters( "",
                                                                       failOnError,
                                                                       false,
                                                                       outputDirectoryToBeSet,
                                                                       ruleset,
View Full Code Here

{
   @Test
   public void testExecuteReport() throws MojoExecutionException
   {
      new File( "target/site" ).mkdirs();
      final FlexPmdReportMojo mojo = new FlexPmdReportMojo( new MavenProjectStub(),
                                                            new FlexPmdParameters( "",
                                                                                   false,
                                                                                   false,
                                                                                   new File( "target" ),
                                                                                   null,
View Full Code Here

   @Test
   public void testExecuteReportOnNoViolationsSourcePath() throws MojoExecutionException
   {
      new File( "target/site" ).mkdirs();
      final FlexPmdReportMojo mojo = new FlexPmdReportMojo( new MavenProjectStub(),
                                                            new FlexPmdParameters( "",
                                                                                   false,
                                                                                   false,
                                                                                   new File( "target" ),
                                                                                   null,
View Full Code Here

   public void testExecute() throws MojoExecutionException,
                            IOException
   {
      final FlexCpdMojo mojo = new FlexCpdMojo( new File( "target" ),
                                                getTestDirectory(),
                                                new MavenProjectStub() );

      mojo.setSiteRenderer( new DefaultSiteRenderer() );
      mojo.execute();
   }
View Full Code Here

public class FlexMetricsReportMojoTest extends FlexPmdTestBase
{
   @Test
   public void executeMultipleReport() throws MojoExecutionException
   {
      final MavenProjectStub project = new MavenProjectStub();
      final File outputDirectoryToBeSet = new File( project.getBasedir().getAbsolutePath()
            + "/target/pmd" );
      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( project, null, outputDirectoryToBeSet );

      outputDirectoryToBeSet.mkdirs();
      mojo.addReactorProject( new MavenProjectStub() );
      mojo.addReactorProject( new MavenProjectStub() );
      mojo.setLineThreshold( 5 );
      mojo.setSiteRenderer( new DefaultSiteRenderer() );
      mojo.setXmlOutputDirectory( outputDirectoryToBeSet );
      mojo.setTempFileName( "javancss-raw-report.xml" );
View Full Code Here

   {
      final File outputDirectoryToBeSet = new File( "target/pmd" );

      outputDirectoryToBeSet.mkdirs();

      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( new MavenProjectStub(),
                                                                    getTestDirectory(),
                                                                    outputDirectoryToBeSet );

      mojo.setLineThreshold( 5 );
      mojo.setSiteRenderer( new DefaultSiteRenderer() );
View Full Code Here

   {
      final File outputDirectoryToBeSet = new File( "target/pmd" );

      outputDirectoryToBeSet.mkdirs();

      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( new MavenProjectStub(),
                                                                    new File( "nonExisting" ),
                                                                    outputDirectoryToBeSet );

      mojo.setLineThreshold( 5 );
      mojo.setSiteRenderer( new DefaultSiteRenderer() );
View Full Code Here

   @Test
   public void executeReport() throws MojoExecutionException,
                              MojoFailureException
   {
      final MavenProjectStub project = new MavenProjectStub();
      final File outputDirectoryToBeSet = new File( project.getBasedir().getAbsolutePath()
            + "/target/pmd" );
      final FlexMetricsReportMojo reportMojo = new FlexMetricsReportMojo( project,
                                                                          getTestDirectory(),
                                                                          outputDirectoryToBeSet );
      final FlexMetricsMojo mojo = new FlexMetricsMojo( outputDirectoryToBeSet, getTestDirectory() );
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.testing.stubs.MavenProjectStub

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.