efegokdemir commented on code in PR #306:
URL: 
https://github.com/apache/maven-remote-resources-plugin/pull/306#discussion_r4234759379


##########
src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java:
##########
@@ -254,6 +254,38 @@ public void testFilteredBundles() throws Exception {
         assertTrue(data.contains("projectsSortedByOrganization: {"));
     }
 
+    public void testFilteredAppendedResource() throws Exception {
+        final MavenProjectResourcesStub project = 
createTestProject("default-appended-filtered-resource");
+        final ProcessRemoteResourcesMojo mojo = 
lookupProcessMojoWithSettings(project, new String[] {"test:test:1.4"});
+
+        setupDefaultProject(project);
+
+        String path = pathOf(new DefaultArtifact(
+                "test", "test", VersionRange.createFromVersion("1.4"), null, 
"jar", "", new DefaultArtifactHandler()));
+        File bundleJar = new File(path);
+        bundleJar.getParentFile().mkdirs();
+        buildResourceBundle(
+                "default-appended-filtered-resource-create",
+                null,
+                new String[] {"BUNDLE_FILTER.txt.vm", "APPENDED_FILTER.txt"},
+                bundleJar);
+
+        File appendedResourcesDirectory = new File(project.getBasedir(), 
"src/main/appended-resources");
+        appendedResourcesDirectory.mkdirs();
+        FileUtils.fileWrite(
+                new File(appendedResourcesDirectory, 
"APPENDED_FILTER.txt.vm").getAbsolutePath(),
+                "appended: $project.name");
+        setVariableValueToObject(mojo, "appendedResourcesDirectory", 
appendedResourcesDirectory);
+
+        mojo.execute();
+
+        File outputDirectory = (File) getVariableValueFromObject(mojo, 
"outputDirectory");
+        String appendedData = FileUtils.fileRead(new File(outputDirectory, 
"APPENDED_FILTER.txt"));
+        assertTrue(appendedData.contains("appended: Test Project 
default-appended-filtered-resource"));

Review Comment:
   Fixed in `e03c17921699096ac6bc2d126ee8a5b51420831b`: the appended template 
now parses the bundled classpath template, and the test checks that its content 
appears in the appended output. This exercises the configured engine resource 
loader. `git diff --check` passed; I could not run Maven locally because Java 
is unavailable here. CI for this commit has not reported yet.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to