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

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


        repo.getLocalStorage().setUrl(localUrl);
      }

      repository.setLocalStorage(ls);
      // mark local storage context dirty, if applicable
      final LocalStorageContext ctx = repository.getLocalStorageContext();
      if (ctx != null) {
        ctx.incrementGeneration();
      }
    }
    catch (LocalStorageException e) {
      ValidationResponse response = new ApplicationValidationResponse();
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.LocalStorageContext

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.