Package org.sonatype.nexus.proxy.storage.local

Examples of org.sonatype.nexus.proxy.storage.local.DefaultLocalStorageContext


    this.attributesHandler = checkNotNull(attributesHandler);
    this.accessManager = checkNotNull(accessManager);

    // we have been not configured yet! So, we have no ID and stuff coming from config!
    // post inject stuff
    this.localStorageContext = new DefaultLocalStorageContext(
        getApplicationConfiguration().getGlobalLocalStorageContext());
  }
View Full Code Here


      if (modified) {
        configurationSource.backupConfiguration();
        configurationSource.storeConfiguration();
      }

      globalLocalStorageContext = new DefaultLocalStorageContext(null);

      // create global remote ctx
      // this one has no parent
      globalRemoteStorageContext = new DefaultRemoteStorageContext(null);
View Full Code Here

    when(repository.getId()).thenReturn("mock");
    when(repository.getRepositoryKind()).thenReturn(new DefaultRepositoryKind(HostedRepository.class, null));
    when(repository.getLocalUrl()).thenReturn(repoLocation.toURI().toURL().toString());
    AttributesHandler attributesHandler = mock(AttributesHandler.class);
    when(repository.getAttributesHandler()).thenReturn(attributesHandler);
    when(repository.getLocalStorageContext()).thenReturn(new DefaultLocalStorageContext(null));
    RepositoryItemUid uid = mock(RepositoryItemUid.class);
    when(repository.createUid(anyString())).thenReturn(uid);


    DefaultFSLocalRepositoryStorage localRepositoryStorageUnderTest = new DefaultFSLocalRepositoryStorage(wastebasket,
View Full Code Here

    // Mocks
    Wastebasket wastebasket = mock(Wastebasket.class);
    Repository repository = mock(Repository.class);
    RepositoryItemUid uid = mock(RepositoryItemUid.class);
    when(repository.createUid(anyString())).thenReturn(uid);
    final DefaultLocalStorageContext localStorageContext = new DefaultLocalStorageContext(null);
    when(repository.getLocalStorageContext()).thenReturn(localStorageContext);
    FSPeer fsPeer = mock(FSPeer.class);
    MimeSupport mimeSupport = mock(MimeSupport.class);
    when(mimeSupport.guessMimeTypeFromPath(Mockito.any(MimeRulesSource.class), Mockito.anyString()))
        .thenReturn("text/plain");
View Full Code Here

    Repository repository = mock(Repository.class);
    RepositoryItemUid uid = mock(RepositoryItemUid.class);
    when(repository.getId()).thenReturn("test");
    when(repository.createUid(anyString())).thenReturn(uid);
    when(repository.getAttributesHandler()).thenReturn(mock(AttributesHandler.class));
    final DefaultLocalStorageContext localStorageContext = new DefaultLocalStorageContext(null);
    when(repository.getLocalStorageContext()).thenReturn(localStorageContext);
    FSPeer fsPeer = mock(FSPeer.class);
    MimeSupport mimeSupport = mock(MimeSupport.class);
    when(mimeSupport.guessMimeTypeFromPath(Mockito.any(MimeRulesSource.class), Mockito.anyString()))
        .thenReturn("text/plain");
View Full Code Here

      when(repository.getAttributesHandler()).thenReturn(Mockito.mock(AttributesHandler.class));
      // we return some URL, but does not matter which, this is only to avoid NPE
      // so execution path is "normal success" of storeItem in this case
      final File baseUrl = new File("target");
      when(repository.getLocalUrl()).thenReturn(baseUrl.toURI().toURL().toString());
      final LocalStorageContext localStorageContext = new DefaultLocalStorageContext(null);
      when(repository.getLocalStorageContext()).thenReturn(localStorageContext);

      final PreparedContentLocator pcl = new PreparedContentLocator(preparedStream, "text/plain", ContentLocator.UNKNOWN_LENGTH);

      final DefaultStorageFileItem file =
View Full Code Here

      final Repository repository = Mockito.mock(Repository.class);
      when(repository.getId()).thenReturn("test");
      when(repository.getAttributesHandler()).thenReturn(Mockito.mock(AttributesHandler.class));
      // we intentionally throw some unexpected exception here
      // so execution path here will be interrupted
      final LocalStorageContext localStorageContext = new DefaultLocalStorageContext(null);
      when(repository.getLocalStorageContext()).thenReturn(localStorageContext);

      when(repository.getLocalUrl()).thenThrow(new RuntimeException("Something unexpected!"));

      final PreparedContentLocator pcl = new PreparedContentLocator(preparedStream, "text/plain", ContentLocator.UNKNOWN_LENGTH);
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.storage.local.DefaultLocalStorageContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.