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

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


        check.execute();
    }

    @Test
    public void test_load_header_from_absolute_file() throws Exception {
        MavenProjectStub project = new MavenProjectStub();
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "src/test/resources/check/header.txt";
        check.project = project;
        check.failIfMissing = false;
View Full Code Here


        check.execute();
    }

    @Test
    public void test_load_header_from_project_classpath() throws Exception {
        MavenProjectStub project = new MavenProjectStub();
        project.addCompileSourceRoot("src/test/resources/check/cp");
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header-in-cp.txt";
        check.project = project;
        check.failIfMissing = false;
View Full Code Here

        check.execute();
    }

    @Test
    public void test_load_header_from_plugin_classpath() throws Exception {
        MavenProjectStub project = new MavenProjectStub();
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "test-header1.txt";
        check.project = project;
        check.failIfMissing = false;
View Full Code Here

    @Test(expectedExceptions = MojoExecutionException.class)
    public void test_fail() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.strictCheck = true;
        check.execute();
    }
View Full Code Here

    @Test
    public void test_not_fail() throws Exception {
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header.txt";
        check.project = new MavenProjectStub();
        check.failIfMissing = false;
        check.strictCheck = true;
        check.execute();
    }
View Full Code Here

        FileUtils.copyFileToFolder(new File("src/test/resources/update/doc2.txt"), tmp);

        LicenseFormatMojo updater = new LicenseFormatMojo();
        updater.basedir = tmp;
        updater.header = "src/test/resources/update/header.txt";
        updater.project = new MavenProjectStub();
        updater.execute();

        assertEquals(FileUtils.read(new File(tmp, "doc1.txt"), System.getProperty("file.encoding")), "====\r\n    My @Copyright license 2\r\n====\r\n\r\nsome data\r\n");
        assertEquals(FileUtils.read(new File(tmp, "doc2.txt"), System.getProperty("file.encoding")), "====\r\n    My @Copyright license 2\r\n====\r\n\r\nsome data\r\n");
    }
View Full Code Here

        LicenseFormatMojo updater = new LicenseFormatMojo();
        updater.basedir = tmp;
        updater.header = "src/test/resources/update/header.txt";
        updater.mapping = new HashMap<String, String>() {{put("properties", "SCRIPT_STYLE");}};
        updater.project = new MavenProjectStub();
        updater.execute();

        String test1 = FileUtils.read(new File(tmp, "test1.properties"), System.getProperty("file.encoding"));
        String test2 = FileUtils.read(new File(tmp, "test2.properties"), System.getProperty("file.encoding"));
        String test3 = FileUtils.read(new File(tmp, "test3.properties"), System.getProperty("file.encoding"));
View Full Code Here

        LicenseFormatMojo updater = new LicenseFormatMojo();
        updater.basedir = tmp;
        updater.header = "src/test/resources/update/header.txt";
        updater.mapping = new HashMap<String, String>() {{put("properties", "SCRIPT_STYLE");}};
        updater.project = new MavenProjectStub();
        updater.execute();

        assertEquals(FileUtils.read(new File(tmp, "test1.php"), System.getProperty("file.encoding")), "\r\n" +
                "\r\n" +
                "<?php\r\n" +
View Full Code Here

        FileUtils.copyFileToFolder(new File("src/test/resources/update/issue44/test.asp"), tmp);

        LicenseFormatMojo updater = new LicenseFormatMojo();
        updater.basedir = tmp;
        updater.header = "src/test/resources/update/header.txt";
        updater.project = new MavenProjectStub();
        updater.execute();

        assertEquals(FileUtils.read(new File(tmp, "issue44-3.rb"), System.getProperty("file.encoding")), "#\n" +
                "# My @Copyright license 2\n" +
                "#\n" +
View Full Code Here

*/
public final class CheckTest {

    @Test
    public void test_line_wrapping() throws Exception {
        MavenProjectStub project = new MavenProjectStub();

        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check/linewrap");
        check.header = "header.txt";
        check.project = project;
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.