Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions modello-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-testing</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
import org.codehaus.modello.ModelloParameterConstants;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class AbstractModelloSourceGeneratorMojoTest {

Expand Down
6 changes: 0 additions & 6 deletions modello-plugins/modello-plugin-converters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
<version>7.2.2</version>
<scope>test</scope>
</dependency>
<!-- needed for modello compiler test(inside)-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.codehaus.modello.verifier.Verifier;

import junit.framework.Assert;
import org.junit.jupiter.api.Assertions;
import java.io.*;
import org.codehaus.plexus.util.FileUtils;

Expand All @@ -42,7 +42,7 @@ public void verify()
org.codehaus.modello.test.maven.v3_0_0.io.stax.MavenStaxWriter writerV3 = new org.codehaus.modello.test.maven.v3_0_0.io.stax.MavenStaxWriter();
writerV3.write( sw, modelV3 );

Assert.assertEquals(
Assertions.assertEquals(
convertLineEndings( FileUtils.fileRead( "src/test/verifiers/converters/expected-v3.xml" ).trim() ),
convertLineEndings( scrubXmlDeclQuotes( sw.toString() ).trim() ) );

Expand All @@ -52,7 +52,7 @@ public void verify()
org.codehaus.modello.test.maven.v4_0_0.io.stax.MavenStaxWriter writerV4 = new org.codehaus.modello.test.maven.v4_0_0.io.stax.MavenStaxWriter();
writerV4.write( sw, modelV4 );

Assert.assertEquals(
Assertions.assertEquals(
convertLineEndings( FileUtils.fileRead( "src/test/verifiers/converters/expected.xml" ).trim() ),
convertLineEndings( scrubXmlDeclQuotes( sw.toString() ).trim() ) );

Expand All @@ -62,19 +62,19 @@ public void verify()
org.codehaus.modello.test.maven.io.stax.MavenStaxWriter writer = new org.codehaus.modello.test.maven.io.stax.MavenStaxWriter();
writer.write( sw, model );

Assert.assertEquals(
Assertions.assertEquals(
convertLineEndings( FileUtils.fileRead( "src/test/verifiers/converters/expected.xml" ).trim() ),
convertLineEndings( scrubXmlDeclQuotes( sw.toString() ).trim() ) );

// Test trying to convert to an old version
try
{
modelV3 = convert.convertFromFile_v3_0_0( new File( "src/test/verifiers/converters/expected.xml" ) );
Assert.fail( "Should have failed to convert" );
Assertions.fail( "Should have failed to convert" );
}
catch ( IllegalStateException e )
{
Assert.assertTrue( true );
Assertions.assertTrue( true );
}
}

Expand Down
6 changes: 0 additions & 6 deletions modello-plugins/modello-plugin-dom4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<!-- needed for modello compiler test(inside)-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import junit.framework.Assert;
import org.junit.jupiter.api.Assertions;
import org.codehaus.modello.test.model.Build;
import org.codehaus.modello.test.model.Component;
import org.codehaus.modello.test.model.MailingList;
Expand Down Expand Up @@ -85,7 +85,7 @@ public void verifyEncodedRead()

Model model = modelReader.read( reader );

Assert.assertEquals( "Maven\u00A9", model.getName() );
Assertions.assertEquals( "Maven\u00A9", model.getName() );
}

public void verifyWriter()
Expand Down Expand Up @@ -230,21 +230,21 @@ public void verifyWriter()
//
// System.err.println( actualXml );

Assert.assertEquals( expectedXml.trim(), actualXml.trim() );
Assertions.assertEquals( expectedXml.trim(), actualXml.trim() );

MavenDom4jReader reader = new MavenDom4jReader();

Model actual = reader.read( new StringReader( actualXml ) );

Assert.assertNotNull( "Actual", actual );
Assertions.assertNotNull( actual , "Actual");

assertModel( expected, actual );

buffer = new StringWriter();

writer.write( buffer, actual );

Assert.assertEquals( expectedXml.trim(), buffer.toString().trim().replaceAll( "(\r\n)|(\r)", "\n" ) );
Assertions.assertEquals( expectedXml.trim(), buffer.toString().trim().replaceAll( "(\r\n)|(\r)", "\n" ) );
}

public void verifyReader()
Expand Down Expand Up @@ -306,11 +306,11 @@ public void verifyReaderDuplicates()
try
{
reader.read( new StringReader( xml ) );
Assert.fail( "Should have obtained a parse error for duplicate sourceDirectory" );
Assertions.fail( "Should have obtained a parse error for duplicate sourceDirectory" );
}
catch ( DocumentException expected )
{
Assert.assertTrue( true );
Assertions.assertTrue( true );
}

xml = "<mavenModel>\n" + " <builder><sourceDirectory /></builder>\n" +
Expand All @@ -319,11 +319,11 @@ public void verifyReaderDuplicates()
try
{
reader.read( new StringReader( xml ) );
Assert.fail( "Should have obtained a parse error for duplicate build" );
Assertions.fail( "Should have obtained a parse error for duplicate build" );
}
catch ( DocumentException expected )
{
Assert.assertTrue( true );
Assertions.assertTrue( true );
}
*/
}
Expand All @@ -334,45 +334,45 @@ public void verifyReaderDuplicates()

public void assertModel( Model expected, Model actual )
{
Assert.assertNotNull( "Actual model", actual );
Assertions.assertNotNull( actual , "Actual model");

Assert.assertEquals( "/model/extend", expected.getExtend(), actual.getExtend() );
Assertions.assertEquals( expected.getExtend(), actual.getExtend() , "/model/extend");

// assertParent( expected.getParent(), actual.getParent() );

Assert.assertEquals( "/model/modelVersion", expected.getModelVersion(), actual.getModelVersion() );
Assertions.assertEquals( expected.getModelVersion(), actual.getModelVersion() , "/model/modelVersion");

Assert.assertEquals( "/model/groupId", expected.getGroupId(), actual.getGroupId() );
Assertions.assertEquals( expected.getGroupId(), actual.getGroupId() , "/model/groupId");

Assert.assertEquals( "/model/artifactId", expected.getArtifactId(), actual.getArtifactId() );
Assertions.assertEquals( expected.getArtifactId(), actual.getArtifactId() , "/model/artifactId");

Assert.assertEquals( "/model/type", expected.getType(), actual.getType() );
Assertions.assertEquals( expected.getType(), actual.getType() , "/model/type");

Assert.assertEquals( "/model/name", expected.getName(), actual.getName() );
Assertions.assertEquals( expected.getName(), actual.getName() , "/model/name");

Assert.assertEquals( "/model/version", expected.getVersion(), actual.getVersion() );
Assertions.assertEquals( expected.getVersion(), actual.getVersion() , "/model/version");

Assert.assertEquals( "/model/shortDescription", expected.getShortDescription(), actual.getShortDescription() );
Assertions.assertEquals( expected.getShortDescription(), actual.getShortDescription() , "/model/shortDescription");

Assert.assertEquals( "/model/description", expected.getDescription(), actual.getDescription() );
Assertions.assertEquals( expected.getDescription(), actual.getDescription() , "/model/description");

Assert.assertEquals( "/model/url", expected.getUrl(), actual.getUrl() );
Assertions.assertEquals( expected.getUrl(), actual.getUrl() , "/model/url");

Assert.assertEquals( "/model/logo", expected.getLogo(), actual.getLogo() );
Assertions.assertEquals( expected.getLogo(), actual.getLogo() , "/model/logo");

// assertIssueManagement();

// assertCiManagement();

Assert.assertEquals( "/model/inceptionYear", expected.getInceptionYear(), actual.getInceptionYear() );
Assertions.assertEquals( expected.getInceptionYear(), actual.getInceptionYear() , "/model/inceptionYear");

// assertEquals( "/model/siteAddress", expected.getSiteAddress(), actual.getSiteAddress() );
// assertEquals( expected.getSiteAddress(), actual.getSiteAddress() , "/model/siteAddress");

// assertEquals( "/model/siteDirectory", expected.getSiteDirectory(), actual.getSiteDirectory() );
// assertEquals( expected.getSiteDirectory(), actual.getSiteDirectory() , "/model/siteDirectory");

// assertEquals( "/model/distributionSite", expected.getDistributionSite(), actual.getDistributionSite() );
// assertEquals( expected.getDistributionSite(), actual.getDistributionSite() , "/model/distributionSite");

// assertEquals( "/model/distributionDirectory", expected.getDistributionDirectory(), actual.getDistributionDirectory() );
// assertEquals( expected.getDistributionDirectory(), actual.getDistributionDirectory() , "/model/distributionDirectory");

assertMailingLists( expected.getMailingLists(), actual.getMailingLists() );
/*
Expand All @@ -399,9 +399,9 @@ public void assertModel( Model expected, Model actual )

public void assertMailingLists( List expected, List actual )
{
Assert.assertNotNull( "/model/mailingLists", actual );
Assertions.assertNotNull( actual , "/model/mailingLists");

Assert.assertEquals( "/model/mailingLists.size", expected.size(), actual.size() );
Assertions.assertEquals( expected.size(), actual.size() , "/model/mailingLists.size");

for ( int i = 0; i < expected.size(); i++ )
{
Expand All @@ -411,65 +411,65 @@ public void assertMailingLists( List expected, List actual )

public void assertMailingList( int i, MailingList expected, Object actualObject )
{
Assert.assertNotNull( "/model/mailingLists[" + i + "]", actualObject );
Assertions.assertNotNull( actualObject , "/model/mailingLists[" + i + "]");

Assert.assertEquals( "/model/mailingLists", MailingList.class, actualObject.getClass() );
Assertions.assertEquals( MailingList.class, actualObject.getClass() , "/model/mailingLists");

MailingList actual = (MailingList) actualObject;

Assert.assertEquals( "/model/mailingLists[" + i + "]/name", expected.getName(), actual.getName() );
Assertions.assertEquals( expected.getName(), actual.getName() , "/model/mailingLists[" + i + "]/name");

Assert.assertEquals( "/model/mailingLists[" + i + "]/subscribe", expected.getSubscribe(),
actual.getSubscribe() );
Assertions.assertEquals( expected.getSubscribe(),
actual.getSubscribe() , "/model/mailingLists[" + i + "]/subscribe");

Assert.assertEquals( "/model/mailingLists[" + i + "]/unsubscribe", expected.getUnsubscribe(),
actual.getUnsubscribe() );
Assertions.assertEquals( expected.getUnsubscribe(),
actual.getUnsubscribe() , "/model/mailingLists[" + i + "]/unsubscribe");

Assert.assertEquals( "/model/mailingLists[" + i + "]/archive", expected.getArchive(), actual.getArchive() );
Assertions.assertEquals( expected.getArchive(), actual.getArchive() , "/model/mailingLists[" + i + "]/archive");
}

public void assertScm( Scm expected, Object actualObject )
{
if ( expected == null )
{
Assert.assertNull( "/model/scm", actualObject );
Assertions.assertNull( actualObject , "/model/scm");
}
else
{
Assert.assertNotNull( "/model/scm", actualObject );
Assertions.assertNotNull( actualObject , "/model/scm");

Assert.assertEquals( "/model/scm", Scm.class, actualObject.getClass() );
Assertions.assertEquals( Scm.class, actualObject.getClass() , "/model/scm");

Scm actual = (Scm) actualObject;

Assert.assertEquals( "/model/scm/connection", expected.getConnection(), actual.getConnection() );
Assertions.assertEquals( expected.getConnection(), actual.getConnection() , "/model/scm/connection");

Assert.assertEquals( "/model/scm/developerConnection", expected.getDeveloperConnection(),
actual.getDeveloperConnection() );
Assertions.assertEquals( expected.getDeveloperConnection(),
actual.getDeveloperConnection() , "/model/scm/developerConnection");

Assert.assertEquals( "/model/scm/url", expected.getUrl(), actual.getUrl() );
Assertions.assertEquals( expected.getUrl(), actual.getUrl() , "/model/scm/url");
}
}

public void assertBuild( Build expected, Object actualObject )
{
if ( expected == null )
{
Assert.assertNull( "/model/builder", actualObject );
Assertions.assertNull( actualObject , "/model/builder");
}
else
{
Assert.assertNotNull( "/model/builder", actualObject );
Assertions.assertNotNull( actualObject , "/model/builder");

Assert.assertEquals( "/model/builder", Build.class, actualObject.getClass() );
Assertions.assertEquals( Build.class, actualObject.getClass() , "/model/builder");

Build actual = (Build) actualObject;

Assert.assertEquals( "/model/builder/sourceDirectory", expected.getSourceDirectory(),
actual.getSourceDirectory() );
Assertions.assertEquals( expected.getSourceDirectory(),
actual.getSourceDirectory() , "/model/builder/sourceDirectory");

Assert.assertEquals( "/model/builder/unitTestSourceDirectory", expected.getUnitTestSourceDirectory(),
actual.getUnitTestSourceDirectory() );
Assertions.assertEquals( expected.getUnitTestSourceDirectory(),
actual.getUnitTestSourceDirectory() , "/model/builder/unitTestSourceDirectory");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* SOFTWARE.
*/

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import org.codehaus.modello.test.features.Features;
import org.codehaus.modello.test.features.io.dom4j.ModelloFeaturesTestDom4jReader;
Expand Down Expand Up @@ -109,7 +109,7 @@ public void verifyWriter( Features features )
// writer doesn't handle namespace
actualXml = actualXml.replaceFirst( "<preserve space=\"preserve\">", "<preserve xml:space=\"preserve\">" );

//assertTrue( actualXml.substring( 0, 38 ), actualXml.startsWith( "<?xml version=\"1.0\"?>" ) );
//assertTrue( actualXml.startsWith( "<?xml version=\"1.0\"?>" ) , actualXml.substring( 0, 38 ));

Diff diff = DiffBuilder.compare( initialXml ).withTest( actualXml ).ignoreWhitespace().ignoreComments().build();

Expand Down Expand Up @@ -223,14 +223,14 @@ public void verifyEncoding()
ModelloFeaturesTestDom4jReader reader = new ModelloFeaturesTestDom4jReader();

Features features = reader.read( getClass().getResource( "/features.xml" ) );
//assertEquals( "modelEncoding", null, features.getModelEncoding() );
//assertEquals( null, features.getModelEncoding() , "modelEncoding");

features = reader.read( getClass().getResource( "/features-UTF-8.xml" ) );
//assertEquals( "modelEncoding", "UTF-8", features.getModelEncoding() );
//assertEquals( "UTF-8", features.getModelEncoding() , "modelEncoding");

features = reader.read( getClass().getResource( "/features-Latin-15.xml" ) );
// Dom4J's Document.getXMLEncoding() does not work: encoding used by the document is not stored...
//assertEquals( "modelEncoding", "ISO-8859-15", features.getModelEncoding() );
//assertEquals( "ISO-8859-15", features.getModelEncoding() , "modelEncoding");

// encoding is not set when reading file, not useful to check whether it is written back...
}
Expand Down
6 changes: 0 additions & 6 deletions modello-plugins/modello-plugin-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<!-- needed for modello compiler test(inside)-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading
Loading