Search in sources :

Example 6 with MemoryPasswordManager

use of org.commonjava.maven.galley.auth.MemoryPasswordManager in project indy by Commonjava.

the class ArtifactStoreValidatorTest method setup.

@Before
public void setup() throws Exception {
    cacheDir = temp.newFolder();
    galley = new GalleyCoreBuilder(new FileCacheProviderFactory(cacheDir)).withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()))).build();
    validator = new ArtifactStoreValidator(galley.getTransferManager());
}
Also used : HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) Before(org.junit.Before)

Example 7 with MemoryPasswordManager

use of org.commonjava.maven.galley.auth.MemoryPasswordManager in project indy by Commonjava.

the class ImpliedRepositoryDetectorTest method setup.

@Before
public void setup() throws Throwable {
    fixture = new GalleyMavenFixture(temp);
    fixture.initGalley();
    fixture.withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager())));
    fixture.before();
    storeManager = new MemoryStoreDataManager(true);
    metadataManager = new ImpliedRepoMetadataManager(new IndyObjectMapper(true));
    final ImpliedRepoConfig config = new ImpliedRepoConfig();
    config.setEnabled(true);
    config.addEnabledGroupNamePattern(".*");
    File rootDir = temp.newFolder("indy.root");
    final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
    validator = new ArtifactStoreValidator(fixture.getTransferManager());
    final IndyObjectMapper mapper = new IndyObjectMapper(Collections.emptySet());
    ScriptEngine engine = new ScriptEngine(dataFiles);
    detector = new TestImpliedRepositoryDetector(fixture.getPomReader(), storeManager, metadataManager, validator, engine, config, mapper);
    summary = new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup");
    RemoteRepository remote = new RemoteRepository("test", "http://www.foo.com/repo");
    Group group = new Group("group", remote.getKey());
    storeManager.storeArtifactStore(remote, summary, false, true, new EventMetadata());
    storeManager.storeArtifactStore(group, summary, false, true, new EventMetadata());
    server.expect("HEAD", server.formatUrl("/repo/"), 200, "");
}
Also used : Group(org.commonjava.indy.model.core.Group) ArtifactStoreValidator(org.commonjava.indy.data.ArtifactStoreValidator) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) ImpliedRepoMetadataManager(org.commonjava.indy.implrepo.data.ImpliedRepoMetadataManager) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) GalleyMavenFixture(org.commonjava.maven.galley.testing.maven.GalleyMavenFixture) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) ImpliedRepoConfig(org.commonjava.indy.implrepo.conf.ImpliedRepoConfig) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) File(java.io.File) Before(org.junit.Before)

Example 8 with MemoryPasswordManager

use of org.commonjava.maven.galley.auth.MemoryPasswordManager in project galley by Commonjava.

the class EmbeddableCDIProducer method postConstruct.

@PostConstruct
public void postConstruct() {
    fileEventManager = new NoOpFileEventManager();
    transferDecorator = new NoOpTransferDecorator();
    pathGenerator = new HashedLocationPathGenerator();
    nfc = new MemoryNotFoundCache();
    // locationExpander = new NoOpLocationExpander();
    // locationResolver = new SimpleUrlLocationResolver( locationExpander, transportManager );
    transportManagerConfig = new TransportManagerConfig();
    passwordManager = new MemoryPasswordManager();
    http = new HttpImpl(passwordManager);
    objectMapper = new ObjectMapper();
    objectMapper.registerModules(new ProjectVersionRefSerializerModule());
    pluginDefaults = new StandardMaven350PluginDefaults();
    pluginImplications = new StandardMavenPluginImplications(xml);
}
Also used : NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) TransportManagerConfig(org.commonjava.maven.galley.config.TransportManagerConfig) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) StandardMavenPluginImplications(org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ProjectVersionRefSerializerModule(org.commonjava.maven.atlas.ident.jackson.ProjectVersionRefSerializerModule) StandardMaven350PluginDefaults(org.commonjava.maven.galley.maven.internal.defaults.StandardMaven350PluginDefaults) PostConstruct(javax.annotation.PostConstruct)

Aggregations

MemoryPasswordManager (org.commonjava.maven.galley.auth.MemoryPasswordManager)8 HttpImpl (org.commonjava.maven.galley.transport.htcli.HttpImpl)7 HttpClientTransport (org.commonjava.maven.galley.transport.htcli.HttpClientTransport)6 NoOpFileEventManager (org.commonjava.maven.galley.event.NoOpFileEventManager)5 HashedLocationPathGenerator (org.commonjava.maven.galley.io.HashedLocationPathGenerator)5 NoOpTransferDecorator (org.commonjava.maven.galley.io.NoOpTransferDecorator)5 Before (org.junit.Before)5 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)4 File (java.io.File)3 FileCacheProvider (org.commonjava.maven.galley.cache.FileCacheProvider)3 TransportManagerConfig (org.commonjava.maven.galley.config.TransportManagerConfig)3 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)3 TransportManagerImpl (org.commonjava.maven.galley.transport.TransportManagerImpl)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)2 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)2 ScriptEngine (org.commonjava.indy.subsys.template.ScriptEngine)2 TransferManagerImpl (org.commonjava.maven.galley.internal.TransferManagerImpl)2 DownloadHandler (org.commonjava.maven.galley.internal.xfer.DownloadHandler)2 ExistenceHandler (org.commonjava.maven.galley.internal.xfer.ExistenceHandler)2