Package com.google.code.mojo.license

Examples of com.google.code.mojo.license.LicenseCheckMojo


public class LicenseCheckMojoTest
{
    @Test(expectedExceptions = MojoFailureException.class)
    public void test_execution() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File(".");
                super.header = "src/etc/header.txt";
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here


    }

    @Test
    public void test_execution_quiet() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File(".");
                super.header = "src/etc/header.txt";
                super.quiet = true;
                super.failIfMissing = false;
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test
    public void test_execution_no_mapping() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File(".");
                super.header = "src/etc/header.txt";
                super.useDefaultMapping = false;
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(expectedExceptions = InvalidResourceException.class)
    public void test_execution_bad_header() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File(".");
                super.header = "src/etc/header_bad.txt";
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(expectedExceptions = MojoFailureException.class)
    public void test_execution_url_file_system() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File("src/test/project");
                super.header = "documents/header.txt";
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(dependsOnMethods = "remove_missing_header", expectedExceptions = MojoFailureException.class)
    public void check_before_add() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File("target/documents1");
                super.header = "target/documents1/header.txt";
                super.excludes = new String[] {"*.svn-base", "*header.txt"};
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
                super.mapping = new HashMap<String, String>()
                {
                    {
                        put("toto", "xml");
                    }
                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }
   
    @Test(expectedExceptions = MojoFailureException.class)
    public void test_execution_url_classpath() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File(".");
                super.header = "header.txt"; // locate in test/resources
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(dependsOnMethods = "add_header")
    public void check_after_add() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File("target/documents1");
                super.header = "target/documents1/header.txt";
                super.excludes = new String[] {"*.svn-base", "*header.txt"};
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
                super.mapping = new HashMap<String, String>()
                {
                    {
                        put("toto", "xml");
                    }
                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(dependsOnMethods = "remove_header", expectedExceptions = MojoFailureException.class)
    public void check_after_remove_header() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File("target/documents1");
                super.header = "target/documents1/header.txt";
                super.excludes = new String[] {"*.svn-base", "*header.txt"};
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2010");
                        put("email", "mathieu.carbou@gmail.com");
                    }

                };
                super.mapping = new HashMap<String, String>()
                {
                    {
                        put("toto", "xml");
                    }
                };
            }
        };
        mojo.execute();
    }
View Full Code Here

    }

    @Test(expectedExceptions = MojoFailureException.class)
    public void test_check_before() throws Exception
    {
        LicenseCheckMojo mojo = new LicenseCheckMojo()
        {
            {
                super.basedir = new File("target/documents2");
                super.header = "target/documents2/other-header.txt";
                super.includes = new String[] {"**/MockIP.java"};
                super.properties = new HashMap<String, String>()
                {
                    {
                        put("year", "2008");
                        put("email", "test@gmail.com");
                    }

                };
            }
        };
        mojo.execute();
    }
View Full Code Here

TOP

Related Classes of com.google.code.mojo.license.LicenseCheckMojo

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.