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

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


    @Test
    public void test_not_useDefaultMapping() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.useDefaultMapping = false;
        MockedLog logger = new MockedLog();
        check.setLog(new DefaultLog(logger));
        check.execute();
        assertFalse(logger.getContent().contains("header style: text"));
View Full Code Here


    @Test
    public void test_useDefaultMapping() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.useDefaultMapping = true;
        MockedLog logger = new MockedLog();
        check.setLog(new DefaultLog(logger));
        try {
            check.execute();
View Full Code Here

    @Test(expectedExceptions = MojoExecutionException.class)
    public void test_no_exclusions() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.excludes = new String[0];
        check.execute();
    }
View Full Code Here

    @Test
    public void test_exclusions() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.excludes = new String[] {"**/*.txt", "**/*.xml"};
        check.execute();
    }
View Full Code Here

    public void test_include_and_fail() throws Exception {
        try {
            LicenseCheckMojo check = new LicenseCheckMojo();
            check.basedir = new File("src/test/resources/check");
            check.header = "header.txt";
            check.project = new MavenProjectStub();
            check.excludes = new String[] {"doc1.txt"};
            check.useDefaultExcludes = false;
            check.execute();
        } catch (Exception e) {
            assertEquals("Some files do not have the expected license header", e.getMessage());
View Full Code Here

  protected WSDL2CodeMojo newMojo( String pDir, String pGoal ) throws Exception
  {
    File baseDir = new File(new File(getBasedir()), pDir);
    File testPom = new File( baseDir, "pom.xml" );
    WSDL2CodeMojo mojo = (WSDL2CodeMojo) lookupMojo( pGoal, testPom );
    MavenProjectStub project = new MavenProjectStub();
    project.setDependencyArtifacts( new HashSet() );
    setVariableValueToObject(mojo, "project", project);
    setVariableValueToObject(mojo, "pluginArtifacts", new ArrayList());
    setVariableValueToObject(mojo, "wsdlFile", new File(baseDir, "src/main/axis2/service.wsdl"));
    setVariableValueToObject(mojo, "outputDirectory", new File(baseDir, "target/generated-sources/axis2/wsdl2code"));
    setVariableValueToObject(mojo, "syncMode", "both");
View Full Code Here

        setVariableValueToObject( mojo, "useDefaultExcludes", Boolean.TRUE );
        setVariableValueToObject( mojo, "useMavenDefaultExcludes", Boolean.TRUE );
        setVariableValueToObject( mojo, "useEclipseDefaultExcludes", Boolean.TRUE );
        final Build build = new Build();
        build.setDirectory( buildDirectory.getPath() );
        final MavenProjectStub project = new MavenProjectStub(){
            public Build getBuild()
            {
                return build;
            }
        };
View Full Code Here

            assertTrue( true );
        }

        String impl = "org.apache.maven.tools.plugin.generator.stubs.MavenReportStub";

        MavenProjectStub stub = new MavenProjectStub();
        stub.setCompileSourceRoots( Collections.singletonList( getBasedir() + "/target/classes" ) );

        assertTrue( GeneratorUtils.isMavenReport( impl, stub ) );

        impl = "org.apache.maven.tools.plugin.util.stubs.MojoStub";
        assertFalse( GeneratorUtils.isMavenReport( impl, stub ) );
View Full Code Here

    protected WSDL2CodeMojo newMojo(String pDir, String pGoal) throws Exception {
        File baseDir = new File(new File(getBasedir()), pDir);
        File testPom = new File(baseDir, "pom.xml");
        WSDL2CodeMojo mojo = (WSDL2CodeMojo)lookupMojo(pGoal, testPom);
        MavenProjectStub project = new MavenProjectStub();
        project.setDependencyArtifacts(new HashSet());
        setVariableValueToObject(mojo, "project", project);
        setVariableValueToObject(mojo, "pluginArtifacts", new ArrayList());
        setVariableValueToObject(mojo, "wsdlFile",
                                 new File(baseDir, "src/main/axis2/service.wsdl"));
        setVariableValueToObject(mojo, "outputDirectory",
View Full Code Here

    protected Java2WSDLMojo newMojo( String pDir, String pGoal ) throws Exception
    {
        final File baseDir = new File(new File(getBasedir()), pDir);
        File testPom = new File( baseDir, "pom.xml" );
        Java2WSDLMojo mojo = (Java2WSDLMojo) lookupMojo( pGoal, testPom );
        MavenProjectStub project = new MavenProjectStub(){
            public File getBasedir() { return baseDir; }
        };
        setVariableValueToObject(mojo, "project", project);
        setVariableValueToObject(mojo, "outputFileName", WSDL_FILE);
        return mojo;
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.