mirror of https://github.com/apache/maven.git
[MNG-7230] Replace assert by simpler but equivalent calls
This closes #111
This commit is contained in:
parent
4d3a6397fe
commit
d70be17830
|
@ -19,12 +19,13 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-469">MNG-469</a>.
|
||||
*
|
||||
|
@ -100,7 +101,7 @@ public class MavenITmng0469ReportConfigTest
|
|||
verifier.executeGoal( "validate" );
|
||||
Properties props = verifier.loadProperties( "target/config.properties" );
|
||||
assertEquals( "maven-it-plugin-site", props.getProperty( "project.reporting.plugins.0.artifactId" ) );
|
||||
assertFalse( "fail.properties".equals( props.getProperty( "project.reporting.plugins.0.configuration.children.infoFile.0.value" ) ) );
|
||||
assertNotEquals( "fail.properties", props.getProperty( "project.reporting.plugins.0.configuration.children.infoFile.0.value" ) );
|
||||
}
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Properties;
|
|||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.apache.maven.shared.utils.io.FileUtils;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-1751">MNG-1751</a>.
|
||||
*
|
||||
|
@ -77,7 +79,7 @@ public class MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest
|
|||
Properties checksums = verifier.loadProperties( "target/checksum.properties" );
|
||||
String sha1 = checksums.getProperty( "dep-0.1-SNAPSHOT.jar", "" ).toLowerCase( java.util.Locale.ENGLISH );
|
||||
assertEquals( sha1, 40, sha1.length() );
|
||||
assertFalse( "fc081cd365b837dcb01eb9991f21c409b155ea5c".equals( sha1 ) );
|
||||
assertNotEquals( "fc081cd365b837dcb01eb9991f21c409b155ea5c", sha1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3422">MNG-3422</a>.
|
||||
*
|
||||
|
@ -56,8 +58,8 @@ public class MavenITmng3422ActiveComponentCollectionTest
|
|||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/layout.properties" );
|
||||
assertFalse( "0".equals( props.getProperty( "layouts", "0" ) ) );
|
||||
assertFalse( "".equals( props.getProperty( "layouts.default", "" ) ) );
|
||||
assertNotEquals( "0", props.getProperty( "layouts", "0" ) );
|
||||
assertNotEquals( "", props.getProperty( "layouts.default", "" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class MavenITmng3807PluginConfigExpressionEvaluationTest
|
|||
{
|
||||
assertNotNull( value );
|
||||
assertTrue( value.length() > 0 );
|
||||
assertTrue( value, !value.contains( "${" ) );
|
||||
assertFalse( value, value.contains( "${" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.apache.maven.it;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.Collection;
|
|||
import java.util.Properties;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3843">MNG-3843</a>.
|
||||
*
|
||||
|
@ -137,7 +139,7 @@ public class MavenITmng3843PomInheritanceTest
|
|||
assertEquals( "child-1", props.getProperty( "project.artifactId" ) );
|
||||
assertEquals( "0.1", props.getProperty( "project.version" ) );
|
||||
assertEquals( "jar", props.getProperty( "project.packaging" ) );
|
||||
assertFalse( "parent-name".equals( props.getProperty( "project.name" ) ) );
|
||||
assertNotEquals( "parent-name", props.getProperty( "project.name" ) );
|
||||
assertEquals( "parent-description", props.getProperty( "project.description", "" ) );
|
||||
assertUrlCommon( "http://parent.url", props.getProperty( "project.url", "" ) );
|
||||
assertEquals( "2008", props.getProperty( "project.inceptionYear", "" ) );
|
||||
|
|
|
@ -90,9 +90,9 @@ public class MavenITmng3933ProfilesXmlActivationTest
|
|||
}
|
||||
}
|
||||
|
||||
assertEquals( null, props.getProperty( "project.properties.sysPropertyMissing" ) );
|
||||
assertEquals( null, props.getProperty( "project.properties.envPropertyMissing" ) );
|
||||
assertEquals( null, props.getProperty( "project.properties.filePropertyMissing" ) );
|
||||
assertNull( props.getProperty( "project.properties.sysPropertyMissing" ) );
|
||||
assertNull( props.getProperty( "project.properties.envPropertyMissing" ) );
|
||||
assertNull( props.getProperty( "project.properties.filePropertyMissing" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class MavenITmng4023ParentProfileOneTimeInjectionTest
|
|||
Properties props = verifier.loadProperties( "sub/target/config.properties" );
|
||||
assertEquals( "1", props.getProperty( "stringParams" ) );
|
||||
assertEquals( "test", props.getProperty( "stringParams.0" ) );
|
||||
assertEquals( null, props.getProperty( "stringParams.1" ) );
|
||||
assertNull( props.getProperty( "stringParams.1" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ public class MavenITmng4053PluginConfigAttributesTest
|
|||
assertEquals( "2", props.getProperty( "domParam.children.copy.0.attributes" ) );
|
||||
|
||||
assertEquals( "target", props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.dir" ) );
|
||||
assertEquals( null, props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.todir" ) );
|
||||
assertEquals( null, props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.overwrite" ) );
|
||||
assertNull( props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.todir" ) );
|
||||
assertNull( props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.overwrite" ) );
|
||||
assertEquals( "1", props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes" ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public class MavenITmng4361ForceDependencySnapshotUpdateTest
|
|||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
|
||||
assertEquals( null, verifier.loadProperties( "target/checksum.properties" ).getProperty( "b-0.1-SNAPSHOT.jar" ) );
|
||||
assertNull( verifier.loadProperties( "target/checksum.properties" ).getProperty( "b-0.1-SNAPSHOT.jar" ) );
|
||||
|
||||
filterProps.setProperty( "@repo@", "repo-2" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
|
|
|
@ -68,7 +68,7 @@ public class MavenITmng4368TimestampAwareArtifactInstallerTest
|
|||
|
||||
String pom = FileUtils.fileRead( installedPom, "UTF-8" );
|
||||
assertTrue( pom.indexOf( "Branch-A" ) > 0 );
|
||||
assertTrue( !pom.contains( "Branch-B" ) );
|
||||
assertFalse( pom.contains( "Branch-B" ) );
|
||||
|
||||
assertEquals( aPom.length(), bPom.length() );
|
||||
assertTrue( aPom.lastModified() > bPom.lastModified() );
|
||||
|
@ -82,7 +82,7 @@ public class MavenITmng4368TimestampAwareArtifactInstallerTest
|
|||
verifier.resetStreams();
|
||||
|
||||
pom = FileUtils.fileRead( installedPom, "UTF-8" );
|
||||
assertTrue( !pom.contains( "Branch-A" ) );
|
||||
assertFalse( pom.contains( "Branch-A" ) );
|
||||
assertTrue( pom.indexOf( "Branch-B" ) > 0 );
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ public class MavenITmng4368TimestampAwareArtifactInstallerTest
|
|||
|
||||
String data = FileUtils.fileRead( installedArtifact, "UTF-8" );
|
||||
assertTrue( data.indexOf( "Branch-A" ) > 0 );
|
||||
assertTrue( !data.contains( "Branch-B" ) );
|
||||
assertFalse( data.contains( "Branch-B" ) );
|
||||
|
||||
assertEquals( aArtifact.length(), bArtifact.length() );
|
||||
assertTrue( aArtifact.lastModified() > bArtifact.lastModified() );
|
||||
|
@ -134,7 +134,7 @@ public class MavenITmng4368TimestampAwareArtifactInstallerTest
|
|||
verifier.resetStreams();
|
||||
|
||||
data = FileUtils.fileRead( installedArtifact, "UTF-8" );
|
||||
assertTrue( !data.contains( "Branch-A" ) );
|
||||
assertFalse( data.contains( "Branch-A" ) );
|
||||
assertTrue( data.indexOf( "Branch-B" ) > 0 );
|
||||
|
||||
long lastModified = installedArtifact.lastModified();
|
||||
|
@ -150,7 +150,7 @@ public class MavenITmng4368TimestampAwareArtifactInstallerTest
|
|||
verifier.resetStreams();
|
||||
|
||||
data = FileUtils.fileRead( installedArtifact, "UTF-8" );
|
||||
assertTrue( !data.contains( "Branch-B" ) );
|
||||
assertFalse( data.contains( "Branch-B" ) );
|
||||
assertTrue( data.indexOf( "Branch-C" ) > 0 );
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4474">MNG-4474</a>.
|
||||
*
|
||||
|
@ -59,7 +61,7 @@ public class MavenITmng4474PerLookupWagonInstantiationTest
|
|||
assertNotNull( hash1 );
|
||||
String hash2 = props.getProperty( "coreit://two.hash" );
|
||||
assertNotNull( hash2 );
|
||||
assertFalse( hash1.equals( hash2 ) );
|
||||
assertNotEquals( hash1, hash2 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4528">MNG-4528</a>.
|
||||
*
|
||||
|
@ -60,7 +62,7 @@ public class MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest
|
|||
|
||||
Properties props = verifier.loadProperties( "target/wagon.properties" );
|
||||
String version = props.getProperty( "version", "" );
|
||||
assertFalse( "Bad wagon version used: " + version, version.equals( "1.0-alpha-6" ) );
|
||||
assertNotEquals( "Bad wagon version used: " + version, "1.0-alpha-6", version );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6071">MNG-6071</a>:
|
||||
|
|
|
@ -74,7 +74,7 @@ public class MavenITmng6240PluginExtensionAetherProvider
|
|||
count++;
|
||||
}
|
||||
}
|
||||
assertTrue( count == 2 ); // 1 from download, 1 from upload
|
||||
assertEquals( 2, count ); // 1 from download, 1 from upload
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.apache.maven.it;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.junit.Test;
|
||||
|
|
Loading…
Reference in New Issue