You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2022/01/23 18:04:55 UTC
[sling-whiteboard] branch master updated: Cleaning up scopes to reduce visibility
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 68fbbda Cleaning up scopes to reduce visibility
68fbbda is described below
commit 68fbbdab7db16b379eec6cbde9d762ed8c98cf4f
Author: Dan Klco <kl...@adobe.com>
AuthorDate: Sun Jan 23 13:04:18 2022 -0500
Cleaning up scopes to reduce visibility
---
.../java/org/apache/sling/maven/repoinit/BaseMojo.java | 6 +++---
.../java/org/apache/sling/maven/repoinit/ParseMojo.java | 8 ++++----
.../apache/sling/maven/repoinit/ToOsgiConfigMojo.java | 4 ++--
.../org/apache/sling/maven/repoinit/ParseMojoTest.java | 14 +++++++-------
.../sling/maven/repoinit/ToOsgiConfigMojoTest.java | 17 +++++++++--------
5 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/BaseMojo.java b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/BaseMojo.java
index f36439a..1277a78 100644
--- a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/BaseMojo.java
+++ b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/BaseMojo.java
@@ -36,7 +36,7 @@ public abstract class BaseMojo extends AbstractMojo {
* The base directory under which to search for repoinit files.
*/
@Parameter(property = "repoinit.scriptBaseDir", defaultValue = "${project.basedir}/src/main/repoinit", required = false)
- protected File scriptBaseDir;
+ File scriptBaseDir;
/**
* The files included when processing the plugin. Supports glob style patterns.
@@ -46,9 +46,9 @@ public abstract class BaseMojo extends AbstractMojo {
* on Globs in Java</a>
*/
@Parameter(property = "repoinit.includedFiles", required = false, defaultValue = "*.txt")
- protected List<String> includedFiles;
+ List<String> includedFiles;
- protected List<File> findScripts() throws MojoExecutionException {
+ List<File> findScripts() throws MojoExecutionException {
List<PathMatcher> matchers = includedFiles.stream()
.map(pattern -> FileSystems.getDefault().getPathMatcher("glob:" + pattern))
diff --git a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ParseMojo.java b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ParseMojo.java
index ed2abc3..850afd9 100644
--- a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ParseMojo.java
+++ b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ParseMojo.java
@@ -55,19 +55,19 @@ public class ParseMojo extends BaseMojo {
* work.
*/
@Component
- protected RepositorySystem repoSystem;
+ RepositorySystem repoSystem;
/**
* The current repository/network configuration of Maven.
*/
@Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
- protected RepositorySystemSession repoSession;
+ RepositorySystemSession repoSession;
/**
* The project's remote repositories to use for the resolution.
*/
@Parameter(defaultValue = "${project.remoteProjectRepositories}", readonly = true)
- protected List<RemoteRepository> remoteRepos;
+ List<RemoteRepository> remoteRepos;
/**
* The version of Sling RepoInit parser to use to parse the repoinit files.
@@ -77,7 +77,7 @@ public class ParseMojo extends BaseMojo {
* Sling RepoInit Parser versions</a>
*/
@Parameter(property = "repoinit.parserVersion", required = true)
- protected String parserVersion;
+ String parserVersion;
public void execute()
throws MojoExecutionException {
diff --git a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojo.java b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojo.java
index be36d96..a653e2f 100644
--- a/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojo.java
+++ b/sling-repoinit-maven-plugin/src/main/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojo.java
@@ -46,13 +46,13 @@ public class ToOsgiConfigMojo extends BaseMojo {
* The directory to which to output the OSGi configuration files
*/
@Parameter(property = "repoinit.outputDir", required = true)
- protected File outputDir;
+ File outputDir;
/**
* The format to output the OSGi configuration. Must be one of JSON or CONFIG.
*/
@Parameter(property = "repoinit.outputFormat", defaultValue = "JSON")
- protected String outputFormat;
+ String outputFormat;
public void execute()
throws MojoExecutionException {
diff --git a/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ParseMojoTest.java b/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ParseMojoTest.java
index ae2d6db..4b229d9 100644
--- a/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ParseMojoTest.java
+++ b/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ParseMojoTest.java
@@ -48,7 +48,7 @@ import org.mockito.quality.Strictness;
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
-public class ParseMojoTest {
+class ParseMojoTest {
@Mock
RepositorySystem repoSystem;
@@ -61,7 +61,7 @@ public class ParseMojoTest {
CapturingLogger log = new CapturingLogger();
@BeforeEach
- public void beforeEach() throws IllegalArgumentException, ArtifactResolutionException {
+ void beforeEach() throws IllegalArgumentException, ArtifactResolutionException {
parseMojo = new ParseMojo();
parseMojo.repoSystem = repoSystem;
parseMojo.repoSession = repoSession;
@@ -72,7 +72,7 @@ public class ParseMojoTest {
.thenAnswer(this::mockResponse);
}
- private ArtifactResult mockResponse(InvocationOnMock invocation) throws ArtifactResolutionException {
+ ArtifactResult mockResponse(InvocationOnMock invocation) throws ArtifactResolutionException {
ArtifactRequest request = (ArtifactRequest) invocation.getArguments()[1];
File artifactFile = new File(
@@ -90,7 +90,7 @@ public class ParseMojoTest {
}
@Test
- public void testParser() throws MojoExecutionException {
+ void testParser() throws MojoExecutionException {
parseMojo.includedFiles = Collections.singletonList("*.txt");
parseMojo.parserVersion = "1.2.0";
parseMojo.scriptBaseDir = new File("src/test/repoinit");
@@ -105,7 +105,7 @@ public class ParseMojoTest {
}
@Test
- public void testLargeFile() throws MojoExecutionException {
+ void testLargeFile() throws MojoExecutionException {
parseMojo.includedFiles = Collections.singletonList("large/combined.txt");
parseMojo.parserVersion = "1.6.10";
parseMojo.scriptBaseDir = new File("src/test/repoinit");
@@ -117,7 +117,7 @@ public class ParseMojoTest {
}
@Test
- public void testNoFiles() throws MojoExecutionException {
+ void testNoFiles() throws MojoExecutionException {
parseMojo.includedFiles = Collections.singletonList("*.tx");
parseMojo.parserVersion = "1.2.0";
parseMojo.scriptBaseDir = new File("src/test/repoinit");
@@ -137,7 +137,7 @@ public class ParseMojoTest {
"invalid/invalid.txt,1.6.10,Failed to parse script",
"invalid/apache.png,1.6.10,Failed to parse script",
"*.txt,0.2.0,Couldn't download artifact: The following artifacts could not be resolved: org.apache.sling:org.apache.sling.repoinit.parser:jar:0.2.0" })
- public void testFailures(String filePattern, String parserVersion, String messageSubStr)
+ void testFailures(String filePattern, String parserVersion, String messageSubStr)
throws MojoExecutionException {
parseMojo.includedFiles = Collections.singletonList(filePattern);
parseMojo.parserVersion = parserVersion;
diff --git a/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojoTest.java b/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojoTest.java
index e18f698..ad09f6a 100644
--- a/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojoTest.java
+++ b/sling-repoinit-maven-plugin/src/test/java/org/apache/sling/maven/repoinit/ToOsgiConfigMojoTest.java
@@ -34,14 +34,14 @@ import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
-public class ToOsgiConfigMojoTest {
+class ToOsgiConfigMojoTest {
ToOsgiConfigMojo toOsgiConfigMojo;
CapturingLogger log = new CapturingLogger();
@BeforeEach
- public void beforeEach() {
+ void beforeEach() {
toOsgiConfigMojo = new ToOsgiConfigMojo();
log.reset();
toOsgiConfigMojo.setLog(new DefaultLog(log));
@@ -49,7 +49,7 @@ public class ToOsgiConfigMojoTest {
@ParameterizedTest
@ValueSource(strings = { "JSON", "CONFIG" })
- public void testConverter(String outputFormat) throws MojoExecutionException {
+ void testConverter(String outputFormat) throws MojoExecutionException {
toOsgiConfigMojo.includedFiles = Collections.singletonList("*.txt");
toOsgiConfigMojo.scriptBaseDir = new File("src/test/repoinit");
@@ -66,7 +66,7 @@ public class ToOsgiConfigMojoTest {
}
@Test
- public void testLargeFile() throws MojoExecutionException {
+ void testLargeFile() throws MojoExecutionException {
toOsgiConfigMojo.includedFiles = Collections.singletonList("large/combined.txt");
toOsgiConfigMojo.scriptBaseDir = new File("src/test/repoinit");
toOsgiConfigMojo.outputFormat = "JSON";
@@ -79,7 +79,7 @@ public class ToOsgiConfigMojoTest {
}
@Test
- public void testNoFiles() throws MojoExecutionException {
+ void testNoFiles() throws MojoExecutionException {
toOsgiConfigMojo.includedFiles = Collections.singletonList("*.tx");
toOsgiConfigMojo.scriptBaseDir = new File("src/test/repoinit");
toOsgiConfigMojo.outputFormat = "JSON";
@@ -92,7 +92,7 @@ public class ToOsgiConfigMojoTest {
}
@Test
- public void testInvalidBase()
+ void testInvalidBase()
throws MojoExecutionException {
toOsgiConfigMojo.includedFiles = Collections.singletonList("*.txt");
toOsgiConfigMojo.outputFormat = "JSON";
@@ -101,13 +101,14 @@ public class ToOsgiConfigMojoTest {
toOsgiConfigMojo.scriptBaseDir = new File("src/test/repoinit/somethingelse");
String message = assertThrows(MojoExecutionException.class, () -> toOsgiConfigMojo.execute()).getMessage();
- assertTrue(message.contains("Could not find scripts in directory:"), "Did not recieve expected message in: " + message);
+ assertTrue(message.contains("Could not find scripts in directory:"),
+ "Did not recieve expected message in: " + message);
}
@ParameterizedTest
@CsvSource({ "invalid/apache.png,JSON,Failed to convert script",
"*.txt,XML,Unsupported output format: XML" })
- public void testFailures(String filePattern, String format, String messageSubStr)
+ void testFailures(String filePattern, String format, String messageSubStr)
throws MojoExecutionException {
toOsgiConfigMojo.includedFiles = Collections.singletonList(filePattern);
toOsgiConfigMojo.outputFormat = format;