@Test public void testSuccessfulInstall() throws InstallationException, UnsupportedEncodingException, IOException { File artifactFile = new File( session.getLocalRepositoryManager().getRepository().getBasedir(), localArtifactPath ); File metadataFile = new File( session.getLocalRepositoryManager().getRepository().getBasedir(), localMetadataPath ); artifactFile.delete(); metadataFile.delete(); request.addArtifact( artifact ); request.addMetadata( metadata ); InstallResult result = installer.install( session, request ); assertTrue( artifactFile.exists() ); assertEquals( "artifact", TestFileUtils.readString( artifactFile ) ); assertTrue( metadataFile.exists() ); assertEquals( "metadata", TestFileUtils.readString( metadataFile ) ); assertEquals( result.getRequest(), request ); assertEquals( result.getArtifacts().size(), 1 ); assertTrue( result.getArtifacts().contains( artifact ) ); assertEquals( result.getMetadata().size(), 1 ); assertTrue( result.getMetadata().contains( metadata ) ); assertEquals( 1, lrm.getMetadataRegistration().size() ); assertTrue( lrm.getMetadataRegistration().contains( metadata ) ); assertEquals( 1, lrm.getArtifactRegistration().size() ); assertTrue( lrm.getArtifactRegistration().contains( artifact ) ); }
public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } }
DefaultInstaller implements Installer, Service { public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } } }
DefaultInstaller implements Installer, Service { public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } } DefaultInstaller(); @Inject  DefaultInstaller( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                      Set<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory,
                      LoggerFactory loggerFactory ); }
DefaultInstaller implements Installer, Service { public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } } DefaultInstaller(); @Inject  DefaultInstaller( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                      Set<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory,
                      LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultInstaller setLoggerFactory( LoggerFactory loggerFactory ); DefaultInstaller setFileProcessor( FileProcessor fileProcessor ); DefaultInstaller setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultInstaller addMetadataGeneratorFactory( MetadataGeneratorFactory factory ); DefaultInstaller setMetadataGeneratorFactories( Collection<MetadataGeneratorFactory> metadataFactories ); DefaultInstaller setSyncContextFactory( SyncContextFactory syncContextFactory ); InstallResult install( RepositorySystemSession session, InstallRequest request ); }
DefaultInstaller implements Installer, Service { public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } } DefaultInstaller(); @Inject  DefaultInstaller( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                      Set<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory,
                      LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultInstaller setLoggerFactory( LoggerFactory loggerFactory ); DefaultInstaller setFileProcessor( FileProcessor fileProcessor ); DefaultInstaller setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultInstaller addMetadataGeneratorFactory( MetadataGeneratorFactory factory ); DefaultInstaller setMetadataGeneratorFactories( Collection<MetadataGeneratorFactory> metadataFactories ); DefaultInstaller setSyncContextFactory( SyncContextFactory syncContextFactory ); InstallResult install( RepositorySystemSession session, InstallRequest request );  }