Package org.apache.maven.plugin.surefire.booterclient

Examples of org.apache.maven.plugin.surefire.booterclient.ForkConfiguration


                createInprocessStarter( provider, classLoaderConfiguration, runOrderParameters );
            result = surefireStarter.runSuitesInProcess( scanResult );
        }
        else
        {
            ForkConfiguration forkConfiguration = getForkConfiguration();
            if ( getLog().isDebugEnabled() )
            {
                showMap( getEnvironmentVariables(), "environment variable" );
            }
View Full Code Here


        Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );

        final Classpath bootClasspathConfiguration =
            getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );

        return new ForkConfiguration( bootClasspathConfiguration, tmpDir, getEffectiveDebugForkedProcess(),
                                      getEffectiveJvm(),
                                      getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                                      getArgLine(), getEnvironmentVariables(), getLog().isDebugEnabled(),
                                      getEffectiveForkCount(), reuseForks );
    }
View Full Code Here

                createInprocessStarter( provider, classLoaderConfiguration, runOrderParameters );
            result = surefireStarter.runSuitesInProcess( scanResult );
        }
        else
        {
            ForkConfiguration forkConfiguration = getForkConfiguration();
            if ( getLog().isDebugEnabled() )
            {
                showMap( getEnvironmentVariables(), "environment variable" );
            }
View Full Code Here

        Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );

        final Classpath bootClasspathConfiguration =
            getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );

        return new ForkConfiguration( bootClasspathConfiguration, tmpDir, getEffectiveDebugForkedProcess(),
                                      getEffectiveJvm(),
                                      getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                                      getProject().getModel().getProperties(),
                                      getArgLine(), getEnvironmentVariables(), getLog().isDebugEnabled(),
                                      getEffectiveForkCount(), reuseForks );
View Full Code Here

    }

    private void executeProvider( ProviderInfo provider, Summary summary )
        throws MojoExecutionException, MojoFailureException
    {
        ForkConfiguration forkConfiguration = getForkConfiguration();
        summary.reportForkConfiguration( forkConfiguration );
        ClassLoaderConfiguration classLoaderConfiguration = getClassLoaderConfiguration( forkConfiguration );
        try
        {
            final RunResult result;
            if ( ForkConfiguration.FORK_NEVER.equals( forkConfiguration.getForkMode() ) )
            {
                InPluginVMSurefireStarter surefireStarter =
                    createInprocessStarter( provider, forkConfiguration, classLoaderConfiguration );
                result = surefireStarter.runSuitesInProcess();
            }
View Full Code Here

        surefireBooterArtifact.isSnapshot(); // MNG-2961: before Maven 2.0.8, fixes getBaseVersion to be -SNAPSHOT if needed

        final Classpath bootClasspathConfiguration =
            getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );

        ForkConfiguration fork = new ForkConfiguration( bootClasspathConfiguration, getForkMode(), tmpDir );

        fork.setTempDirectory( tmpDir );

        processSystemProperties( !fork.isForking() );

        verifyLegalSystemProperties();

        if ( getLog().isDebugEnabled() )
        {
            showMap( getInternalSystemProperties(), "system property" );
        }

        Toolchain tc = getToolchain();

        if ( tc != null )
        {
            getLog().info( "Toolchain in " + getPluginName() + "-plugin: " + tc );
            if ( isForkModeNever() )
            {
                setForkMode( ForkConfiguration.FORK_ONCE );
            }
            if ( getJvm() != null )
            {
                getLog().warn( "Toolchains are ignored, 'executable' parameter is set to " + getJvm() );
            }
            else
            {
                setJvm( tc.findTool( "java" ) ); //NOI18N
            }
        }

        if ( fork.isForking() )
        {
            setUseSystemClassLoader( isUseSystemClassLoader() );

            fork.setSystemProperties( getInternalSystemProperties() );

            if ( "true".equals( getDebugForkedProcess() ) )
            {
                setDebugForkedProcess(
                    "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" );
            }

            fork.setDebugLine( getDebugForkedProcess() );

            if ( ( getJvm() == null || "".equals( getJvm() ) ) )
            {
                // use the same JVM as the one used to run Maven (the "java.home" one)
                setJvm( System.getProperty( "java.home" ) + File.separator + "bin" + File.separator + "java" );
                getLog().debug( "Using JVM: " + getJvm() );
            }

            fork.setJvmExecutable( getJvm() );

            if ( getWorkingDirectory() != null )
            {
                fork.setWorkingDirectory( getWorkingDirectory() );
            }
            else
            {
                fork.setWorkingDirectory( getBasedir() );
            }

            fork.setArgLine( getArgLine() );

            fork.setEnvironmentVariables( getEnvironmentVariables() );

            if ( getLog().isDebugEnabled() )
            {
                showMap( getEnvironmentVariables(), "environment variable" );

                fork.setDebug( true );
            }

            if ( getArgLine() != null )
            {
                List<String> args = Arrays.asList( getArgLine().split( " " ) );
                if ( args.contains( "-da" ) || args.contains( "-disableassertions" ) )
                {
                    setEnableAssertions( false );
                }
            }

            if ( fork.getForkMode().equals( ForkConfiguration.FORK_PERTHREAD ) )
            {
                fork.setThreadCount( getThreadCount() );
            }
            else
            {
                fork.setThreadCount( 1 );
            }
        }
        return fork;
    }
View Full Code Here

        assertFalse( summary.isForking() );
    }

    private ForkConfiguration createForkingConfiguration()
    {
        return new ForkConfiguration( null, ForkConfiguration.FORK_ALWAYS, null );
    }
View Full Code Here

        return new ForkConfiguration( null, ForkConfiguration.FORK_ALWAYS, null );
    }

    private ForkConfiguration createNonForkingConfiguration()
    {
        return new ForkConfiguration( null, ForkConfiguration.FORK_NEVER, null );
    }
View Full Code Here

                createInprocessStarter( provider, classLoaderConfiguration, runOrderParameters );
            result = surefireStarter.runSuitesInProcess( scanResult );
        }
        else
        {
            ForkConfiguration forkConfiguration = getForkConfiguration();
            if ( getLog().isDebugEnabled() )
            {
                showMap( getEnvironmentVariables(), "environment variable" );
            }
View Full Code Here

        Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );

        final Classpath bootClasspathConfiguration =
            getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );

        return new ForkConfiguration( bootClasspathConfiguration, tmpDir, getEffectiveDebugForkedProcess(),
                                      getEffectiveJvm(),
                                      getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                                      getArgLine(), getEnvironmentVariables(), getLog().isDebugEnabled(),
                                      getEffectiveForkCount(), reuseForks );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.surefire.booterclient.ForkConfiguration

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.