This repository has been archived by the owner on Dec 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Plexus Javadoc components to JSR330
- Loading branch information
1 parent
d32f8b2
commit 3800792
Showing
9 changed files
with
128 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
import org.codehaus.plexus.util.FileUtils; | ||
import org.codehaus.plexus.util.StringUtils; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
|
@@ -27,19 +29,16 @@ | |
* ChecksumFile | ||
* | ||
* @author <a href="mailto:[email protected]">Joakim Erdfelt</a> | ||
* @version $Id$ | ||
* @plexus.component role="org.codehaus.plexus.digest.ChecksumFile" | ||
*/ | ||
@Named | ||
public class ChecksumFile | ||
{ | ||
/** | ||
* @plexus.requirement role-hint="sha1" | ||
*/ | ||
@Inject | ||
@Named ( "sha1" ) | ||
private Digester digestSha1; | ||
|
||
/** | ||
* @plexus.requirement role-hint="md5"; | ||
*/ | ||
@Inject | ||
@Named ( "md5" ) | ||
private Digester digestMd5; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,14 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
import javax.inject.Named; | ||
|
||
/** | ||
* An MD5 implementation of the streaming digester. | ||
* | ||
* @author <a href="mailto:[email protected]">Brett Porter</a> | ||
* @plexus.component role="org.codehaus.plexus.digest.StreamingDigester" role-hint="md5" | ||
*/ | ||
@Named( "md5" ) | ||
public class StreamingMd5Digester | ||
extends AbstractStreamingDigester | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,14 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
import javax.inject.Named; | ||
|
||
/** | ||
* An SHA-1 implementation of the streaming digester. | ||
* | ||
* @author <a href="mailto:[email protected]">Brett Porter</a> | ||
* @plexus.component role="org.codehaus.plexus.digest.StreamingDigester" role-hint="sha1" | ||
*/ | ||
@Named( "sha1" ) | ||
public class StreamingSha1Digester | ||
extends AbstractStreamingDigester | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,29 +16,29 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
import org.codehaus.plexus.PlexusTestCase; | ||
import org.codehaus.plexus.testing.PlexusTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.inject.Inject; | ||
import java.io.File; | ||
|
||
import static org.codehaus.plexus.testing.PlexusExtension.getBasedir; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
/** | ||
* ChecksumFileTest | ||
* ChecksumFileTest | ||
* | ||
* @author <a href="mailto:[email protected]">Joakim Erdfelt</a> | ||
* @version $Id$ | ||
*/ | ||
public class ChecksumFileTest extends PlexusTestCase | ||
@PlexusTest | ||
class ChecksumFileTest | ||
{ | ||
@Inject | ||
private ChecksumFile checksum; | ||
|
||
protected void setUp() | ||
throws Exception | ||
{ | ||
super.setUp(); | ||
|
||
checksum = (ChecksumFile) lookup( ChecksumFile.class.getName() ); | ||
} | ||
|
||
public void testIsValidChecksum() | ||
@Test | ||
void isValidChecksum() | ||
throws Exception | ||
{ | ||
File exampleDir = new File( getBasedir(), "src/test/examples" ); | ||
|
@@ -59,7 +59,8 @@ public void testIsValidChecksum() | |
assertTrue( checksum.isValidChecksum( new File( exampleDir, "openssl.jar.sha1" ) ) ); | ||
} | ||
|
||
public void testCreateChecksum() | ||
@Test | ||
void createChecksum() | ||
throws Exception | ||
{ | ||
File dataFile = File.createTempFile( "plexus-digest-test", null ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.