@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() ); TestFileUtils.assertContent( "artifact".getBytes( "UTF-8" ), artifactFile ); assertTrue( metadataFile.exists() ); TestFileUtils.assertContent( "metadata".getBytes( "UTF-8" ), 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.release(); } }
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.release(); } } }
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.release(); } } DefaultInstaller();  DefaultInstaller( Logger logger, FileProcessor fileProcessor,
                             RepositoryEventDispatcher repositoryEventDispatcher,
                             List<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory ); }
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.release(); } } DefaultInstaller();  DefaultInstaller( Logger logger, FileProcessor fileProcessor,
                             RepositoryEventDispatcher repositoryEventDispatcher,
                             List<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory ); void initService( ServiceLocator locator ); DefaultInstaller setLogger( Logger logger ); DefaultInstaller setFileProcessor( FileProcessor fileProcessor ); DefaultInstaller setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultInstaller addMetadataGeneratorFactory( MetadataGeneratorFactory factory ); DefaultInstaller setMetadataFactories( List<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.release(); } } DefaultInstaller();  DefaultInstaller( Logger logger, FileProcessor fileProcessor,
                             RepositoryEventDispatcher repositoryEventDispatcher,
                             List<MetadataGeneratorFactory> metadataFactories, SyncContextFactory syncContextFactory ); void initService( ServiceLocator locator ); DefaultInstaller setLogger( Logger logger ); DefaultInstaller setFileProcessor( FileProcessor fileProcessor ); DefaultInstaller setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultInstaller addMetadataGeneratorFactory( MetadataGeneratorFactory factory ); DefaultInstaller setMetadataFactories( List<MetadataGeneratorFactory> metadataFactories ); DefaultInstaller setSyncContextFactory( SyncContextFactory syncContextFactory ); InstallResult install( RepositorySystemSession session, InstallRequest request );  }