Package org.apache.maven.it

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


    {
        if ( !installed )
        {
            File bootstrapDir = TestUtils.getTestDir( "bootstrap" );
           
            Verifier verifier = new Verifier( bootstrapDir.getAbsolutePath() );
           
            verifier.executeGoal( "deploy" );
           
            verifier.verifyErrorFreeLog();
            verifier.resetStreams();
           
            installed = true;
        }
    }
View Full Code Here


        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
        String localRepo = System.getProperty( "localRepositoryPath" );
        verifier.setLocalRepo( localRepo );

        verifier.getCliOptions().add( "-s \"" + settingsFile.getAbsolutePath() + "\"" );//
        verifier.getCliOptions().add( "-X" );
        verifier.localRepo = localRepo;

        // 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().contains( "Exit code was non-zero" ) )
            {
                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

  @SuppressWarnings("unchecked")
  @Test
  public void testPackageIt() throws Exception {
    File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/project-with-cycles");

    Verifier verifier = new Verifier(testDir.getAbsolutePath());
    verifier.deleteArtifact("org.st-js", "project-with-cycles", "1.0.0-SNAPSHOT", "jar");

    try {
      verifier.getCliOptions().add("-Dstjs.version=" + System.getProperty("stjs.version"));
      verifier.executeGoal("install");
    }
    catch (Exception e) {
      // it should break here
    }

    verifier.verifyTextInLog("Cycles are detected");

  }
View Full Code Here

  @Test
  public void testPackageIt() throws Exception {

    File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/package-js-war");

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

    verifier.deleteArtifact("org.st-js", "package-js-war", "1.0.0-SNAPSHOT", "war");

    // coming from the configuration of surefire plugin outside
    verifier.getCliOptions().add("-Dstjs.version=" + System.getProperty("stjs.version"));

    verifier.executeGoal("install");

    verifier.verifyErrorFreeLog();

    String artifactFile = verifier.getArtifactPath("org.st-js", "package-js-war", "1.0.0-SNAPSHOT", "war");
    Set<String> entryNames = JarUtils.getJarEntries(artifactFile);

    assertContainsEntry(entryNames, "generated-js/stjs.js");
    assertContainsEntry(entryNames, "generated-js/org/stjs/example/lib/stjs/STJSLibExample.js");
    assertContainsEntry(entryNames, "WEB-INF/classes/org/stjs/example/lib/stjs/STJSLibExample.stjs");
    assertContainsEntry(entryNames, "js/stjs/example/stjs-lib-example.js");
    // check that jquery is copied as well
    assertContainsEntry(entryNames, "generated-js/jquery/jquery.js");
    verifier.resetStreams();

  }
View Full Code Here

  @Test
  public void testPackageIt() throws Exception {

    File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/package-js-jar");

    Verifier verifier = new Verifier(testDir.getAbsolutePath());
    verifier.deleteArtifact("org.st-js", "package-js-jar", "1.0.0-SNAPSHOT", "jar");

    // coming from the configuration of surefire plugin outside
    verifier.getCliOptions().add("-Dstjs.version=" + System.getProperty("stjs.version"));

    verifier.executeGoal("install");

    verifier.verifyErrorFreeLog();

    String artifactFile = verifier.getArtifactPath("org.st-js", "package-js-jar", "1.0.0-SNAPSHOT", "jar");
    Set<String> entryNames = JarUtils.getJarEntries(artifactFile);

    assertContainsEntry(entryNames, "stjs.js");
    assertContainsEntry(entryNames, "org/stjs/example/lib/stjs/STJSLibExample.js");
    assertContainsEntry(entryNames, "org/stjs/example/lib/stjs/STJSLibExample.stjs");
    assertContainsEntry(entryNames, "stjs/example/stjs-lib-example.js");
    assertContainsEntry(entryNames, "DefaultPackageExample.js");
    verifier.resetStreams();

  }
View Full Code Here

{
    public void testit0007()
        throws Exception
    {
        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0007-CSharpCompileTestLibrary" );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        verifier.executeGoal( "install" );
        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/App.cs" );
        verifier.assertFilePresent( "target/" + BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0007.cs" );
        verifier.assertFilePresent( "target/NMaven.It.It0007-1.0.0-test.dll" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
    }
View Full Code Here

{
    public void testit0003()
        throws Exception
    {
        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0003-CSharpCompileWinexe" );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        verifier.executeGoal( "install" );
        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0003.cs" );
        verifier.assertFilePresent( "target/comments.xml" );
        verifier.assertFilePresent( "target/NMaven.It.It0003-1.0.0.exe" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
    }
View Full Code Here

        String artifactName = artifactId + "-1.0.0";
        String metadataDir = "target/test-repo/NMaven/Its/" + artifactId + "/";
        String artifactDir = metadataDir + "1.0.0/";

        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0011-DeployExe" );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        verifier.executeGoal( "deploy" );
        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0011.cs" );
        verifier.assertFilePresent( "target/" + artifactName + ".exe" );
        verifier.assertFilePresent( artifactDir + artifactName + ".exe" );
        verifier.assertFilePresent( artifactDir + artifactName + ".pom" );
        verifier.assertFilePresent( metadataDir + "maven-metadata.xml" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
    }
View Full Code Here

    public void testit0017()
        throws Exception
    {
        File testDir =
            ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0017-CSharpStrongNamedAssembly" );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        verifier.executeGoal( "install" );
        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0017.cs" );
        verifier.assertFilePresent( "target/NMaven.It.It0017-1.0.0.dll" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
    }
View Full Code Here

{
    public void testit0002()
        throws Exception
    {
        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0002-CSharpCompileModule" );
        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
        verifier.executeGoal( "install" );
        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0002.cs" );
        verifier.assertFilePresent( "target/comments.xml" );
        verifier.assertFilePresent( "target/NMaven.It.It0002-1.0.0.netmodule" );
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();
    }
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.