Package org.apache.maven.it

Examples of org.apache.maven.it.Verifier$UserModelReader


        throws Exception
    {
        System.out.println( "  Building: " + projectName );

        File testDir = getTestDir( projectName );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        // Let's add alternate settings.xml setting so that the latest dependencies are used
        verifier.getCliOptions().add( "-s \"" + settingsFile.getAbsolutePath() + "\"" );
        verifier.getCliOptions().add( "-X" );
        verifier.localRepo = localRepositoryDir.getAbsolutePath();

        // On linux and macOSX, an exception is thrown if a build failure occurs underneath
        try
        {
            verifier.executeGoal( "package" );
        }
        catch ( VerificationException e )
        {
            //@TODO needs to be handled nicely in the verifier
            if ( expectNoError || e.getMessage().indexOf( "Exit code was non-zero" ) == -1 )
            {
                throw e;
            }
        }

        // If no error is expected make sure that error logs are free
        if ( expectNoError )
        {
            verifier.verifyErrorFreeLog();
        }
        verifier.resetStreams();
        return testDir;
    }
View Full Code Here


   
    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "generate-from-override" );
        Verifier verifier = new Verifier( dir.getAbsolutePath() );
       
        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
       
        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("Override:"));
View Full Code Here

    @SuppressWarnings( "unchecked" )
    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "custom-filter-delim" );
        Verifier verifier = new Verifier( dir.getAbsolutePath() );
       
        verifier.getCliOptions().add( "-X" );
       
        verifier.executeGoal( "validate" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
       
        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("Override: custom-filter-delim"));
View Full Code Here

    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "get-dependency-projects" );

        Verifier verifier;

        verifier = new Verifier( dir.getAbsolutePath() );
        verifier.executeGoal( "deploy" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        verifier = new Verifier( new File( dir, "project" ).getAbsolutePath() );

        verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.gdp" );

        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        File output = new File( dir, "project/target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );

        assertTrue(content.contains("Dependency Id: org.apache.maven.plugin.rresource.it.gdp:release:1.0"));
View Full Code Here

   
    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "generate-from-bundle-with-type-and-classifier" );
        Verifier verifier = new Verifier( dir.getAbsolutePath() );
       
        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
       
        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("Built-In:"));
View Full Code Here

    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "bad-dependency-poms" );

        Verifier verifier;

        verifier = new Verifier( dir.getAbsolutePath() );
        verifier.deleteArtifacts( "test" );
        verifier.getSystemProperties().setProperty( "it.dir", dir.getAbsolutePath() );
        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );

        assertTrue(content.contains("Dependency Id: test:missing:0.1"));
View Full Code Here

        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "supplemental-artifact" );
        File resources = new File( dir, "resource-projects" );

        Verifier verifier;

        verifier = new Verifier( resources.getAbsolutePath() );
       
        verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.mrr43" );

        verifier.executeGoal( "deploy" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        verifier = new Verifier( dir.getAbsolutePath() );

        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("From: 'Deficient Tooling, Inc.' (http://www.deficient-tools.us/)"));
View Full Code Here

   
    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "filter-local-override" );
        Verifier verifier = new Verifier( dir.getAbsolutePath() );
       
        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
       
        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("Override: filter-local-override"));
View Full Code Here

   
    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "generate-from-bundle" );
        Verifier verifier = new Verifier( dir.getAbsolutePath() );
       
        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
       
        File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
        String content = FileUtils.fileRead( output );
       
        assertTrue(content.contains("Built-In:"));
View Full Code Here

    public void test()
        throws IOException, URISyntaxException, VerificationException
    {
        File dir = TestUtils.getTestDir( "run-only-at-execution-root" );

        Verifier verifier;

        verifier = new Verifier( new File( dir, "resource-projects" ).getAbsolutePath() );
        verifier.executeGoal( "deploy" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        verifier = new Verifier( dir.getAbsolutePath() );

        verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.mrr41" );

        verifier.executeGoal( "generate-resources" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        String depResource = "target/maven-shared-archive-resources/DEPENDENCIES";
        File output = new File( dir, depResource );
        assertTrue( output.exists() );
       
View Full Code Here

TOP

Related Classes of org.apache.maven.it.Verifier$UserModelReader

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.