o Strengthended IT for MNG-3892 to check existence of installed/deployed files

o Deleted it0003 which is only a subset of MNG-3892

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@729919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-12-29 15:51:46 +00:00
parent f99b1074a7
commit e66a4a216c
8 changed files with 18 additions and 106 deletions

View File

@ -317,7 +317,6 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenIT0007Test.class );
suite.addTestSuite( MavenIT0005Test.class );
suite.addTestSuite( MavenIT0004Test.class );
suite.addTestSuite( MavenIT0003Test.class );
/*
* Add tests in reverse alpha order above.

View File

@ -1,52 +0,0 @@
package org.apache.maven.it;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
public class MavenIT0003Test
extends AbstractMavenIntegrationTestCase
{
/**
* Builds upon it0001: we add a jar installation step. We delete the JAR
* from the local repository to make sure it is there post build.
*/
public void testit0003()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0003" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.deleteArtifact( "org.apache.maven", "maven-it-it0003", "1.0", "jar" );
verifier.executeGoal( "install" );
verifier.assertFilePresent( "target/classes/org/apache/maven/it0003/Person.class" );
verifier.assertFilePresent( "target/test-classes/org/apache/maven/it0003/PersonTest.class" );
verifier.assertFilePresent( "target/maven-it-it0003-1.0.jar" );
verifier.assertFilePresent( "target/maven-it-it0003-1.0.jar!/it0003.properties" );
verifier.assertArtifactPresent( "org.apache.maven.its.it0003", "maven-it-it0003", "1.0", "jar" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}

View File

@ -49,10 +49,27 @@ public class MavenITmng3892ReleaseDeploymentTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "repo" );
verifier.deleteArtifacts( "org.apache.maven.its.mng3892" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertArtifactPresent( "org.apache.maven.its.mng3892", "test", "1.0", "pom" );
verifier.assertArtifactPresent( "org.apache.maven.its.mng3892", "test", "1.0", "jar" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/maven-metadata.xml" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/maven-metadata.xml.md5" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/maven-metadata.xml.sha1" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.pom" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.pom.md5" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.pom.sha1" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.jar" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.jar.md5" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0.jar.sha1" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0-it.jar" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0-it.jar.md5" );
verifier.assertFilePresent( "repo/org/apache/maven/its/mng3892/test/1.0/test-1.0-it.jar.sha1" );
}
}

View File

@ -1,20 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<name>Maven Integration Test :: it0003</name>
<groupId>org.apache.maven.its.it0003</groupId>
<artifactId>maven-it-it0003</artifactId>
<description>Builds upon it0001: we add a jar installation step. We delete the JAR
from the local repository to make sure it is there post build.
</description>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0003;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0003;
import junit.framework.TestCase;
public class PersonTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}

View File

@ -62,6 +62,7 @@ under the License.
<goal>set</goal>
<goal>attach</goal>
<goal>attach-pom</goal>
<goal>release</goal>
<goal>install</goal>
<goal>deploy</goal>
</goals>