Skip to content
Draft
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
11 changes: 2 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,8 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-verifier</artifactId>
<version>1.8.0</version>
<version>2.0.0-M1</version>
<scope>test</scope>
<exclusions>
<!-- exclude JUnit4, not actively used in this context, compare with https://issues.apache.org/jira/browse/MSHARED-1043 -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- embedder for testing Embedded3xLauncher with classpath
must test with the minimum supported Maven version, as otherwise the Maven Resolver/Aether API
Expand Down Expand Up @@ -625,7 +618,7 @@
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-wagon</artifactId>
<artifactId>aether-transport-http</artifactId>
<version>${aether.version}</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
import org.apache.jackrabbit.vault.validation.context.AbstractDependencyResolver.MavenCoordinates;
import org.junit.jupiter.api.Test;

public class MavenBasedPackageDependencyTest {
class MavenBasedPackageDependencyTest {

@Test
public void testMavenCoordinatesToUri() throws URISyntaxException {
void testMavenCoordinatesToUri() throws URISyntaxException {
assertEquals(new URI("maven", "group1:name1:1.0:zip:classifier1", null), MavenBasedPackageDependency.mavenCoordinatesToUri("group1", "name1", "1.0", "classifier1"));
assertEquals(new URI("maven", "group1:name1:1.0:zip", null), MavenBasedPackageDependency.mavenCoordinatesToUri("group1", "name1", "1.0", null));
}

@Test
public void testMavenCoordinatesToUriRoundtrip() throws URISyntaxException {
void testMavenCoordinatesToUriRoundtrip() throws URISyntaxException {
MavenCoordinates coordinates = new MavenCoordinates("groupname", "artifactName", "1.0");
assertEquals(coordinates, MavenCoordinates.parse(MavenBasedPackageDependency.mavenCoordinatesToUri(coordinates.getGroupId(), coordinates.getArtifactId(), coordinates.getVersion(), coordinates.getClassifier())));
}

@Test
public void testUriToMavenCoordinatesRoundtrip() throws URISyntaxException {
void testUriToMavenCoordinatesRoundtrip() throws URISyntaxException {
URI uri = new URI("maven", "test-group:some name:1.0:zip", null);
MavenCoordinates coordinates = MavenCoordinates.parse(uri);
assertEquals(uri, MavenBasedPackageDependency.mavenCoordinatesToUri(coordinates.getGroupId(), coordinates.getArtifactId(), coordinates.getVersion(), coordinates.getClassifier()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.it.VerificationException;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@

import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.util.ISO8601;
import org.apache.jackrabbit.vault.packaging.PackageProperties;
import org.apache.maven.it.VerificationException;
import org.apache.maven.shared.verifier.VerificationException;
import org.hamcrest.MatcherAssert;
import org.hamcrest.number.OrderingComparison;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(ProjectBuilderExtension.class)
public class DefaultProjectIT {
class DefaultProjectIT {

private static final String TEST_PROJECT_NAME = "/default-test-projects/";

@Test
public void generic_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
void generic_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
// the created date is fixed in the pom, as this is a reproducible build
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic")
Expand All @@ -68,7 +68,7 @@ public void generic_project_package_contains_correct_files(ProjectBuilder projec
}

@Test
public void generic_project_is_reproducible(ProjectBuilder projectBuilder) throws Exception {
void generic_project_is_reproducible(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic")
.build();
Expand All @@ -93,7 +93,7 @@ public void generic_project_is_reproducible(ProjectBuilder projectBuilder) throw
}

@Test
public void generic_project_package_with_metainf_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
void generic_project_package_with_metainf_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic-with-metainf")
.build()
Expand All @@ -103,7 +103,7 @@ public void generic_project_package_with_metainf_contains_correct_files(ProjectB
}

@Test
public void generic_with_builtcd_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
void generic_with_builtcd_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic-with-builtcd")
.build()
Expand All @@ -113,7 +113,7 @@ public void generic_with_builtcd_project_package_contains_correct_files(ProjectB
}

@Test
public void resource_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
void resource_project_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "resource")
.build()
Expand All @@ -123,7 +123,7 @@ public void resource_project_package_contains_correct_files(ProjectBuilder proje
}

@Test
public void unusual_jcr_root_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
void unusual_jcr_root_package_contains_correct_files(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic-unusal-jcrroot")
.build()
Expand All @@ -133,7 +133,7 @@ public void unusual_jcr_root_package_contains_correct_files(ProjectBuilder proje
}

@Test
public void generic_empty_directories(ProjectBuilder projectBuilder) throws Exception {
void generic_empty_directories(ProjectBuilder projectBuilder) throws Exception {
Calendar dateBeforeRun = Calendar.getInstance();
String createdDate = projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "generic-empty-directories")
Expand All @@ -149,15 +149,15 @@ public void generic_empty_directories(ProjectBuilder projectBuilder) throws Exce
}

@Test
public void resource_empty_directories(ProjectBuilder projectBuilder) throws Exception {
void resource_empty_directories(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "resource-empty-directories")
.build()
.verifyExpectedFiles();
}

@Test
public void htl_validation(ProjectBuilder projectBuilder) throws Exception {
void htl_validation(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "htl-validation")
.build()
Expand All @@ -166,30 +166,30 @@ public void htl_validation(ProjectBuilder projectBuilder) throws Exception {
}

@Test
public void overwritten_embed(ProjectBuilder projectBuilder) throws Exception {
void overwritten_embed(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "overwritten-embed")
.setBuildExpectedToFail(true)
.build();
}

@Test
public void overwritten_embed_not_failing(ProjectBuilder projectBuilder) throws Exception {
void overwritten_embed_not_failing(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "overwritten-embed-not-failing")
.build()
.verifyExpectedFilesChecksum();
}

@Test
public void empty_package(ProjectBuilder projectBuilder) throws VerificationException, IOException {
void empty_package(ProjectBuilder projectBuilder) throws VerificationException, IOException {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "empty")
.build();
}

@Test
public void additional_metainf_files(ProjectBuilder projectBuilder) throws Exception {
void additional_metainf_files(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "additional-metainf-files")
.build()
Expand All @@ -198,7 +198,7 @@ public void additional_metainf_files(ProjectBuilder projectBuilder) throws Excep
}

@Test
public void complex_package_properties(ProjectBuilder projectBuilder) throws Exception {
void complex_package_properties(ProjectBuilder projectBuilder) throws Exception {
projectBuilder
.setTestProjectDir(TEST_PROJECT_NAME + "complex-properties")
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;

import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.io.IOException;

import org.apache.commons.lang3.StringUtils;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import java.util.LinkedList;
import java.util.List;

import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.io.IOException;
import java.util.stream.Stream;

import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.io.File;
import java.io.IOException;

import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.it.VerificationException;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilder;
import org.apache.jackrabbit.filevault.maven.packaging.it.util.ProjectBuilderExtension;
import org.apache.maven.shared.verifier.VerificationException;
import org.hamcrest.Description;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.BoundedReader;
import org.apache.jackrabbit.filevault.maven.packaging.mojo.VaultMojo;
import org.apache.maven.it.VerificationException;
import org.apache.maven.it.Verifier;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.hamcrest.Description;
import org.hamcrest.MatcherAssert;
Expand Down