summaryrefslogtreecommitdiffstats
path: root/bundle-plugin-test
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2021-07-14 13:52:18 +0200
committergjoranv <gv@verizonmedia.com>2021-07-14 13:52:18 +0200
commit934119027d314fc403858e475fca1a33047af206 (patch)
tree9d1f987d21aa64cebab6cb78f2a6012c5852dc92 /bundle-plugin-test
parent3534840687517be5d8f90af0a7bde4ebb43bc06a (diff)
Remove the GenerateBundleClassPathMappingsMojo and tests.
Diffstat (limited to 'bundle-plugin-test')
-rw-r--r--bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/BundleTest.java39
-rw-r--r--bundle-plugin-test/test-bundles/main/pom.xml26
-rw-r--r--bundle-plugin-test/test-bundles/pom.xml7
3 files changed, 0 insertions, 72 deletions
diff --git a/bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/BundleTest.java b/bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/BundleTest.java
index 35a95ed3d89..a39896928c8 100644
--- a/bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/BundleTest.java
+++ b/bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/BundleTest.java
@@ -1,19 +1,15 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.plugin;
-import com.yahoo.osgi.maven.ProjectBundleClassPaths;
import com.yahoo.vespa.config.VespaVersion;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.Collection;
import java.util.Enumeration;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
@@ -22,13 +18,7 @@ import java.util.jar.Manifest;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
-import static com.yahoo.osgi.maven.ProjectBundleClassPaths.CLASSPATH_MAPPINGS_FILENAME;
-import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.endsWith;
-import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
@@ -152,33 +142,4 @@ public class BundleTest {
assertThat(webInfUrl, containsString("/WEB-INF/web.xml"));
}
- // TODO Vespa 8: Remove, the classpath mappings file is only needed for jersey resources to work in the application test framework.
- // When this test is removed, also remove the maven-resources-plugin from the 'main' test bundle's pom.
- @Rule
- public TemporaryFolder tempFolder = new TemporaryFolder();
- @SuppressWarnings("unchecked")
- @Test
- public void bundle_class_path_mappings_are_generated() throws Exception {
- ZipEntry classpathMappingsEntry = jarFile.getEntry(CLASSPATH_MAPPINGS_FILENAME);
-
- assertNotNull(
- "Could not find " + CLASSPATH_MAPPINGS_FILENAME + " in the test bundle",
- classpathMappingsEntry);
-
- Path mappingsFile = tempFolder.newFile(CLASSPATH_MAPPINGS_FILENAME).toPath();
- Files.copy(jarFile.getInputStream(classpathMappingsEntry), mappingsFile, REPLACE_EXISTING);
-
- ProjectBundleClassPaths bundleClassPaths = ProjectBundleClassPaths.load(mappingsFile);
-
- assertThat(bundleClassPaths.mainBundle.bundleSymbolicName, is("main"));
-
- Collection<String> mainBundleClassPaths = bundleClassPaths.mainBundle.classPathElements;
-
- assertThat(mainBundleClassPaths,
- hasItems(
- endsWith("target/classes"),
- anyOf(
- allOf(containsString("/jrt-"), containsString(".jar")),
- containsString("/jrt.jar"))));
- }
}
diff --git a/bundle-plugin-test/test-bundles/main/pom.xml b/bundle-plugin-test/test-bundles/main/pom.xml
index 190e1c9d90f..c315318453e 100644
--- a/bundle-plugin-test/test-bundles/main/pom.xml
+++ b/bundle-plugin-test/test-bundles/main/pom.xml
@@ -42,32 +42,6 @@
<WebInfUrl>/WEB-INF/web.xml</WebInfUrl>
</configuration>
</plugin>
- <plugin>
- <!-- Trick to copy bundle-plugin.bundle-classpath-mappings.json from target/test-classes to target/classes -->
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-bundle-classpath-mappings-from-test-to-main</id>
- <!-- NOTE: Must be done after generating classpath-mappings and before assembling the bundle (see the test-bundles pom) -->
- <phase>process-test-sources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.outputDirectory}</outputDirectory>
- <overwrite>true</overwrite>
- <resources>
- <resource>
- <directory>${project.build.testOutputDirectory}</directory>
- <includes>
- <include>bundle-plugin.bundle-classpath-mappings.json</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/bundle-plugin-test/test-bundles/pom.xml b/bundle-plugin-test/test-bundles/pom.xml
index 712ccb5542e..ab19b3578c5 100644
--- a/bundle-plugin-test/test-bundles/pom.xml
+++ b/bundle-plugin-test/test-bundles/pom.xml
@@ -30,13 +30,6 @@
<version>${project.version}</version>
<executions>
<execution>
- <id>generate-classpath-mappings</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>generate-bundle-classpath-mappings</goal>
- </goals>
- </execution>
- <execution>
<id>package-test-bundles</id>
<!-- Must be done after generating classpath-mappings and copying it in the 'main' bundle. -->
<phase>test-compile</phase>