Skip to content
Closed
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
17 changes: 3 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,10 @@
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.6</version>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-legacy</artifactId>
<version>2.11.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -316,11 +310,6 @@
</signature>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>2.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
Expand Down
11 changes: 3 additions & 8 deletions webstart-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,11 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-legacy</artifactId>
<scope>test</scope>
<version>2.11.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
*/

import org.apache.maven.artifact.repository.ArtifactRepository;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;

import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
Expand All @@ -36,6 +42,7 @@
import org.apache.maven.project.DefaultProjectBuildingRequest;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.junit.jupiter.api.Test;

/**
* @author <a href="jerome@coffeebreaks.org">Jerome Lacoste</a>
Expand All @@ -45,7 +52,8 @@ public abstract class AbstractJnlpMojoTest
extends AbstractMojoTestCase
{

public void testFailWhenSomeDependenciesDoNotExist()
@Test
public void failWhenSomeDependenciesDoNotExist()
throws Exception
{
JnlpInlineMojo mojo = new JnlpInlineMojo();
Expand All @@ -67,9 +75,9 @@ public void testFailWhenSomeDependenciesDoNotExist()
setVariableValueToObject( mojo, "dependencies", deps );
// --

assertTrue( "dependencies not null", mojo.getDependencies() != null );
assertEquals( "2 includes", 2, mojo.getDependencies().getIncludes().size() );
assertEquals( "2 excludes", 2, mojo.getDependencies().getExcludes().size() );
assertNotSame(mojo.getDependencies(), null, "dependencies not null" );
assertEquals( 2, mojo.getDependencies().getIncludes().size(), "2 includes" );
assertEquals( 2, mojo.getDependencies().getExcludes().size(), "2 excludes" );

try
{
Expand All @@ -81,7 +89,8 @@ public void testFailWhenSomeDependenciesDoNotExist()
}
}

public void testAllDependenciesExist()
@Test
public void allDependenciesExist()
throws Exception
{
JnlpInlineMojo mojo = new JnlpInlineMojo();
Expand All @@ -98,9 +107,9 @@ public void testAllDependenciesExist()
setVariableValueToObject( mojo, "dependencies", deps );
// --

assertTrue( "dependencies not null", mojo.getDependencies() != null );
assertNull( "no include", mojo.getDependencies().getIncludes() );
assertEquals( "1 exclude", 1, mojo.getDependencies().getExcludes().size() );
assertNotSame(mojo.getDependencies(), null, "dependencies not null" );
assertNull( mojo.getDependencies().getIncludes(), "no include" );
assertEquals( 1, mojo.getDependencies().getExcludes().size(), "1 exclude" );

mojo.checkDependencies();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@
import java.util.Collections;
import java.util.List;

import junit.framework.TestCase;

import org.apache.maven.artifact.Artifact;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.artifact.versioning.VersionRange;
import org.codehaus.mojo.webstart.JnlpConfig;
import org.codehaus.mojo.webstart.dependency.filenaming.DependencyFilenameStrategy;
import org.codehaus.mojo.webstart.dependency.filenaming.FullDependencyFilenameStrategy;
import org.codehaus.mojo.webstart.dependency.filenaming.SimpleDependencyFilenameStrategy;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
* @author <a href="jerome@coffeebreaks.org">Jerome Lacoste</a>
* @version $Id$
*/
public class GeneratorTest
extends TestCase
{
protected Artifact artifact1;

Expand All @@ -53,12 +54,11 @@ public class GeneratorTest
private List<Artifact> artifacts;

public static final String EOL = System.getProperty( "line.separator" );
@Override
public void setUp()

@BeforeEach
void setUp()
throws Exception
{
super.setUp();
DefaultArtifactHandler artifactHandler = new DefaultArtifactHandler( "jar" );
artifact1 =
new DefaultArtifact( "groupId", "artifact1", VersionRange.createFromVersion( "1.0" ), "scope", "jar",
Expand Down Expand Up @@ -90,7 +90,8 @@ public void setUp()
artifacts.add( artifact4 );
}

public void testGetDependenciesText()
@Test
void getDependenciesText()
throws Exception
{

Expand Down Expand Up @@ -127,7 +128,8 @@ public void testGetDependenciesText()
Generator.getDependenciesText( generatorConfig2 ) );
}

public void testGetDependenciesTextWithFullNaming()
@Test
void getDependenciesTextWithFullNaming()
throws Exception
{

Expand Down Expand Up @@ -164,7 +166,8 @@ public void testGetDependenciesTextWithFullNaming()
Generator.getDependenciesText( generatorConfig2 ) );
}

public void testGetDependenciesTextWithPack200()
@Test
void getDependenciesTextWithPack200()
throws Exception
{

Expand Down Expand Up @@ -202,7 +205,8 @@ public void testGetDependenciesTextWithPack200()
Generator.getDependenciesText( generatorConfig2 ) );
}

public void testGetDependenciesTextWithLibPath()
@Test
void getDependenciesTextWithLibPath()
throws Exception
{

Expand Down Expand Up @@ -239,9 +243,10 @@ public void testGetDependenciesTextWithLibPath()
EOL +"<jar href=\"lib/artifact4.jar\" version=\"1.5-SNAPSHOT\"/>" + EOL,
Generator.getDependenciesText( generatorConfig2 ) );
}

public void testGetDependenciesTextWithUniqueVersions()
throws Exception

@Test
void getDependenciesTextWithUniqueVersions()
throws Exception
{

DependencyFilenameStrategy dependencyFilenameStrategy = new SimpleDependencyFilenameStrategy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,48 +1,30 @@
package org.codehaus.mojo.webstart.generator;

/*
* 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 junit.framework.Assert;
import junit.framework.TestCase;

import org.apache.maven.plugin.logging.SystemStreamLog;
import org.apache.maven.plugin.testing.stubs.ArtifactStub;
import org.apache.maven.project.MavenProject;
import org.codehaus.mojo.webstart.ResolvedJarResource;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

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

/**
* Tests the {@link JarResourcesGenerator} class.
*
* @author Kevin Stembridge
* @version $Revision$
*/
public class JarResourcesGeneratorTest
extends TestCase
{
public static final String EOL = System.getProperty( "line.separator" );

public void testGetDependenciesText()
@Test
void getDependenciesText()
throws Exception
{

Expand Down Expand Up @@ -90,7 +72,7 @@ public void testGetDependenciesText()

String actualText = generator.getDependenciesText();

Assert.assertEquals( expectedText, actualText );
Assertions.assertEquals( expectedText, actualText );

JarResourceGeneratorConfig jarResourceGeneratorConfig2 = new JarResourceGeneratorConfig( jarResources, "myLib", null, null, null );
JarResourcesGenerator generator2 =
Expand All @@ -107,7 +89,7 @@ public void testGetDependenciesText()

String actualText2 = generator2.getDependenciesText();

Assert.assertEquals( expectedText2, actualText2 );
Assertions.assertEquals( expectedText2, actualText2 );

}

Expand Down
Loading
Loading