Skip to content
Permalink
Browse files
Typographical cleanup
  • Loading branch information
chtompki committed Feb 16, 2018
1 parent 85a4c1e commit d2c28a5053be5c1f214c4ae44c2134a72af1b019
Showing 5 changed files with 15 additions and 15 deletions.
@@ -54,14 +54,14 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {
* from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,
* *-bin.tar.gz, and the corresponding .asc pgp signatures.
*/
private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
private static final Set<String> ARTIFACT_TYPES_TO_DETACH;
static {
Set<String> hashSet = new HashSet<>();
hashSet.add("zip");
hashSet.add("tar.gz");
hashSet.add("zip.asc");
hashSet.add("tar.gz.asc");
ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
ARTIFACT_TYPES_TO_DETACH = Collections.unmodifiableSet(hashSet);
}

/**
@@ -90,9 +90,9 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {

@Override
public void execute() throws MojoExecutionException {
getLog().info("Detatching Assemblies");
getLog().info("Detaching Assemblies");
for (Object attachedArtifact : project.getAttachedArtifacts()) {
if (ARTIFACT_TYPES_TO_DETATCH.contains(((Artifact) attachedArtifact).getType())) {
if (ARTIFACT_TYPES_TO_DETACH.contains(((Artifact) attachedArtifact).getType())) {
detachedArtifacts.add((Artifact) attachedArtifact);
}
}
@@ -61,7 +61,7 @@ public void testSuccess() throws Exception {
File detachedZipAsc = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.asc");
File detachedZipMd5 = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.md5");
File detachedZipSha1 = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.sha1");
File notDetatchedMockAttachedFile = new File("target/testing-commons-release-plugin/mockAttachedFile.html");
File notDetachedMockAttachedFile = new File("target/testing-commons-release-plugin/mockAttachedFile.html");
assertTrue(detachedTarGz.exists());
assertTrue(detachedTarGzAsc.exists());
assertTrue(detachedTarMd5.exists());
@@ -70,6 +70,6 @@ public void testSuccess() throws Exception {
assertTrue(detachedZipAsc.exists());
assertTrue(detachedZipMd5.exists());
assertTrue(detachedZipSha1.exists());
assertFalse(notDetatchedMockAttachedFile.exists());
assertFalse(notDetachedMockAttachedFile.exists());
}
}
@@ -42,45 +42,45 @@ public class DistributionDetachmentProjectStub extends MavenProjectStub {
public List<Artifact> getAttachedArtifacts() {
attachedArtifacts = new ArrayList<>();
attachedArtifacts.add(
new DistributionDetatchmentArtifactStub(
new DistributionDetachmentArtifactStub(
new File("src/test/resources/mojos/detach-distributions/target/mockAttachedFile.html"),
"html"
)
);
attachedArtifacts.add(
new DistributionDetatchmentArtifactStub(
new DistributionDetachmentArtifactStub(
new File("src/test/resources/mojos/detach-distributions/target/mockAttachedTar.tar.gz"),
"tar.gz"
)
);
attachedArtifacts.add(
new DistributionDetatchmentArtifactStub(
new DistributionDetachmentArtifactStub(
new File("src/test/resources/mojos/detach-distributions/target/mockAttachedTar.tar.gz.asc"),
"tar.gz.asc"
)
);
attachedArtifacts.add(
new DistributionDetatchmentArtifactStub(
new DistributionDetachmentArtifactStub(
new File("src/test/resources/mojos/detach-distributions/target/mockAttachedZip.zip"),
"zip"
)
);
attachedArtifacts.add(
new DistributionDetatchmentArtifactStub(
new DistributionDetachmentArtifactStub(
new File("src/test/resources/mojos/detach-distributions/target/mockAttachedZip.zip.asc"),
"zip.asc"
)
);
return attachedArtifacts;
}

public class DistributionDetatchmentArtifactStub extends ArtifactStub {
public class DistributionDetachmentArtifactStub extends ArtifactStub {

private File artifact;

private String type;

public DistributionDetatchmentArtifactStub(File file, String type) {
public DistributionDetachmentArtifactStub(File file, String type) {
this.artifact = file;
this.type = type;
}
@@ -26,7 +26,7 @@
<artifactId>detach-distributions-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Mock Pom For Testing CommonsDistributionDetatchmentMojo</name>
<name>Mock Pom For Testing CommonsDistributionDetachmentMojo</name>

<dependencies>
<dependency>
@@ -26,7 +26,7 @@
<artifactId>stage-distributions-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Mock Pom For Testing CommonsDistributionDetatchmentMojo</name>
<name>Mock Pom For Testing CommonsDistributionStagingMojo</name>

<dependencies>
<dependency>

0 comments on commit d2c28a5

Please sign in to comment.