Package org.apache.maven.plugin.eclipse.writers.testutils

Examples of org.apache.maven.plugin.eclipse.writers.testutils.TestEclipseWriterConfig


    public void testWrite_preservingLinkedResources()
        throws MojoExecutionException, JDOMException, IOException, XmlPullParserException
    {

        // create the config and the logger
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();
        TestLog log = new TestLog();

        // setup the eclipse project
        File basedir = fileManager.createTempDir();
        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );
        config.setEclipseProjectName( "test-project" );
        MavenProject project = new MavenProject();
        config.setProject( project );
        EclipseProjectWriter projectWriter = new EclipseProjectWriter();
        // create the .project file and start writing the contents
        File dotProject = new File( config.getEclipseProjectDirectory(), ".project" );
        Writer w = new OutputStreamWriter( new FileOutputStream( dotProject ), "UTF-8" );
        XMLWriter writer = new PrettyPrintXMLWriter( w );

        writer.startElement( "projectDescription" );
View Full Code Here


     */
    public void testWriteEjbComponentMECLIPSE455()
        throws MojoExecutionException, IOException, JDOMException
    {

        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        config.setWtpVersion( 1.5f );
        config.setEclipseProjectName( "test-project" );

        File basedir = fileManager.createTempDir();
        File pom = new File( basedir, "pom.xml" );
        pom.createNewFile();

        MavenProject project = new MavenProject();
        project.setFile( pom );

        config.setProject( project );
        config.setProjectBaseDir( basedir );

        config.setEclipseProjectDirectory( basedir );
        config.setPackaging( "ear" );

        // add an ejb3 and ejb packaged dependency
        config.setDeps( new IdeDependency[] { createDep( "ejb" ), createDep( "jar" ) } );

        EclipseWtpComponentWriter lWriter = new EclipseWtpComponent15Writer();

        Log log = new TestLog();

View Full Code Here

    }

    public void testWrite_ShouldMaskOutputDirsNestedWithinAnExistingOutputDir()
        throws MojoExecutionException, JDOMException, IOException
    {
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        File basedir = fileManager.createTempDir();

        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );

        String baseOutputDir = "target/classes";
        String maskedOutputDir = "target/classes/main-resources";

        File buildOutputDir = new File( basedir, baseOutputDir );
        buildOutputDir.mkdirs();

        config.setBuildOutputDirectory( buildOutputDir );

        new File( basedir, maskedOutputDir ).mkdirs();

        EclipseSourceDir dir =
            new EclipseSourceDir( "src/main/resources", "target/classes", true, false, null, null, false );
        EclipseSourceDir testDir =
            new EclipseSourceDir( "src\\test\\resources", "target/classes/test-resources", true, true, null, null,
                                  false );

        EclipseSourceDir[] dirs = { dir, testDir };

        config.setSourceDirs( dirs );

        config.setEclipseProjectName( "test-project" );

        TestLog log = new TestLog();

        EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter();
        classpathWriter.init( log, config );
View Full Code Here

    }

    public void testWrite_ShouldGenerateValidJavadocURLs()
        throws MojoExecutionException, JDOMException, IOException
    {
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        File basedir = fileManager.createTempDir();

        File repoDir = new File( basedir, "repo" );
        config.setLocalRepository( new StubArtifactRepository( repoDir.getPath() ) );

        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );

        String baseOutputDir = "target/classes";
        String maskedOutputDir = "target/classes/main-resources";

        File buildOutputDir = new File( basedir, baseOutputDir );
        buildOutputDir.mkdirs();

        config.setBuildOutputDirectory( buildOutputDir );

        new File( basedir, maskedOutputDir ).mkdirs();

        config.setEclipseProjectName( "test-project" );

        IdeDependency dependency = new IdeDependency();
        dependency.setFile( new File( repoDir, "g/a/v/a-v.jar" ) );
        dependency.setGroupId( "g" );
        dependency.setArtifactId( "a" );
        dependency.setVersion( "v" );
        dependency.setAddedToClasspath( true );
        dependency.setJavadocAttachment( new File( System.getProperty( "user.home" ), ".m2/some.jar" ) );

        config.setDeps( new IdeDependency[] { dependency } );

        TestLog log = new TestLog();

        EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter();
        classpathWriter.init( log, config );
View Full Code Here

    public void testWrite_preservingLinkedResources()
        throws MojoExecutionException, JDOMException, IOException, XmlPullParserException
    {

        // create the config and the logger
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();
        TestLog log = new TestLog();

        // setup the eclipse project
        File basedir = fileManager.createTempDir();
        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );
        config.setEclipseProjectName( "test-project" );
        MavenProject project = new MavenProject();
        config.setProject( project );
        EclipseProjectWriter projectWriter = new EclipseProjectWriter();
        // create the .project file and start writing the contents
        File dotProject = new File( config.getEclipseProjectDirectory(), ".project" );
        Writer w = new OutputStreamWriter( new FileOutputStream( dotProject ), "UTF-8" );
        XMLWriter writer = new PrettyPrintXMLWriter( w );

        writer.startElement( "projectDescription" );
View Full Code Here

     */
    public void testWriteEjbComponentMECLIPSE455()
        throws MojoExecutionException, IOException, JDOMException
    {

        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        config.setWtpVersion( 1.5f );
        config.setEclipseProjectName( "test-project" );

        File basedir = fileManager.createTempDir();
        File pom = new File( basedir, "pom.xml" );
        pom.createNewFile();

        MavenProject project = new MavenProject();
        project.setFile( pom );

        config.setProject( project );
        config.setProjectBaseDir( basedir );

        config.setEclipseProjectDirectory( basedir );
        config.setPackaging( "ear" );

        // add an ejb3 and ejb packaged dependency
        config.setDeps( new IdeDependency[] { createDep( "ejb" ), createDep( "jar" ) } );

        EclipseWtpComponentWriter lWriter = new EclipseWtpComponent15Writer();

        Log log = new TestLog();

View Full Code Here

    }

    public void testWrite_ShouldMaskOutputDirsNestedWithinAnExistingOutputDir()
        throws MojoExecutionException, JDOMException, IOException
    {
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        File basedir = fileManager.createTempDir();

        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );

        String baseOutputDir = "target/classes";
        String maskedOutputDir = "target/classes/main-resources";

        File buildOutputDir = new File( basedir, baseOutputDir );
        buildOutputDir.mkdirs();

        config.setBuildOutputDirectory( buildOutputDir );

        new File( basedir, maskedOutputDir ).mkdirs();

        EclipseSourceDir dir =
            new EclipseSourceDir( "src/main/resources", "target/classes", true, false, null, null, false );
        EclipseSourceDir testDir =
            new EclipseSourceDir( "src\\test\\resources", "target/classes/test-resources", true, true, null, null,
                                  false );

        EclipseSourceDir[] dirs = { dir, testDir };

        config.setSourceDirs( dirs );

        config.setEclipseProjectName( "test-project" );

        TestLog log = new TestLog();

        EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter();
        classpathWriter.init( log, config );
View Full Code Here

    }

    public void testWrite_ShouldGenerateValidJavadocURLs()
        throws MojoExecutionException, JDOMException, IOException
    {
        TestEclipseWriterConfig config = new TestEclipseWriterConfig();

        File basedir = fileManager.createTempDir();

        File repoDir = new File( basedir, "repo" );
        config.setLocalRepository( new StubArtifactRepository( repoDir.getPath() ) );

        config.setProjectBaseDir( basedir );
        config.setEclipseProjectDirectory( basedir );

        String baseOutputDir = "target/classes";
        String maskedOutputDir = "target/classes/main-resources";

        File buildOutputDir = new File( basedir, baseOutputDir );
        buildOutputDir.mkdirs();

        config.setBuildOutputDirectory( buildOutputDir );

        new File( basedir, maskedOutputDir ).mkdirs();

        config.setEclipseProjectName( "test-project" );

        IdeDependency dependency = new IdeDependency();
        dependency.setFile( new File( repoDir, "g/a/v/a-v.jar" ) );
        dependency.setGroupId( "g" );
        dependency.setArtifactId( "a" );
        dependency.setVersion( "v" );
        dependency.setAddedToClasspath( true );
        dependency.setJavadocAttachment( new File( System.getProperty( "user.home" ), ".m2/some.jar" ) );

        config.setDeps( new IdeDependency[] { dependency } );

        TestLog log = new TestLog();

        EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter();
        classpathWriter.init( log, config );
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.eclipse.writers.testutils.TestEclipseWriterConfig

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.