obj = new ArtifactUpload( artifact, file );
@Test public void testFileHandleLeakage() throws IOException, NoRepositoryConnectorException { StubArtifact artifact = new StubArtifact( "testGroup", "testArtifact", "", "jar", "1-test" ); StubMetadata metadata = new StubMetadata( "testGroup", "testArtifact", "1-test", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); RepositoryConnector connector = factory().newInstance( session, repository ); File tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); ArtifactUpload artUp = new ArtifactUpload( artifact, tmpFile ); connector.put( Arrays.asList( artUp ), null ); assertTrue( "Leaking file handle in artifact upload", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); MetadataUpload metaUp = new MetadataUpload( metadata, tmpFile ); connector.put( null, Arrays.asList( metaUp ) ); assertTrue( "Leaking file handle in metadata upload", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); ArtifactDownload artDown = new ArtifactDownload( artifact, null, tmpFile, null ); connector.get( Arrays.asList( artDown ), null ); new File( tmpFile.getAbsolutePath() + ".sha1" ).deleteOnExit(); assertTrue( "Leaking file handle in artifact download", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); MetadataDownload metaDown = new MetadataDownload( metadata, null, tmpFile, null ); connector.get( null, Arrays.asList( metaDown ) ); new File( tmpFile.getAbsolutePath() + ".sha1" ).deleteOnExit(); assertTrue( "Leaking file handle in metadata download", tmpFile.delete() ); connector.close(); }
obj = new ArtifactUpload( artifact, file );
@Test public void testFileHandleLeakage() throws IOException, NoRepositoryConnectorException { StubArtifact artifact = new StubArtifact( "testGroup", "testArtifact", "", "jar", "1-test" ); StubMetadata metadata = new StubMetadata( "testGroup", "testArtifact", "1-test", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); RepositoryConnector connector = factory().newInstance( session, repository ); File tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); ArtifactUpload artUp = new ArtifactUpload( artifact, tmpFile ); connector.put( Arrays.asList( artUp ), null ); assertTrue( "Leaking file handle in artifact upload", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); MetadataUpload metaUp = new MetadataUpload( metadata, tmpFile ); connector.put( null, Arrays.asList( metaUp ) ); assertTrue( "Leaking file handle in metadata upload", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); ArtifactDownload artDown = new ArtifactDownload( artifact, null, tmpFile, null ); connector.get( Arrays.asList( artDown ), null ); new File( tmpFile.getAbsolutePath() + ".sha1" ).deleteOnExit(); assertTrue( "Leaking file handle in artifact download", tmpFile.delete() ); tmpFile = TestFileUtils.createTempFile( "testFileHandleLeakage" ); MetadataDownload metaDown = new MetadataDownload( metadata, null, tmpFile, null ); connector.get( null, Arrays.asList( metaDown ) ); new File( tmpFile.getAbsolutePath() + ".sha1" ).deleteOnExit(); assertTrue( "Leaking file handle in metadata download", tmpFile.delete() ); connector.close(); }
ArtifactUpload upA = new ArtifactUpload( artifact, emptyFile ); File dir = TestFileUtils.createTempDir( "con-test" ); File downAFile = new File( dir, "downA.file" );
ArtifactUpload upA = new ArtifactUpload( artifact, emptyFile ); File dir = TestFileUtils.createTempDir( "con-test" ); File downAFile = new File( dir, "downA.file" );
ArtifactUpload upA = new ArtifactUpload( artifact, file );
ArtifactUpload upA = new ArtifactUpload( artifact, file );
Metadata.Nature.RELEASE_OR_SNAPSHOT ); ArtifactUpload artUp = new ArtifactUpload( art, artifactFile ); MetadataUpload metaUp = new MetadataUpload( meta, metadataFile );
Metadata.Nature.RELEASE_OR_SNAPSHOT ); ArtifactUpload artUp = new ArtifactUpload( art, artifactFile ); MetadataUpload metaUp = new MetadataUpload( meta, metadataFile );