*/
protected ArtifactRepository repository;
- protected static final String remoteRepoUrl = "http://public.planetmirror.com/pub/maven2/";
-
- protected static final String remoteArtifactGroup = "HTTPClient";
-
- protected static final String remoteArtifactId = "HTTPClient";
-
- protected static final String remoteArtifactVersion = "0.3-3";
-
- protected static final String remoteArtifactScope = "compile";
-
- protected static final String remoteArtifactType = "jar";
-
- protected static final String remoteRepoId = "remote-repo";
-
protected void setUp()
throws Exception
{
assertTrue( "check if there is a failure", iter.hasNext() );
}
- /**
- * Test the checksum of an artifact located in a remote location.
- */
- /* public void testChecksumArtifactRemote()
- {
- ArtifactHandler handler = new DefaultArtifactHandler( remoteArtifactType );
- VersionRange version = VersionRange.createFromVersion( remoteArtifactVersion );
- Artifact artifact = new DefaultArtifact( remoteArtifactGroup, remoteArtifactId, version, remoteArtifactScope,
- remoteArtifactType, "", handler );
- ArtifactRepository repository = new DefaultArtifactRepository( remoteRepoId, remoteRepoUrl,
- new DefaultRepositoryLayout() );
-
- artifactReportProcessor.processArtifact( null, artifact, reporter, repository );
- if ( reporter.getFailures() == 2 )
- assertTrue( reporter.getFailures() == 2 );
-
- if ( reporter.getSuccesses() == 2 )
- assertTrue( reporter.getSuccesses() == 2 );
-
- }
- */
-
- /**
- * Test the checksum of a metadata file located in a remote location.
- */
- /* public void testChecksumMetadataRemote()
- {
-
- try
- {
- ArtifactHandler handler = new DefaultArtifactHandler( remoteArtifactType );
- VersionRange version = VersionRange.createFromVersion( remoteArtifactVersion );
- Artifact artifact = new DefaultArtifact( remoteArtifactGroup, remoteArtifactId, version,
- remoteArtifactScope, remoteArtifactType, "", handler );
- ArtifactRepository repository = new DefaultArtifactRepository( remoteRepoId, remoteRepoUrl,
- new DefaultRepositoryLayout() );
-
- RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact );
-
- metadataReportProcessor.processMetadata( metadata, repository, reporter );
- Iterator iter = reporter.getRepositoryMetadataFailureIterator();
- if ( iter.hasNext() )
- assertTrue( "check if there is a failure", iter.hasNext() );
-
- iter = reporter.getRepositoryMetadataSuccessIterator();
- if ( iter.hasNext() )
- assertTrue( "check if there is a success", iter.hasNext() );
-
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
- }
- */
-
/**
* Test the conditional when the checksum files of the artifact & metadata do not exist.
*/
artifactReportProcessor.processArtifact( null, artifact, reporter, repository );
assertEquals( 1, reporter.getWarnings() );
}
-
- /**
- * Test the InvalidPomArtifactReportProcessor when the pom is located in
- * a remote repository.
- */
- /* public void testRemotePomArtifactReportProcessorSuccess(){
- try{
- ArtifactHandler handler = new DefaultArtifactHandler( "pom" );
- VersionRange version = VersionRange.createFromVersion( remoteArtifactVersion );
- Artifact artifact = new DefaultArtifact( remoteArtifactGroup, remoteArtifactId, version, remoteArtifactScope,
- "pom", "", handler );
- ArtifactRepository repository = new DefaultArtifactRepository( remoteRepoId, remoteRepoUrl,
- new DefaultRepositoryLayout() );
-
- artifactReportProcessor.processArtifact(null, artifact, reporter, repository);
- if(reporter.getSuccesses() == 1)
- assertTrue(reporter.getSuccesses() == 1);
-
- }catch(Exception e){
-
- }
- }
- */
}
artifactReportProcessor.processArtifact( model, artifact, reporter, repository );
assertEquals( 1, reporter.getFailures() );
}
-
- /**
- * Test the LocationArtifactReportProcessor when the artifact is located in the remote repository.
- */
- /* public void testRemoteArtifactReportProcessorFailure()
- {
-
- ArtifactHandler handler = new DefaultArtifactHandler( remoteArtifactType );
- VersionRange version = VersionRange.createFromVersion( remoteArtifactVersion );
- Artifact artifact = new DefaultArtifact( remoteArtifactGroup, remoteArtifactId, version, remoteArtifactScope,
- remoteArtifactType, "", handler );
- ArtifactRepository repository = new DefaultArtifactRepository( remoteRepoId, remoteRepoUrl,
- new DefaultRepositoryLayout() );
- try
- {
- URL url = new URL( remoteRepoUrl + remoteArtifactGroup + "/" + remoteArtifactId + "/"
- + remoteArtifactVersion + "/" + remoteArtifactId + "-" + remoteArtifactVersion + ".pom" );
- InputStream is = url.openStream();
- Reader reader = new InputStreamReader( is );
- Model model = pomReader.read( reader );
-
- artifactReportProcessor.processArtifact( model, artifact, reporter, repository );
- if ( reporter.getFailures() > 0 )
- assertTrue( reporter.getFailures() == 1 );
-
- if ( reporter.getSuccesses() > 0 )
- assertTrue( reporter.getSuccesses() == 1 );
-
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
- }
- */
}